Skip to content

Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase.

feat: graft/ is a git-ignored local cache; drop bench/ + internal docs

anirudhkumar-nanonets821b12fcecd8
diff --git a/.claude-flow/data/pending-insights.jsonl b/.claude-flow/data/pending-insights.jsonl
deleted file mode 100644
index ffacbe4a..00000000
--- a/.claude-flow/data/pending-insights.jsonl
+++ /dev/null
@@ -1,301 +0,0 @@
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/graft-capability-map.html","success":true,"timestamp":1784538166049,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/graft-capability-map.html","success":true,"timestamp":1784539211190,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/specs/2026-07-20-graft-claude-code-integration-design.md","success":true,"timestamp":1784539537337,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-20-graft-claude-code-integration.md","success":true,"timestamp":1784541627192,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-20-graft-claude-code-integration.md","success":true,"timestamp":1784541680988,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-20-graft-claude-code-integration.md","success":true,"timestamp":1784541691099,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-state.test.ts","success":true,"timestamp":1784542321224,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/state.ts","success":true,"timestamp":1784542339812,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784542370316,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/state.ts","success":true,"timestamp":1784542564244,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/state.ts","success":true,"timestamp":1784542568194,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/state.ts","success":true,"timestamp":1784542573249,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-state.test.ts","success":true,"timestamp":1784542579051,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-state.test.ts","success":true,"timestamp":1784542585207,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784542619303,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-stats.test.ts","success":true,"timestamp":1784542679439,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/stats.ts","success":true,"timestamp":1784542693580,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-2-report.md","success":true,"timestamp":1784542725101,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-20-graft-claude-code-integration.md","success":true,"timestamp":1784542885291,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-20-graft-claude-code-integration.md","success":true,"timestamp":1784542899095,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-format.test.ts","success":true,"timestamp":1784542964542,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/format.ts","success":true,"timestamp":1784542978800,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/statusline.ts","success":true,"timestamp":1784542990551,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.claude/helpers/graft-statusline.cjs","success":true,"timestamp":1784543004594,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.claude/settings.json","success":true,"timestamp":1784543014432,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-3-report.md","success":true,"timestamp":1784543096843,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-format.test.ts","success":true,"timestamp":1784543314103,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-format.test.ts","success":true,"timestamp":1784543324024,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/format.ts","success":true,"timestamp":1784543337914,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/format.ts","success":true,"timestamp":1784543346396,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784543362003,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784543378102,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.claude/helpers/graft-hooks.cjs","success":true,"timestamp":1784543397111,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.claude/settings.json","success":true,"timestamp":1784543404836,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-4-report.md","success":true,"timestamp":1784543475512,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784543753317,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784543763410,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/sync-run.ts","success":true,"timestamp":1784543775912,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.claude/settings.json","success":true,"timestamp":1784543792736,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-5-report.md","success":true,"timestamp":1784543917169,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/sync-run.ts","success":true,"timestamp":1784544286226,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784544292679,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-5-report.md","success":true,"timestamp":1784544336737,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-format.test.ts","success":true,"timestamp":1784544415638,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-format.test.ts","success":true,"timestamp":1784544424559,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/format.ts","success":true,"timestamp":1784544437134,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784544447626,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784544466229,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.claude/settings.json","success":true,"timestamp":1784544482294,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-6-report.md","success":true,"timestamp":1784544568067,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784544775224,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784544784122,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-6-report.md","success":true,"timestamp":1784544821494,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-format.test.ts","success":true,"timestamp":1784544892304,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-format.test.ts","success":true,"timestamp":1784544896389,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/format.ts","success":true,"timestamp":1784544909400,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784544922376,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784544926493,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.claude/settings.json","success":true,"timestamp":1784544935134,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-7-report.md","success":true,"timestamp":1784544996201,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-format.test.ts","success":true,"timestamp":1784545167488,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-format.test.ts","success":true,"timestamp":1784545174924,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/format.ts","success":true,"timestamp":1784545187357,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/statusline.ts","success":true,"timestamp":1784545199830,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.claude/settings.json","success":true,"timestamp":1784545213164,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-8-report.md","success":true,"timestamp":1784545285344,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784545935010,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/format.ts","success":true,"timestamp":1784545936524,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/state.ts","success":true,"timestamp":1784545937886,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/final-review-fixes.md","success":true,"timestamp":1784546059627,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/pr-body.md","success":true,"timestamp":1784547146912,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/statusline.ts","success":true,"timestamp":1784548038119,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/specs/2026-07-20-graft-claude-code-integration-design.md","success":true,"timestamp":1784548640191,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/specs/2026-07-20-graft-claude-code-integration-design.md","success":true,"timestamp":1784548642800,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/specs/2026-07-20-graft-claude-code-integration-design.md","success":true,"timestamp":1784548649367,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/specs/2026-07-20-graft-claude-code-integration-design.md","success":true,"timestamp":1784548650471,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/pr-body.md","success":true,"timestamp":1784548706467,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/.claude/projects/-Users-shrishdwivedi-Documents-Context-graphs/memory/graft-no-third-party-tool-refs.md","success":true,"timestamp":1784548736544,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/.claude/projects/-Users-shrishdwivedi-Documents-Context-graphs/memory/MEMORY.md","success":true,"timestamp":1784548748105,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/specs/2026-07-20-graft-init-onboarding-design.md","success":true,"timestamp":1784551813492,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-20-graft-init-onboarding.md","success":true,"timestamp":1784551996391,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-shim-template.test.ts","success":true,"timestamp":1784552065541,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/shim-template.ts","success":true,"timestamp":1784552078369,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/package.json","success":true,"timestamp":1784552124282,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784552229312,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-settings-merge.test.ts","success":true,"timestamp":1784552444734,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/settings-merge.ts","success":true,"timestamp":1784552461173,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-2-report.md","success":true,"timestamp":1784552534301,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-init.test.ts","success":true,"timestamp":1784552793469,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/init.ts","success":true,"timestamp":1784552811084,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-init.test.ts","success":true,"timestamp":1784552834581,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-init.test.ts","success":true,"timestamp":1784552840380,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784552855178,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784552863358,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-3-report.md","success":true,"timestamp":1784553012098,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-init.test.ts","success":true,"timestamp":1784553197375,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-init.test.ts","success":true,"timestamp":1784553202250,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-init.test.ts","success":true,"timestamp":1784553208508,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/scripts/postinstall.mjs","success":true,"timestamp":1784553222209,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/package.json","success":true,"timestamp":1784553229209,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/package.json","success":true,"timestamp":1784553239383,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-4-report.md","success":true,"timestamp":1784553330748,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784553745952,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/pr-body-init.md","success":true,"timestamp":1784553861381,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-paths.test.ts","success":true,"timestamp":1784554822644,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/paths.ts","success":true,"timestamp":1784554843234,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784554854724,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784554859706,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784554860582,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/sync-run.ts","success":true,"timestamp":1784554870592,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/README.md","success":true,"timestamp":1784555107187,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/README.md","success":true,"timestamp":1784555113351,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/pr-body-fix.md","success":true,"timestamp":1784555152692,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784555767827,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784555783511,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/graphrank.ts","success":true,"timestamp":1784618636061,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784618646554,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784618673896,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784618683555,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784618690820,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784618905770,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784618947748,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask.test.ts","success":true,"timestamp":1784620301276,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784620426699,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784620434116,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784620451045,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/graphrank.test.ts","success":true,"timestamp":1784620522638,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/.claude/projects/-Users-shrishdwivedi-Documents-Context-graphs/memory/graft-retrieval-ceiling.md","success":true,"timestamp":1784620584132,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/bench-retrieval.mjs","success":true,"timestamp":1784621286415,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/README.md","success":true,"timestamp":1784621799235,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask.test.ts","success":true,"timestamp":1784622807702,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/extract.ts","success":true,"timestamp":1784623179348,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask.test.ts","success":true,"timestamp":1784623209893,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/.claude/projects/-Users-shrishdwivedi-Documents-Context-graphs/memory/graft-retrieval-ceiling.md","success":true,"timestamp":1784623302792,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/graphrank.ts","success":true,"timestamp":1784627534196,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/graphrank.ts","success":true,"timestamp":1784627540069,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/graphrank.ts","success":true,"timestamp":1784627546396,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/extract.ts","success":true,"timestamp":1784627557263,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/swebp-bench.mjs","success":true,"timestamp":1784629590707,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/swebp-bench.mjs","success":true,"timestamp":1784630557833,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/swebp-bench.mjs","success":true,"timestamp":1784630565732,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/swebp-bench.mjs","success":true,"timestamp":1784630576723,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/a82f2c86-3398-401b-9f04-ecbf0e8be519/scratchpad/swebp-bench.mjs","success":true,"timestamp":1784630590838,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-21-multi-host-init.md","success":true,"timestamp":1784634332784,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-sections.test.ts","success":true,"timestamp":1784634764404,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/sections.ts","success":true,"timestamp":1784634774715,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784634820116,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/d3b217f7-4a78-4399-b91a-8bb7db720797/scratchpad/crlf_test.mjs","success":true,"timestamp":1784634938245,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-sections.test.ts","success":true,"timestamp":1784635100054,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/sections.ts","success":true,"timestamp":1784635116226,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784635163517,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/sections.ts","success":true,"timestamp":1784635446614,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-sections.test.ts","success":true,"timestamp":1784635468656,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784635511384,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context\\ graphs/context-graph-engine/test/hosts-instructions.test.ts","success":true,"timestamp":1784635634465,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-registry.test.ts","success":true,"timestamp":1784635845612,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/registry.ts","success":true,"timestamp":1784635859093,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-3-report.md","success":true,"timestamp":1784635916331,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-init.test.ts","success":true,"timestamp":1784636102641,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/init.ts","success":true,"timestamp":1784636113639,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-4-report.md","success":true,"timestamp":1784636154058,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-init.test.ts","success":true,"timestamp":1784636396343,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-init.test.ts","success":true,"timestamp":1784636402670,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784636411617,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784636427857,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-5-report.md","success":true,"timestamp":1784636506705,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-init.test.ts","success":true,"timestamp":1784636758286,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/init.ts","success":true,"timestamp":1784636766118,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784636772487,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784636781141,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-5-report.md","success":true,"timestamp":1784636838017,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/README.md","success":true,"timestamp":1784637000730,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/README.md","success":true,"timestamp":1784637006206,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-6-report.md","success":true,"timestamp":1784637086872,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-21-graft-mcp.md","success":true,"timestamp":1784637449879,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/mcp-tools.test.ts","success":true,"timestamp":1784637520776,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/mcp/tools.ts","success":true,"timestamp":1784637537281,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/mcp/tools.ts","success":true,"timestamp":1784637562027,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/mcp/tools.ts","success":true,"timestamp":1784637567113,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/mcp/tools.ts","success":true,"timestamp":1784637723265,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/mcp/tools.ts","success":true,"timestamp":1784637725203,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784637741858,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/mcp-server.test.ts","success":true,"timestamp":1784637816764,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/mcp/server.ts","success":true,"timestamp":1784638002608,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784638007344,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784638013769,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-2-report.md","success":true,"timestamp":1784638053931,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-mcp-config.test.ts","success":true,"timestamp":1784638345777,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/mcp-config.ts","success":true,"timestamp":1784638360910,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-3-report.md","success":true,"timestamp":1784638400466,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-mcp-config.test.ts","success":true,"timestamp":1784638656190,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/mcp-config.ts","success":true,"timestamp":1784638667051,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-3-report.md","success":true,"timestamp":1784638691431,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-init.test.ts","success":true,"timestamp":1784638782720,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/init.ts","success":true,"timestamp":1784638792959,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/init.ts","success":true,"timestamp":1784638798155,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/init.ts","success":true,"timestamp":1784638802718,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784638807984,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784638814285,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/README.md","success":true,"timestamp":1784638821126,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-4-report.md","success":true,"timestamp":1784638870427,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-21-host-hooks.md","success":true,"timestamp":1784639153195,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784639278334,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784639292126,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784639312801,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784639351084,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/claude/hooks.ts","success":true,"timestamp":1784639580289,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784639594017,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784639603419,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/claude-hooks.test.ts","success":true,"timestamp":1784639617429,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-codex-hooks.test.ts","success":true,"timestamp":1784640061009,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-codex-hooks.test.ts","success":true,"timestamp":1784640070795,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/codex-hooks.ts","success":true,"timestamp":1784640079983,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/codex-hooks.ts","success":true,"timestamp":1784640085754,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-2-report.md","success":true,"timestamp":1784640124154,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-init.test.ts","success":true,"timestamp":1784640210912,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/init.ts","success":true,"timestamp":1784640226247,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/init.ts","success":true,"timestamp":1784640230378,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/init.ts","success":true,"timestamp":1784640235127,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784640240198,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784640247462,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/README.md","success":true,"timestamp":1784640252448,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-3-report.md","success":true,"timestamp":1784640293606,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/README.md","success":true,"timestamp":1784640644368,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/README.md","success":true,"timestamp":1784640645810,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/hosts-registry.test.ts","success":true,"timestamp":1784640647210,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/codex-hooks.ts","success":true,"timestamp":1784641128039,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/hosts/codex-hooks.ts","success":true,"timestamp":1784641129765,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/.claude/settings.json","success":true,"timestamp":1784644745634,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-21-ask-performance.md","success":true,"timestamp":1784653623708,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/graphrank.test.ts","success":true,"timestamp":1784653679562,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/graphrank.test.ts","success":true,"timestamp":1784653722818,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/graphrank.ts","success":true,"timestamp":1784653761487,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784653855171,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/d3b217f7-4a78-4399-b91a-8bb7db720797/scratchpad/verify_pagerank.mjs","success":true,"timestamp":1784653947849,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/index-file.ts","success":true,"timestamp":1784654215722,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784654223918,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784654232962,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784654242448,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784654249995,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784654267731,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784654313243,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/build.ts","success":true,"timestamp":1784654327302,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/build.ts","success":true,"timestamp":1784654332432,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784654388572,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784654398136,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-2-report.md","success":true,"timestamp":1784654549760,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/d3b217f7-4a78-4399-b91a-8bb7db720797/scratchpad/manual_ab.mjs","success":true,"timestamp":1784654704372,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/d3b217f7-4a78-4399-b91a-8bb7db720797/scratchpad/manual_ab.mjs","success":true,"timestamp":1784654722313,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/d3b217f7-4a78-4399-b91a-8bb7db720797/scratchpad/manual_ab.mjs","success":true,"timestamp":1784654733796,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/index-file.ts","success":true,"timestamp":1784654909759,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/index-file.ts","success":true,"timestamp":1784654911608,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/index-file.ts","success":true,"timestamp":1784654914597,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/index-file.ts","success":true,"timestamp":1784654917091,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/index-file.ts","success":true,"timestamp":1784654922044,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/build.ts","success":true,"timestamp":1784654930246,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784654940749,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784654961689,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784654973850,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784654974945,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784654976041,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-2-report.md","success":true,"timestamp":1784655112835,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/load.ts","success":true,"timestamp":1784668771731,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/graph-load.test.ts","success":true,"timestamp":1784668792457,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/mcp/tools.ts","success":true,"timestamp":1784668805015,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/mcp/tools.ts","success":true,"timestamp":1784668806121,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784668812320,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784668817182,"sessionId":null}
-{"type":"edit","file":"/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/d3b217f7-4a78-4399-b91a-8bb7db720797/scratchpad/mcp-warm-accept.mjs","success":true,"timestamp":1784668903314,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784668999350,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/load.ts","success":true,"timestamp":1784669273473,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/load.ts","success":true,"timestamp":1784669277797,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/load.ts","success":true,"timestamp":1784669281428,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784669303910,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/write.ts","success":true,"timestamp":1784669395770,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/write.ts","success":true,"timestamp":1784669405364,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/build.ts","success":true,"timestamp":1784669415910,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/ask/ask.ts","success":true,"timestamp":1784669427186,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/graph-write.test.ts","success":true,"timestamp":1784669516075,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784669525632,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784669546203,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784669647008,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784669657301,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784669673101,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784669688102,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784669693680,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784669699226,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/ask-index.test.ts","success":true,"timestamp":1784669704720,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-2-report.md","success":true,"timestamp":1784669929117,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/docs/superpowers/plans/2026-07-22-graph-commands.md","success":true,"timestamp":1784672509138,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/graph-traverse.test.ts","success":true,"timestamp":1784672669407,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/traverse.ts","success":true,"timestamp":1784672697244,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-1-report.md","success":true,"timestamp":1784672735285,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/graph-traverse-cli.test.ts","success":true,"timestamp":1784673035546,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/traverse-cli.ts","success":true,"timestamp":1784673061754,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784673070479,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts","success":true,"timestamp":1784673075766,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/test/graph-traverse-cli.test.ts","success":true,"timestamp":1784673405333,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/traverse-cli.ts","success":true,"timestamp":1784673409187,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/graph/traverse-cli.ts","success":true,"timestamp":1784673413146,"sessionId":null}
-{"type":"edit","file":"/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/.superpowers/sdd/task-2-report.md","success":true,"timestamp":1784673435244,"sessionId":null}
diff --git a/.context/graph.json b/.context/graph.json
deleted file mode 100644
index 20096a48..00000000
--- a/.context/graph.json
+++ /dev/null
@@ -1,7812 +0,0 @@
-{
- "meta": {
- "version": 1,
- "nodeCount": 284,
- "edgeCount": 637,
- "languages": [
- "typescript"
- ]
- },
- "nodes": [
- {
- "id": "bench/agent.ts",
- "name": "agent.ts",
- "kind": "file",
- "path": "bench/agent.ts",
- "span": "L1-L323",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e10d64f913c9517cef84cce58ea042d71bed3e94182c791245170eca54060e31",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/agent.ts#AgentResult",
- "name": "AgentResult",
- "kind": "interface",
- "path": "bench/agent.ts",
- "span": "L19-L27",
- "signature": "interface AgentResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "f4e0672910fa23856c22d12c1cdd474a4d144a773e9147f6e70b67fcbc2f9cdc",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/agent.ts#globToRegExp",
- "name": "globToRegExp",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L92-L106",
- "signature": "function globToRegExp(glob: string): RegExp",
- "exported": false,
- "origin": "ast",
- "body_hash": "bf9f513a64c4a25612509c1bc9ca3e5ab141d47051aee3cb4d487fc6d87fd484",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/agent.ts#listFiles",
- "name": "listFiles",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L62-L89",
- "signature": "function listFiles(root: string): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "c99c73e1c6a44093a6f779cd0b4c54db649c4f0fb0c03a6af9c38673bc24f711",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/agent.ts#listFiles.walk",
- "name": "walk",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L64-L86",
- "signature": "walk = (dir: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "5a2365b8f09853c622d73cf63ed6804cf9fe3667bfc30f981759e2aff5483b43",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/agent.ts#runAgent",
- "name": "runAgent",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L230-L322",
- "signature": "async function runAgent(opts: RunAgentOptions): Promise<AgentResult>",
- "exported": true,
- "origin": "ast",
- "body_hash": "32cb0dc584762b0c9da95c2c69d73afb0d7a9b59628e53e306cd341a0d92cb44",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/agent.ts#runAgent.slideCacheBreakpoint",
- "name": "slideCacheBreakpoint",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L254-L260",
- "signature": "slideCacheBreakpoint = ()",
- "exported": true,
- "origin": "ast",
- "body_hash": "c5c9e42b4e085cfd27d6614a97f5208d50aed8551304862e6eb81c56edab795a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/agent.ts#RunAgentOptions",
- "name": "RunAgentOptions",
- "kind": "interface",
- "path": "bench/agent.ts",
- "span": "L29-L37",
- "signature": "interface RunAgentOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "b786c099fceddc6e582d26ab2a302637b256ba7144fae8629b8611325b0018e0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/agent.ts#runTool",
- "name": "runTool",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L168-L228",
- "signature": "function runTool(root: string, name: string, input: any): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "e4b0b544cf7ac1c6c08fa61827000496bb74311f04305b9868e5d70695cea9e1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/agent.ts#safePath",
- "name": "safePath",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L46-L60",
- "signature": "function safePath(root: string, p: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "8a6349aeb94f54f93a15bde379809135e40fcb4844de10eab68d4c95f0301a16",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/judge.ts",
- "name": "judge.ts",
- "kind": "file",
- "path": "bench/judge.ts",
- "span": "L1-L88",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "94c222341b066e4f3134b3d9d3f30f31b9ffe7b92967086b07c58f297d349936",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/judge.ts#extractJson",
- "name": "extractJson",
- "kind": "function",
- "path": "bench/judge.ts",
- "span": "L35-L49",
- "signature": "function extractJson(text: string): any",
- "exported": false,
- "origin": "ast",
- "body_hash": "8598a77c27df0c2d51964f8e5bd27752fca0c0af9b038302069d9440535fe911",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/judge.ts#judge",
- "name": "judge",
- "kind": "function",
- "path": "bench/judge.ts",
- "span": "L51-L87",
- "signature": "async function judge(input: JudgeInput): Promise<Verdict>",
- "exported": true,
- "origin": "ast",
- "body_hash": "98496fb2f15740ca1a47bcfd39f9a44f0b320a2c53d3c21086fdcb8304f88f43",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/judge.ts#JudgeInput",
- "name": "JudgeInput",
- "kind": "interface",
- "path": "bench/judge.ts",
- "span": "L26-L32",
- "signature": "interface JudgeInput",
- "exported": true,
- "origin": "ast",
- "body_hash": "d22eb2a46b81a9e2f6f55c9f1409b5afc682ab8028ef88f8522a0397dcb1a2bc",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/judge.ts#Verdict",
- "name": "Verdict",
- "kind": "interface",
- "path": "bench/judge.ts",
- "span": "L18-L24",
- "signature": "interface Verdict",
- "exported": true,
- "origin": "ast",
- "body_hash": "650e88981503f18e5a30dc0050ad111724eb40d2d32ebb0bec9106bb3d934e50",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/llm.ts",
- "name": "llm.ts",
- "kind": "file",
- "path": "bench/llm.ts",
- "span": "L1-L19",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "6c0d2a02ac6aa86de94f779355020700a4d9016e2f4b431bf75560e1d3c51229",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/llm.ts#makeClient",
- "name": "makeClient",
- "kind": "function",
- "path": "bench/llm.ts",
- "span": "L14-L18",
- "signature": "function makeClient(): OpenAI",
- "exported": true,
- "origin": "ast",
- "body_hash": "1de90a5deaf00c7680162630fe437cfc2cc72204aaabf5150922b9b40da021bf",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/report.ts",
- "name": "report.ts",
- "kind": "file",
- "path": "bench/report.ts",
- "span": "L1-L126",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "775be8c40a8e4172521bba8f6a1f026fa23c4d24b9b5225da3ed5b745077a5b0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/report.ts#aggregate",
- "name": "aggregate",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L56-L68",
- "signature": "function aggregate(rows: Row[]): ArmAgg",
- "exported": false,
- "origin": "ast",
- "body_hash": "2dc5a442b3d9d4a3a674a2bee1a8ceddd9410a4d92bacf30bea4503e7588f3fb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/report.ts#ArmAgg",
- "name": "ArmAgg",
- "kind": "interface",
- "path": "bench/report.ts",
- "span": "L44-L54",
- "signature": "interface ArmAgg",
- "exported": false,
- "origin": "ast",
- "body_hash": "a7a78cc5f14ddd30155d952a75e96f4508ffbf4d3bf432e53945cbf055cc67dd",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/report.ts#buildMarkdown",
- "name": "buildMarkdown",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L80-L125",
- "signature": "function buildMarkdown(rows: Row[]): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "9534d62231f50105f1ef247af6dd99e180786c443307f1eb82b47e5c9d631152",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/report.ts#costOf",
- "name": "costOf",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L33-L38",
- "signature": "function costOf(r: { tokensInput: number; tokensOutput: number; cacheRead: number; cacheCreate: number }): number",
- "exported": true,
- "origin": "ast",
- "body_hash": "413c8810eda0e5edbb94cf5a7491732fdc1e4cb3df89eda614e7ce145f2b7c11",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/report.ts#fmt",
- "name": "fmt",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L76-L78",
- "signature": "function fmt(n: number): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "e5554c617b5485df92a2ba8792f4bb715431c2aa0a21f7e900465d0a2690e5b1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/report.ts#mean",
- "name": "mean",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L40-L42",
- "signature": "function mean(xs: number[]): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "bc3ca4cedc8d6833e415c55049ed08517980bbc60e432640f883cbed2e5aafae",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/report.ts#pctDelta",
- "name": "pctDelta",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L70-L74",
- "signature": "function pctDelta(cold: number, graph: number): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "e8adea58e85eb9a811c2fbdd6e999781ca014f54162f777f2dbd29cbc541e972",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/report.ts#Row",
- "name": "Row",
- "kind": "interface",
- "path": "bench/report.ts",
- "span": "L6-L26",
- "signature": "interface Row",
- "exported": true,
- "origin": "ast",
- "body_hash": "5715f0dee9c689834b1869bbb14379fbc55d730fbf32dbee62bb7d4ec87f3915",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/run.ts",
- "name": "run.ts",
- "kind": "file",
- "path": "bench/run.ts",
- "span": "L1-L207",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a0d2859628588f45ae31862f5f801d6219802449c23bbbdba9aa51b7b9febf47",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/run.ts#Args",
- "name": "Args",
- "kind": "interface",
- "path": "bench/run.ts",
- "span": "L29-L35",
- "signature": "interface Args",
- "exported": false,
- "origin": "ast",
- "body_hash": "07bb0961cc69a2894c3baf9941dd072b901a4d94d3527b04a94397d5c88a749f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/run.ts#main",
- "name": "main",
- "kind": "function",
- "path": "bench/run.ts",
- "span": "L84-L201",
- "signature": "async function main()",
- "exported": false,
- "origin": "ast",
- "body_hash": "dbf48031433ab51d95363a6e6c55ea949fab2c2a53e903da497fe05f1d58edf5",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/run.ts#makeDocsWorkdir",
- "name": "makeDocsWorkdir",
- "kind": "function",
- "path": "bench/run.ts",
- "span": "L69-L82",
- "signature": "async function makeDocsWorkdir(corpus: Corpus): Promise<string>",
- "exported": false,
- "origin": "ast",
- "body_hash": "9688c56522bfdc0e8c20e07526ee021ddd45ab6d77a116b06df1fb770021e017",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/run.ts#parseArgs",
- "name": "parseArgs",
- "kind": "function",
- "path": "bench/run.ts",
- "span": "L37-L52",
- "signature": "function parseArgs(argv: string[]): Args",
- "exported": false,
- "origin": "ast",
- "body_hash": "dd2d7d4756b068252199a77e1af829fea67d99e8924610198ca79f48a994635b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/run.ts#pool",
- "name": "pool",
- "kind": "function",
- "path": "bench/run.ts",
- "span": "L55-L66",
- "signature": "async function pool<T, R>(items: T[], n: number, fn: (item: T) => Promise<R>): Promise<R[]>",
- "exported": false,
- "origin": "ast",
- "body_hash": "a7195db3e63798d9ce8138057327e135cc12f0187a870a4856f5b0c5b1c21e84",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/run.ts#pool.worker",
- "name": "worker",
- "kind": "function",
- "path": "bench/run.ts",
- "span": "L58-L63",
- "signature": "async function worker()",
- "exported": false,
- "origin": "ast",
- "body_hash": "b9705c00faf21752c1d6cd68735d93e6f2a95a30b4ca5b5df894f01966715f79",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/selfcheck.ts",
- "name": "selfcheck.ts",
- "kind": "file",
- "path": "bench/selfcheck.ts",
- "span": "L1-L120",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "0eaf577938e20fa27d9cd0157bc8843fdc37165d85696789334b8605138f4bb4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/selfcheck.ts#main",
- "name": "main",
- "kind": "function",
- "path": "bench/selfcheck.ts",
- "span": "L50-L114",
- "signature": "async function main()",
- "exported": false,
- "origin": "ast",
- "body_hash": "5f20853f3387db063509fe8426e6f34758fdac602fbef13cba81514ec752483b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/selfcheck.ts#makeStubClient",
- "name": "makeStubClient",
- "kind": "function",
- "path": "bench/selfcheck.ts",
- "span": "L19-L48",
- "signature": "function makeStubClient()",
- "exported": false,
- "origin": "ast",
- "body_hash": "3ac524103f28630ba8f080c62707872e56d513b46b57b6753cb07c8c6c44f249",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/tasks.ts",
- "name": "tasks.ts",
- "kind": "file",
- "path": "bench/tasks.ts",
- "span": "L1-L281",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "d21168797f40d193a914aca0c438409d29d300441bc0a6a518c93869240b3b69",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/tasks.ts#Corpus",
- "name": "Corpus",
- "kind": "interface",
- "path": "bench/tasks.ts",
- "span": "L39-L45",
- "signature": "interface Corpus",
- "exported": true,
- "origin": "ast",
- "body_hash": "4b3ae3ef3d07322b65aaa6b2821f5c8e6871251bdc7ab6d8248ce584a28a5603",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/tasks.ts#repoPath",
- "name": "repoPath",
- "kind": "function",
- "path": "bench/tasks.ts",
- "span": "L26-L29",
- "signature": "function repoPath(id: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "96ac12ff90253b3d673f747af65246aa6707ba09fda29f12266b75fbc9ae50f7",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "bench/tasks.ts#Task",
- "name": "Task",
- "kind": "interface",
- "path": "bench/tasks.ts",
- "span": "L31-L37",
- "signature": "interface Task",
- "exported": true,
- "origin": "ast",
- "body_hash": "ec755cc45cea139405762338ce104dfa8b2307f7bfa4f7733f731e6d80c21cb8",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "scripts/build-viewer.mjs",
- "name": "build-viewer.mjs",
- "kind": "file",
- "path": "scripts/build-viewer.mjs",
- "span": "L1-L29",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "fb4ba16d7815dbdbaf2fd818362f914671903132be5573fbdd9a7734549b833d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts",
- "name": "crux.ts",
- "kind": "file",
- "path": "src/ai/crux.ts",
- "span": "L1-L128",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e81750029e4c8641cdaf2b4894f595297839e07a73076e4cdac1522515f923a8",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#CruxSummarizer",
- "name": "CruxSummarizer",
- "kind": "interface",
- "path": "src/ai/crux.ts",
- "span": "L42-L44",
- "signature": "interface CruxSummarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "03333336a2e057667a15b39364d3ba6f09ea739b8c1a35c4b3dfdd71c6f5d4d9",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#FileCruxInput",
- "name": "FileCruxInput",
- "kind": "interface",
- "path": "src/ai/crux.ts",
- "span": "L29-L33",
- "signature": "interface FileCruxInput",
- "exported": true,
- "origin": "ast",
- "body_hash": "5216f1ff3c8ce99cfac0130265f5b9597634df473889050b2af1e193c545ebab",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#NodeCrux",
- "name": "NodeCrux",
- "kind": "interface",
- "path": "src/ai/crux.ts",
- "span": "L35-L40",
- "signature": "interface NodeCrux",
- "exported": true,
- "origin": "ast",
- "body_hash": "df4fb16fefdd35c322e1af2e13c09a9afff91dbd0e96584daaec163aa147c1cd",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#NodeRef",
- "name": "NodeRef",
- "kind": "interface",
- "path": "src/ai/crux.ts",
- "span": "L21-L27",
- "signature": "interface NodeRef",
- "exported": true,
- "origin": "ast",
- "body_hash": "5c9fb969ad7415cf5ba23dfaa412ca015165fe5f8ef98d626b780facc4f6492f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#numberLines",
- "name": "numberLines",
- "kind": "function",
- "path": "src/ai/crux.ts",
- "span": "L63-L70",
- "signature": "function numberLines(source: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "a80ad2a4410262e8c7ff4a8827e3c2f29bf357defa21d228d71b8d278b09acce",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#OpenRouterCruxSummarizer",
- "name": "OpenRouterCruxSummarizer",
- "kind": "class",
- "path": "src/ai/crux.ts",
- "span": "L101-L127",
- "signature": "class OpenRouterCruxSummarizer implements CruxSummarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "20704346ba50c09895e6a19c3574156db46df9e20baa6286bf1bf6a479c2650b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#OpenRouterCruxSummarizer.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "src/ai/crux.ts",
- "span": "L105-L112",
- "signature": "constructor(apiKey: string, model: string, baseUrl = \"https://openrouter.ai/api/v1\")",
- "exported": true,
- "origin": "ast",
- "body_hash": "11789569c2566d5187db773c70ebb755e57415aafb4b2d35fd3473dfdfda4958",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#OpenRouterCruxSummarizer.describeFile",
- "name": "describeFile",
- "kind": "method",
- "path": "src/ai/crux.ts",
- "span": "L114-L126",
- "signature": "async describeFile(input: FileCruxInput): Promise<NodeCrux[]>",
- "exported": true,
- "origin": "ast",
- "body_hash": "f9db855cb28cb76a21cabb928924cf83d145fc206bce5c340d4615c260653e18",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#parseResults",
- "name": "parseResults",
- "kind": "function",
- "path": "src/ai/crux.ts",
- "span": "L84-L98",
- "signature": "function parseResults(raw: string): NodeCrux[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "91399ce86a0308307952e61ac203bef3df08f912fe4bfdab3ef7260ae6830da1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#parseResults.num",
- "name": "num",
- "kind": "function",
- "path": "src/ai/crux.ts",
- "span": "L88-L88",
- "signature": "num = (v: unknown)",
- "exported": false,
- "origin": "ast",
- "body_hash": "63e8d8e280862f40666698b44f9fb1b4ca58c1712ed8c1f3266c59b683c83471",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/crux.ts#userContent",
- "name": "userContent",
- "kind": "function",
- "path": "src/ai/crux.ts",
- "span": "L72-L81",
- "signature": "function userContent(input: FileCruxInput): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c69c7e7741d7da1191a463b960489184527e8d4e0deae84306011fae6469159e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/providers.ts",
- "name": "providers.ts",
- "kind": "file",
- "path": "src/ai/providers.ts",
- "span": "L1-L56",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "c0d1294d6fa49f6d06ff9bb137b34ea897f94a67810a839cd5705a1fa5995483",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/providers.ts#EngineConfig",
- "name": "EngineConfig",
- "kind": "interface",
- "path": "src/ai/providers.ts",
- "span": "L9-L25",
- "signature": "interface EngineConfig",
- "exported": true,
- "origin": "ast",
- "body_hash": "a7457b873338ce2ea7e53be6eca715bcbfce5cc85dd0d8b770145702027e6836",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/providers.ts#resolveConfig",
- "name": "resolveConfig",
- "kind": "function",
- "path": "src/ai/providers.ts",
- "span": "L43-L55",
- "signature": "function resolveConfig(config: EngineConfig = {}): ResolvedConfig",
- "exported": true,
- "origin": "ast",
- "body_hash": "9bc6a9e9d026366226705cba49e3d45fc68ee309ec3106c750983cba9d292bad",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/providers.ts#ResolvedConfig",
- "name": "ResolvedConfig",
- "kind": "interface",
- "path": "src/ai/providers.ts",
- "span": "L28-L35",
- "signature": "interface ResolvedConfig",
- "exported": true,
- "origin": "ast",
- "body_hash": "7f4ebf13b13a0cf260534237a8b8ee71fb2dfa23c113c63aa860169af6d6ad70",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/summarize.ts",
- "name": "summarize.ts",
- "kind": "file",
- "path": "src/ai/summarize.ts",
- "span": "L1-L62",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "6e67f3866c75d88a8b1d265e510578f3e3014d9cfd8b2469e6e4afbd67977f93",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/summarize.ts#OpenRouterSummarizer",
- "name": "OpenRouterSummarizer",
- "kind": "class",
- "path": "src/ai/summarize.ts",
- "span": "L37-L61",
- "signature": "class OpenRouterSummarizer implements Summarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "d5ccc8425da5d5e01cb9d0371aa4b7f6ddc27ca2f5b33d06315b2141b1ba5f44",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/summarize.ts#OpenRouterSummarizer.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "src/ai/summarize.ts",
- "span": "L41-L48",
- "signature": "constructor(apiKey: string, model: string, baseUrl = \"https://openrouter.ai/api/v1\")",
- "exported": true,
- "origin": "ast",
- "body_hash": "11789569c2566d5187db773c70ebb755e57415aafb4b2d35fd3473dfdfda4958",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/summarize.ts#OpenRouterSummarizer.summarize",
- "name": "summarize",
- "kind": "method",
- "path": "src/ai/summarize.ts",
- "span": "L50-L60",
- "signature": "async summarize(code: string, opts: { path: string }): Promise<string>",
- "exported": true,
- "origin": "ast",
- "body_hash": "b87a1b9c3fa411f6d60e20f3668c506deaf6675277847809f4da00b7bde5d2b7",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/summarize.ts#Summarizer",
- "name": "Summarizer",
- "kind": "interface",
- "path": "src/ai/summarize.ts",
- "span": "L13-L15",
- "signature": "interface Summarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "53141087f1297119f32328d09c2f9289dcb09ab0ca3d9ac4b066be98e868166e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/summarize.ts#userContent",
- "name": "userContent",
- "kind": "function",
- "path": "src/ai/summarize.ts",
- "span": "L28-L34",
- "signature": "function userContent(code: string, path: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "96aac9962d6811777880bc7062fa497e9cc46e103b7c4620c2d84eaf7d8e4ba2",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts",
- "name": "synthesize.ts",
- "kind": "file",
- "path": "src/ai/synthesize.ts",
- "span": "L1-L161",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "1531389b3e438bac4800227d5db0eb71027dd80ad6bfe0c288cc678464136696",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#clean",
- "name": "clean",
- "kind": "function",
- "path": "src/ai/synthesize.ts",
- "span": "L96-L118",
- "signature": "function clean(nodes: unknown): SynthNode[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "2344d8c4c88dd2126c437bedfed4688859387f3303ae33aae9a056f42ff7bad8",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#FileSummary",
- "name": "FileSummary",
- "kind": "interface",
- "path": "src/ai/synthesize.ts",
- "span": "L30-L33",
- "signature": "interface FileSummary",
- "exported": true,
- "origin": "ast",
- "body_hash": "4c10af76458e184f8d32e13ead75fdbba2b173af7e915f3b6378f895b64bacff",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#OpenRouterSynthesizer",
- "name": "OpenRouterSynthesizer",
- "kind": "class",
- "path": "src/ai/synthesize.ts",
- "span": "L130-L159",
- "signature": "class OpenRouterSynthesizer implements Synthesizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "8281c93146b94be4f6d884607e02a9fe4d3a48537eb10044253dcdbe5394c8ac",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#OpenRouterSynthesizer.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "src/ai/synthesize.ts",
- "span": "L134-L137",
- "signature": "constructor(apiKey: string, model: string, baseUrl = \"https://openrouter.ai/api/v1\")",
- "exported": true,
- "origin": "ast",
- "body_hash": "20d1ed2a31c60772d22eb649c1eb6d3cb646b80d751cce76eb8e71c6cc3018a6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#OpenRouterSynthesizer.synthesize",
- "name": "synthesize",
- "kind": "method",
- "path": "src/ai/synthesize.ts",
- "span": "L139-L158",
- "signature": "async synthesize(files: FileSummary[]): Promise<SynthNode[]>",
- "exported": true,
- "origin": "ast",
- "body_hash": "f1b94e63417194a18be9062aa3f46838f9c92d65231ceea54d554ecc2aadc767",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#Synthesizer",
- "name": "Synthesizer",
- "kind": "interface",
- "path": "src/ai/synthesize.ts",
- "span": "L35-L37",
- "signature": "interface Synthesizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "55ed4f6b07f808a7591164fad62527f00d6c042c12f5ff1445f29edaf2674d74",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#SynthLink",
- "name": "SynthLink",
- "kind": "interface",
- "path": "src/ai/synthesize.ts",
- "span": "L12-L16",
- "signature": "interface SynthLink",
- "exported": true,
- "origin": "ast",
- "body_hash": "0881e19e19cb63095252ce3b817cad3adb83241167ae37dfc274d245e3e9caac",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#SynthNode",
- "name": "SynthNode",
- "kind": "interface",
- "path": "src/ai/synthesize.ts",
- "span": "L19-L27",
- "signature": "interface SynthNode",
- "exported": true,
- "origin": "ast",
- "body_hash": "b53b2a25e45cfe4a931d93e2a908bafb4ea7d5fe1a02282a18af3f2010b14277",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#userContent",
- "name": "userContent",
- "kind": "function",
- "path": "src/ai/synthesize.ts",
- "span": "L88-L93",
- "signature": "function userContent(files: FileSummary[]): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "6873b0a9e5dedbebac883fdce991492dd5d2260990d1dd440dcaa60b1bb1c4e9",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/cli.ts",
- "name": "cli.ts",
- "kind": "file",
- "path": "src/cli.ts",
- "span": "L1-L147",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "869fb851e61c4f0e3ab6eb8b104a7d9d6954f240987363b8a44edf6aadb69ee8",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/cli.ts#engineFrom",
- "name": "engineFrom",
- "kind": "function",
- "path": "src/cli.ts",
- "span": "L26-L29",
- "signature": "function engineFrom(): Graft",
- "exported": false,
- "origin": "ast",
- "body_hash": "ddbb4f4e57bee5d05b95dc81f034e26183495162d84c6a290e12c6fda6c92ee8",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/cli.ts#fmt",
- "name": "fmt",
- "kind": "function",
- "path": "src/cli.ts",
- "span": "L71-L75",
- "signature": "fmt = (o: Record<string, number>)",
- "exported": false,
- "origin": "ast",
- "body_hash": "31c01b913d716a1932fff4c3a0e4a82dfa745d73f488f05b3d71910145bf98ad",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts",
- "name": "build.ts",
- "kind": "file",
- "path": "src/context/build.ts",
- "span": "L1-L350",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "8c614e5dc6b1ef2d6949016ce7480099f95f021ea6b0882f2919397f97a68ce7",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#batchBySize",
- "name": "batchBySize",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L269-L285",
- "signature": "function batchBySize(files: FileSummary[], budget: number): FileSummary[][]",
- "exported": false,
- "origin": "ast",
- "body_hash": "5875cfc2eae35e10fbe5105c48209f37d2b121b15dff5a0ebf1bb9dbf96f8eb7",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#batchKey",
- "name": "batchKey",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L288-L295",
- "signature": "function batchKey(batch: FileSummary[], hashByPath: Map<string, string>): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "8fece338d989b714e96a275a7d4febdf2292a4a25590ce4b3ec73d6be5b45827",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#BuildCache",
- "name": "BuildCache",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L78-L81",
- "signature": "interface BuildCache",
- "exported": false,
- "origin": "ast",
- "body_hash": "c359f1a92e6d72b2734f0ff2f8f38879f95eca1af6ddb47c4c6cab0f62a32133",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#buildContext",
- "name": "buildContext",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L99-L266",
- "signature": "async function buildContext(dir: string, opts: BuildOptions): Promise<BuildResult>",
- "exported": true,
- "origin": "ast",
- "body_hash": "e2afee780fd3be28d7cf55c8aa3fdfebc10ddb1ec63ffbe50f5e712a4625c0f2",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#BuildOptions",
- "name": "BuildOptions",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L54-L64",
- "signature": "interface BuildOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "a8c3781581f56372337a3c3ddd980b7be084f78b359820f8540ec384807c57a8",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#BuildProgress",
- "name": "BuildProgress",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L47-L52",
- "signature": "interface BuildProgress",
- "exported": true,
- "origin": "ast",
- "body_hash": "144303735947dfd0c43c5a58e2f8d53ad35ad62b438f65c29c51a56e1dfa56b2",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#BuildResult",
- "name": "BuildResult",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L66-L75",
- "signature": "interface BuildResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "5d4316f8de68fbeba849eaa7a8b12892855205f006361e2a32049e135cf9407e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#cachePath",
- "name": "cachePath",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L310-L312",
- "signature": "function cachePath(outDir: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "ff252b490e39f50d7aa97d0a9fc2ad6330248f194cf27cc31981329e833fb8aa",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#errMsg",
- "name": "errMsg",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L306-L308",
- "signature": "function errMsg(err: unknown): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "79993b725e730fcec35e4a32479a51dfba694b5c9bf900db729b6fc821caee71",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#FileWork",
- "name": "FileWork",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L83-L87",
- "signature": "interface FileWork",
- "exported": false,
- "origin": "ast",
- "body_hash": "06db66a9c25581eac975d533a049ce38bfed463080492389915feb84d9634171",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#loadCache",
- "name": "loadCache",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L314-L325",
- "signature": "function loadCache(outDir: string): BuildCache",
- "exported": false,
- "origin": "ast",
- "body_hash": "8f0f4b949cd4d774433b4043ef9d154fa5722e45d19f69fb4fb1843c4071a3af",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#mapWithConcurrency",
- "name": "mapWithConcurrency",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L334-L349",
- "signature": "async function mapWithConcurrency<T, R>( items: T[], limit: number, fn: (item: T, index: number) => Promise<R>, ): Promise<R[]>",
- "exported": false,
- "origin": "ast",
- "body_hash": "a4c9438ba7cb397b91c5ab695f081e20db5678db9eea0be35a086fda1d9714e5",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#NodeDraft",
- "name": "NodeDraft",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L90-L97",
- "signature": "interface NodeDraft",
- "exported": false,
- "origin": "ast",
- "body_hash": "8ced91ed9a81f2acf4c6047b5091d9d972531cda6c94dfeacd8f52032a37e479",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#registerName",
- "name": "registerName",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L297-L300",
- "signature": "function registerName(table: Map<string, string>, name: string, slug: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "19baf28fe22be9ee095b9158cc475114b372193f75407ad731aff306f455d432",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#resolveSlug",
- "name": "resolveSlug",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L302-L304",
- "signature": "function resolveSlug(table: Map<string, string>, name: string): string | undefined",
- "exported": false,
- "origin": "ast",
- "body_hash": "e3b335543a5eb9e316abcb762fcc43a8e66ef10b9217c3b5682958d58eccb40b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/build.ts#saveCache",
- "name": "saveCache",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L327-L331",
- "signature": "function saveCache(outDir: string, cache: BuildCache): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "858a9e1dd3769382de94bbf1c7dc76b4c137a777872fca251d2d214eb185a6e3",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/check.ts",
- "name": "check.ts",
- "kind": "file",
- "path": "src/context/check.ts",
- "span": "L1-L140",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "5595857a76ef937d5f8c67be47d85332998b3bd858ca5fd468f2b0e276f8155d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/check.ts#checkContext",
- "name": "checkContext",
- "kind": "function",
- "path": "src/context/check.ts",
- "span": "L37-L107",
- "signature": "function checkContext(dir: string, opts: CheckOptions = {}): CheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "06ef9cdf299314884c2c167ef2b07261c310fa4973c392ec8f951354e4657195",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/check.ts#CheckOptions",
- "name": "CheckOptions",
- "kind": "interface",
- "path": "src/context/check.ts",
- "span": "L32-L35",
- "signature": "interface CheckOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "9ea98ccd24c4398fa3c15b57991778a2c5f300000220e01c3e36e0b52093f097",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/check.ts#CheckResult",
- "name": "CheckResult",
- "kind": "interface",
- "path": "src/context/check.ts",
- "span": "L22-L30",
- "signature": "interface CheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "91144295d6967be1d7e9675698c39f552001f149346f052f92582dcb23353a6c",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/check.ts#formatCheckReport",
- "name": "formatCheckReport",
- "kind": "function",
- "path": "src/context/check.ts",
- "span": "L110-L135",
- "signature": "function formatCheckReport(r: CheckResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "5a0b108ea9b3b3f7853a483105ed6aeafefbc410cb5626e22b01b5681341cc47",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/check.ts#short",
- "name": "short",
- "kind": "function",
- "path": "src/context/check.ts",
- "span": "L137-L139",
- "signature": "function short(hash: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "174b5d08d0283571566816317520c72d2d9a1416f660ce45a854c34aa4cb45e6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts",
- "name": "node-file.ts",
- "kind": "file",
- "path": "src/context/node-file.ts",
- "span": "L1-L228",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "524f415c0b260d78762d5cbdb2ae53223e8868ed114120a0799f7b45f61e3cc3",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#contextDirFor",
- "name": "contextDirFor",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L98-L101",
- "signature": "function contextDirFor(root: string, override?: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "9c59cea86144d45410aab7aef516f7b846ca6d584d4149f9bae47590c7cebf2a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#ContextNode",
- "name": "ContextNode",
- "kind": "interface",
- "path": "src/context/node-file.ts",
- "span": "L43-L58",
- "signature": "interface ContextNode",
- "exported": true,
- "origin": "ast",
- "body_hash": "6cb97dab12942b8742efa5c785547222aa0350e75d994ccc99f0e1867f1e09d3",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#defaultHuman",
- "name": "defaultHuman",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L119-L121",
- "signature": "function defaultHuman(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "ea0f628a1792282addf319eaa6469945e4229bacdbba7ad9b44854bd5bfb5373",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#deleteNode",
- "name": "deleteNode",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L209-L212",
- "signature": "function deleteNode(dir: string, slug: string): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "49e161325092c3caf6c1b6d39d78b2d948445dd7609a72f9490e4898e9a973d3",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#digestSources",
- "name": "digestSources",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L89-L95",
- "signature": "function digestSources(sources: SourceRef[]): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "4c53e7543bc40ada4b0b0d853a6af071965175bef7b90980fa911149b2d691db",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#existingNodeSlugs",
- "name": "existingNodeSlugs",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L199-L206",
- "signature": "function existingNodeSlugs(dir: string): Set<string>",
- "exported": true,
- "origin": "ast",
- "body_hash": "016292a970458db3c1be037122b698285f60f46310d0b873f352c0ba393ce39b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#Manifest",
- "name": "Manifest",
- "kind": "interface",
- "path": "src/context/node-file.ts",
- "span": "L61-L71",
- "signature": "interface Manifest",
- "exported": true,
- "origin": "ast",
- "body_hash": "5caafb5633830210bfe7a9d72a8d202f01560f80e2195995013a437e5ab59202",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#NodeLink",
- "name": "NodeLink",
- "kind": "interface",
- "path": "src/context/node-file.ts",
- "span": "L36-L40",
- "signature": "interface NodeLink",
- "exported": true,
- "origin": "ast",
- "body_hash": "126d9b834cb0560714092dabc06b13ac71402695d797a7b770040112c180d9a5",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#ParsedNode",
- "name": "ParsedNode",
- "kind": "interface",
- "path": "src/context/node-file.ts",
- "span": "L170-L177",
- "signature": "interface ParsedNode",
- "exported": true,
- "origin": "ast",
- "body_hash": "1ffb557b4f3f224db4f31fd909bd40d4c25dfe521a4ce551e984167aa6365954",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#preserveHuman",
- "name": "preserveHuman",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L146-L150",
- "signature": "function preserveHuman(existingContent: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c36a99d53cd67a0c767859701d8efcf4e50c975709f8295b4a5579d9bda574aa",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#readManifest",
- "name": "readManifest",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L219-L227",
- "signature": "function readManifest(dir: string): Manifest | undefined",
- "exported": true,
- "origin": "ast",
- "body_hash": "0e0c22b3cdad566ef833ddc0a4cc2e7be2c262ce50ecc63fbc2c7431c83d2549",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#readNodes",
- "name": "readNodes",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L180-L196",
- "signature": "function readNodes(dir: string): ParsedNode[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "5c13b5768c1840b1ff8972d599356cf704329e6b7d89564809117c745d9edec2",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#renderGenerated",
- "name": "renderGenerated",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L104-L116",
- "signature": "function renderGenerated(node: ContextNode): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "2e1f760d1c196c9bcbef16789bdb3d3860fc7c406e1b5f5745e7cf4bbe1f40f0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#renderNodeFile",
- "name": "renderNodeFile",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L124-L139",
- "signature": "function renderNodeFile(node: ContextNode): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "f064173ff3e72f9f7f703694379edf165ba55d72949f4e6f097118e8e9d79a96",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#slugify",
- "name": "slugify",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L81-L86",
- "signature": "function slugify(name: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "70fca5f67f42bcb40f42175a26795d6a6ac72953f62ada7775a91d8300581fb0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#SourceRef",
- "name": "SourceRef",
- "kind": "interface",
- "path": "src/context/node-file.ts",
- "span": "L30-L33",
- "signature": "interface SourceRef",
- "exported": true,
- "origin": "ast",
- "body_hash": "2603554df891243f1f9c13ab6639a48627c787e5869c2bf692fdd481ae5050dd",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#writeManifest",
- "name": "writeManifest",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L214-L217",
- "signature": "function writeManifest(dir: string, manifest: Manifest): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "049e90311a97eda62d11bd8b35ed1debded19d6f06daa975c938287943e22d88",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/node-file.ts#writeNode",
- "name": "writeNode",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L156-L167",
- "signature": "function writeNode(dir: string, node: ContextNode): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "78ec07695ac8cf3949025497d7f56b47e5b8f0c16d6eb1dbe237c1ecc3e2fffe",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts",
- "name": "engine.ts",
- "kind": "file",
- "path": "src/engine.ts",
- "span": "L1-L116",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "01cac3e03491ecf32bb166c23028c5678f259b42b13b8b777cbdf1fd461c266e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#CheckRunOptions",
- "name": "CheckRunOptions",
- "kind": "interface",
- "path": "src/engine.ts",
- "span": "L32-L34",
- "signature": "interface CheckRunOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "705bea732f08c471e6566f8b6621038988554944b4bf9eca74674cdf518bf9b1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft",
- "name": "Graft",
- "kind": "class",
- "path": "src/engine.ts",
- "span": "L42-L115",
- "signature": "class Graft",
- "exported": true,
- "origin": "ast",
- "body_hash": "7d0133058249f4f9a7962d99a11ae6d87d1f96d20aa55444a68c8077c888eb80",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft.check",
- "name": "check",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L62-L64",
- "signature": "check(dir: string, opts: CheckRunOptions = {}): CheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "c0ef54370f24e88b0dfc83f2dd21d3db0a44c44538b3ec8bd54d38fac8be2c49",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft.checkGraph",
- "name": "checkGraph",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L67-L69",
- "signature": "checkGraph(dir: string): GraphCheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "eda4bef32536dd54b29cba56c59d4ea971625167a482e8fe15c5d799be81f870",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L45-L47",
- "signature": "constructor(config: EngineConfig = {})",
- "exported": true,
- "origin": "ast",
- "body_hash": "374d5de4021aadc3150f3cb521b536653584976599a4956fea4b26c40131c19f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft.cruxSummarizer",
- "name": "cruxSummarizer",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L101-L103",
- "signature": "private cruxSummarizer(): CruxSummarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "3b07279c83115a1232de5b510ce2f501f8699e7b8c70a052c4c455e136f01ca6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft.graph",
- "name": "graph",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L76-L82",
- "signature": "graph(dir: string, opts: GraphRunOptions = {}): Promise<GraphBuildResult>",
- "exported": true,
- "origin": "ast",
- "body_hash": "227e5765f18483fe86dcc7c78c3955f141d0630c869b5111f2283366c8162a06",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft.init",
- "name": "init",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L50-L59",
- "signature": "async init(dir: string, opts: InitOptions = {}): Promise<BuildResult>",
- "exported": true,
- "origin": "ast",
- "body_hash": "7ee2e73a5a5412667db890e91f0f2abfb15b94ea1331db17aef0f841c348fbf1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft.modelLabel",
- "name": "modelLabel",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L111-L114",
- "signature": "private modelLabel(): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "7034c4cd5e06b1b37f2ef068736f35fddaca136a3cae2ae5e595fda7efa2bd89",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft.requireKey",
- "name": "requireKey",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L85-L93",
- "signature": "private requireKey(): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "9aed1d64896a6e8f8d3cd6c00e53f8e8baf2b424e0522d28408861b2f7c22912",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft.summarizer",
- "name": "summarizer",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L105-L108",
- "signature": "private summarizer(): Summarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "160e884c1dd10b916c36a737886880d98430fb84c5dd7828e69536b8198e3b2f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft.synthesizer",
- "name": "synthesizer",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L95-L98",
- "signature": "private synthesizer(): Synthesizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "2a65f2a449bd40274d81542edfb36e20ceb8cf0160b030e8bd42b9698a386d20",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#GraphRunOptions",
- "name": "GraphRunOptions",
- "kind": "interface",
- "path": "src/engine.ts",
- "span": "L36-L40",
- "signature": "interface GraphRunOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "39ff67f6cc34aa0019b25dcee492776cfbb3872146ec3920492b97331fca894b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts#InitOptions",
- "name": "InitOptions",
- "kind": "interface",
- "path": "src/engine.ts",
- "span": "L25-L30",
- "signature": "interface InitOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "4a606cc2ac6df47d7b50de2a7ce33b2bd85e5dad93bea127871b9b952ddb0f8a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/build.ts",
- "name": "build.ts",
- "kind": "file",
- "path": "src/graph/build.ts",
- "span": "L1-L134",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "383d481fa00ab204c70b66c7ce88de1ffd3c5bba298116c1c4d8c6910834e944",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/build.ts#buildGraph",
- "name": "buildGraph",
- "kind": "function",
- "path": "src/graph/build.ts",
- "span": "L52-L131",
- "signature": "async function buildGraph( dir: string, opts: GraphBuildOptions = {}, ): Promise<GraphBuildResult>",
- "exported": true,
- "origin": "ast",
- "body_hash": "4fca5c6d97f526c471c9a7f9b1c2208cc69d3fa7ce975fcf1292d5d1e7445358",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/build.ts#GraphBuildOptions",
- "name": "GraphBuildOptions",
- "kind": "interface",
- "path": "src/graph/build.ts",
- "span": "L21-L32",
- "signature": "interface GraphBuildOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "71abfa189c81e3297978ab399e0918f9504d8fffe5730d8f604a6df9640bdd4f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/build.ts#GraphBuildResult",
- "name": "GraphBuildResult",
- "kind": "interface",
- "path": "src/graph/build.ts",
- "span": "L34-L45",
- "signature": "interface GraphBuildResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "df3ac66c481683aaf62d11854e5ce85ac2ab887fce2498fdf032045a22f111aa",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/build.ts#listSourceFiles",
- "name": "listSourceFiles",
- "kind": "function",
- "path": "src/graph/build.ts",
- "span": "L48-L50",
- "signature": "function listSourceFiles(root: string, outDir: string): string[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "09c58d7bb3b7c55ef5688af18f41e0d4eda5c4cb444a9ffb3290697794834ba0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/check.ts",
- "name": "check.ts",
- "kind": "file",
- "path": "src/graph/check.ts",
- "span": "L1-L136",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "f285574bc5853c04ad0fb1eb7103f558f890d9e0f143ff1e882cf1e42b38037f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/check.ts#checkGraph",
- "name": "checkGraph",
- "kind": "function",
- "path": "src/graph/check.ts",
- "span": "L43-L101",
- "signature": "function checkGraph(dir: string, opts: GraphCheckOptions = {}): GraphCheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "fbebbde003d3214caf412f74ed042636b2c0997e619bc7eb85b30badfcfdec65",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/check.ts#formatGraphCheckReport",
- "name": "formatGraphCheckReport",
- "kind": "function",
- "path": "src/graph/check.ts",
- "span": "L104-L135",
- "signature": "function formatGraphCheckReport(r: GraphCheckResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "c05fd7f5f3f5ed13a5816f2176d30910bb5d351b347d6dbe0fb3a4d3642ba7d6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/check.ts#GraphCheckOptions",
- "name": "GraphCheckOptions",
- "kind": "interface",
- "path": "src/graph/check.ts",
- "span": "L39-L41",
- "signature": "interface GraphCheckOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "deb14aad6be2a49d6d6d059a64a4eb55a7041a039cbabf92c55222647c2b0679",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/check.ts#GraphCheckResult",
- "name": "GraphCheckResult",
- "kind": "interface",
- "path": "src/graph/check.ts",
- "span": "L27-L37",
- "signature": "interface GraphCheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "8b12129196b2a1b6d3c7a45a086708e123527cbc0417ce5db07a710a853719c0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts",
- "name": "enrich.ts",
- "kind": "file",
- "path": "src/graph/enrich.ts",
- "span": "L1-L187",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "7b8238702835246bfc446ae017157e627c7609fde83b090619de71d013edf8e6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts#buildCrux",
- "name": "buildCrux",
- "kind": "function",
- "path": "src/graph/enrich.ts",
- "span": "L162-L177",
- "signature": "function buildCrux(r: NodeCrux, node: NodeV1, source: string, lineCount: number): Crux | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "b8e82b1a1f721cdba2a3ff1a6d46db8b30a0048178d7c7e7df0731e60c059a81",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts#collectFileCrux",
- "name": "collectFileCrux",
- "kind": "function",
- "path": "src/graph/enrich.ts",
- "span": "L135-L155",
- "signature": "async function collectFileCrux( summarizer: CruxSummarizer, path: string, source: string, refs: NodeRef[], ): Promise<{ results: Map<string, NodeCrux>; error?: string }>",
- "exported": false,
- "origin": "ast",
- "body_hash": "e549b76d14ae5d596c084dd5f655bded2092a36e3505ff6135c054ccf043efda",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts#enrichGraph",
- "name": "enrichGraph",
- "kind": "function",
- "path": "src/graph/enrich.ts",
- "span": "L43-L128",
- "signature": "async function enrichGraph( nodes: NodeV1[], prior: Map<string, NodeV1>, sources: Map<string, string>, opts: EnrichOptions = {}, ): Promise<EnrichStats>",
- "exported": true,
- "origin": "ast",
- "body_hash": "67bf09b50cd3f75e72e7c8ce7b7f20847e380dcc731531d00d17e8866945336b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts#EnrichOptions",
- "name": "EnrichOptions",
- "kind": "interface",
- "path": "src/graph/enrich.ts",
- "span": "L28-L33",
- "signature": "interface EnrichOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "5b1a8379d9c8f934883d81912390338ba9917af35f05b8eb378f405e114adddb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts#EnrichStats",
- "name": "EnrichStats",
- "kind": "interface",
- "path": "src/graph/enrich.ts",
- "span": "L35-L41",
- "signature": "interface EnrichStats",
- "exported": true,
- "origin": "ast",
- "body_hash": "63a93dfdf61c8da0d3a05c601b74619ad84942d37425b4391b8da2b01d2d694c",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts#spanLines",
- "name": "spanLines",
- "kind": "function",
- "path": "src/graph/enrich.ts",
- "span": "L180-L186",
- "signature": "function spanLines(span: string, fileLines: number): [number, number]",
- "exported": false,
- "origin": "ast",
- "body_hash": "d7f074949c35eaa3f883194e41cda61c34a624a66ec368ef352dc7f0b2e7e256",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts",
- "name": "extract.ts",
- "kind": "file",
- "path": "src/graph/extract.ts",
- "span": "L1-L298",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "58cd002d5ee7dfb750cb85293a795148ffbec31e68e2a9b693e0794543a7f727",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#calleeName",
- "name": "calleeName",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L244-L260",
- "signature": "function calleeName( node: Parser.SyntaxNode, lang: Language, ): { name: string; viaMember: boolean } | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "06353b6cf0a05cf60bad712082837f52c169e6db9209488f1ee04ea22bef8082",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#clean",
- "name": "clean",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L280-L287",
- "signature": "function clean(raw: string): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "38343faa35f42e41e98c93d6816454cfe294123505d2bae14f045624cf6d80e1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#DefDescriptor",
- "name": "DefDescriptor",
- "kind": "interface",
- "path": "src/graph/extract.ts",
- "span": "L87-L92",
- "signature": "interface DefDescriptor",
- "exported": false,
- "origin": "ast",
- "body_hash": "414875473c4cf1728483558f5354b6f37c279d2bc49393b3b93322a9573a7f00",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#describe",
- "name": "describe",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L184-L213",
- "signature": "function describe(node: Parser.SyntaxNode, ctx: WalkCtx): DefDescriptor | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "9a6919ff2bed807cf790adcea3b0d423db94baa10fc2069514e0c20c1b5f7117",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#extractFile",
- "name": "extractFile",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L94-L127",
- "signature": "function extractFile(rel: string, source: string, lang: Language): ExtractResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "464dc6d27977ade3cd0a52213f5cc1b963e4dfafc328cc1e059925bac9c9436d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#ExtractResult",
- "name": "ExtractResult",
- "kind": "interface",
- "path": "src/graph/extract.ts",
- "span": "L41-L44",
- "signature": "interface ExtractResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "7bef2217a3edd0ae64ae3585affe29e5bc0e0f471ca1d7901910fa737e4d01af",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#heritageEdges",
- "name": "heritageEdges",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L215-L242",
- "signature": "function heritageEdges(node: Parser.SyntaxNode, classId: string, ctx: WalkCtx): RawEdge[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "a73044fd4c3636db388dcd17dc5cebfa2090322501f2674989e892f89f2e1b03",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#importSpecifier",
- "name": "importSpecifier",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L266-L277",
- "signature": "function importSpecifier(node: Parser.SyntaxNode, lang: Language): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "edf2e115d4815ca2b2c480f6ab6ec254114fdb5fa329439fb1092449c6222ff5",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#isImport",
- "name": "isImport",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L262-L264",
- "signature": "function isImport(node: Parser.SyntaxNode): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "70722311d982f2fa892674266eddfe75b20ad22c62a323448a86a29044a6b7f6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#Language",
- "name": "Language",
- "kind": "type",
- "path": "src/graph/extract.ts",
- "span": "L16-L16",
- "signature": "type Language = \"typescript\" | \"tsx\" | \"python\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "5a7c4ffe69a0058e67f6150fd6d7a941265322ef73669c6fae36bdd9a92af5c6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#languageOf",
- "name": "languageOf",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L19-L25",
- "signature": "function languageOf(path: string): Language | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "d68b32ad7c9702e80d148c718d03ef4d64d44805d4294c2503426ea9143e9e1d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#RawEdge",
- "name": "RawEdge",
- "kind": "interface",
- "path": "src/graph/extract.ts",
- "span": "L31-L39",
- "signature": "interface RawEdge",
- "exported": true,
- "origin": "ast",
- "body_hash": "707c4b43d565711035439d2541197427ac0d4da52241d33cf63dd3fb3ac98754",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#tsExported",
- "name": "tsExported",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L290-L297",
- "signature": "function tsExported(node: Parser.SyntaxNode): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "dd6c141ae925e333baeebc3f3d19c3043670c76a4f32b711e8166ac6eb86f2f4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#walk",
- "name": "walk",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L129-L181",
- "signature": "function walk(node: Parser.SyntaxNode, ctx: WalkCtx, out: NodeV1[], edges: RawEdge[]): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "7cd315e50d1665cc130f049e5b655ac09f3e87f406fd7eba2b3fd6a4aca1c749",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#WalkCtx",
- "name": "WalkCtx",
- "kind": "interface",
- "path": "src/graph/extract.ts",
- "span": "L76-L84",
- "signature": "interface WalkCtx",
- "exported": false,
- "origin": "ast",
- "body_hash": "b2e93ec2af59e0078d500a068b620a426b6a588804ba62faba20d7f47f90bb3e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/resolve.ts",
- "name": "resolve.ts",
- "kind": "file",
- "path": "src/graph/resolve.ts",
- "span": "L1-L101",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "dad41f73d773c45f5237b85e10a36ae45331cd5959df578816ee8ab47622cffe",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/resolve.ts#push",
- "name": "push",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L60-L64",
- "signature": "function push<T>(map: Map<string, T[]>, key: string, val: T): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "0f349e9ed1ee9ef1c7695b65c3f3948140eb20a60f36ba9d915a79e92eed7391",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/resolve.ts#resolveEdges",
- "name": "resolveEdges",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L20-L58",
- "signature": "function resolveEdges(nodes: NodeV1[], rawEdges: RawEdge[]): EdgeV1[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "ace9e1eb0f3e9bc400f1341e0c23209b13d3c4f2b004e55a2397ebf4902cb41e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/resolve.ts#resolveEdges.add",
- "name": "add",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L34-L39",
- "signature": "add = (source: string, target: string, relation: Relation, confidence: EdgeV1[\"confidence\"])",
- "exported": true,
- "origin": "ast",
- "body_hash": "7f8c2ba06670d38fd33b508c463d4c8e08ae614f7559b3571c8b7db1d51fd380",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/resolve.ts#resolveImport",
- "name": "resolveImport",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L88-L100",
- "signature": "function resolveImport(spec: string, file: string, byId: Map<string, NodeV1>): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "5dcee73ae49d61baf6cba0f1430bcc799975d19b6d72ac0a6da911e14fafa955",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/resolve.ts#resolveName",
- "name": "resolveName",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L70-L82",
- "signature": "function resolveName( name: string, file: string, kinds: Kind[], perFileName: Map<string, Map<string, NodeV1[]>>, globalName: Map<string, NodeV1[]>, ): { id: string; confidence: EdgeV1[\"confidence\"] } | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "612a086f93eb383b759795d9e5b93d6f429bd4a17c22c9b3e65fcf7d79e0e6f0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/types.ts",
- "name": "types.ts",
- "kind": "file",
- "path": "src/graph/types.ts",
- "span": "L1-L82",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "757b84c059d13cda49e0f29518b31a5473f0d6e243b2ab1f374a7f7ff02492e4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/types.ts#Confidence",
- "name": "Confidence",
- "kind": "type",
- "path": "src/graph/types.ts",
- "span": "L25-L25",
- "signature": "type Confidence = \"extracted\" | \"inferred\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "305d107dc8cea0d8fcf2e42c13eef23345a53cd6a24672d8a017d5c8d393d46c",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/types.ts#Crux",
- "name": "Crux",
- "kind": "interface",
- "path": "src/graph/types.ts",
- "span": "L32-L35",
- "signature": "interface Crux",
- "exported": true,
- "origin": "ast",
- "body_hash": "157f97611f592b25b78af3bd626d10c866b4aa23344a96823de466eb1ecbe28d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/types.ts#EdgeV1",
- "name": "EdgeV1",
- "kind": "interface",
- "path": "src/graph/types.ts",
- "span": "L65-L70",
- "signature": "interface EdgeV1",
- "exported": true,
- "origin": "ast",
- "body_hash": "ab2ffb1ba27a286985e517d71d7866d2d389e585d1584647a90fb520b4d92628",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/types.ts#GraphV1",
- "name": "GraphV1",
- "kind": "interface",
- "path": "src/graph/types.ts",
- "span": "L72-L81",
- "signature": "interface GraphV1",
- "exported": true,
- "origin": "ast",
- "body_hash": "fa588451b38bfa2c1ea17eeabb5cd4d18769ecbf75ba79fb160d59d2d2666e8e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/types.ts#Kind",
- "name": "Kind",
- "kind": "type",
- "path": "src/graph/types.ts",
- "span": "L15-L22",
- "signature": "type Kind = | \"file\" | \"class\" | \"function\" | \"method\" | \"interface\" // TS only | \"type\" // TS only (type alias) | \"enum\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "b233aa721b3c652dd7f3b4de6e3410e0f44a1da079cbb90df6d8e05eb4cc49f0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/types.ts#NodeV1",
- "name": "NodeV1",
- "kind": "interface",
- "path": "src/graph/types.ts",
- "span": "L37-L55",
- "signature": "interface NodeV1",
- "exported": true,
- "origin": "ast",
- "body_hash": "beaac037e2ce6292f6f5883e10c6a1df41963629d9090bbde0d88ef5b6fd8309",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/types.ts#Relation",
- "name": "Relation",
- "kind": "type",
- "path": "src/graph/types.ts",
- "span": "L57-L63",
- "signature": "type Relation = | \"contains\" // file → symbol, class → method (structural) | \"calls\" // function → function it invokes | \"imports\" // file → module | \"references\" // symbol → symbol it names but doesn't call | \"implements\" // TS: class → interface | \"extends\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "226fd93c673f4bfa583e44e3be8c2ca8e0957bf1b95771f067e4999b1e89d145",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/types.ts#SummaryState",
- "name": "SummaryState",
- "kind": "type",
- "path": "src/graph/types.ts",
- "span": "L28-L28",
- "signature": "type SummaryState = \"pending\" | \"ready\" | \"stale\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "0689b3a76aa3ee3553bec1bccff2817cac613e747d317688f296748e8c929e0e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/write.ts",
- "name": "write.ts",
- "kind": "file",
- "path": "src/graph/write.ts",
- "span": "L1-L45",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "2f2e06e41f959064181f32cf9ebdd72af31a9d45c6cf5cd771e00990c53073fb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/write.ts#edgeOrder",
- "name": "edgeOrder",
- "kind": "function",
- "path": "src/graph/write.ts",
- "span": "L38-L44",
- "signature": "function edgeOrder(a: EdgeV1, b: EdgeV1): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "1c2665c44f094c37f510a0ca5befc63bf67ae59c52d77dfdcbe15611d2e5abbe",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/write.ts#readGraph",
- "name": "readGraph",
- "kind": "function",
- "path": "src/graph/write.ts",
- "span": "L18-L24",
- "signature": "function readGraph(path: string): GraphV1 | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "a68ca7cd48652a99a350b76c387a19462cc984c42bbc9b00a30e629af5fda52e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/write.ts#writeGraph",
- "name": "writeGraph",
- "kind": "function",
- "path": "src/graph/write.ts",
- "span": "L26-L36",
- "signature": "function writeGraph(graph: GraphV1, outDir: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "6eeda3c5d193b1d0559e8d16367d54cc9f8a4bb9cf9b78489bc9a3df3f2b02a3",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/index.ts",
- "name": "index.ts",
- "kind": "file",
- "path": "src/index.ts",
- "span": "L1-L37",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e56e74612514fd45665b27e3c47b4a685b503a533b38e1674d256344511107fc",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ingest/fs.ts",
- "name": "fs.ts",
- "kind": "file",
- "path": "src/ingest/fs.ts",
- "span": "L1-L46",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a8339532da34b44d35eb9ad16e7106adb1262d73d9895b1bd94574337fb2019f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ingest/fs.ts#walkDir",
- "name": "walkDir",
- "kind": "function",
- "path": "src/ingest/fs.ts",
- "span": "L27-L45",
- "signature": "function walkDir(dir: string): string[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "001f6c9f648af0620ed90c55a132464ab87da3ad74b6711df716e9f9493333c4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/util/id.ts",
- "name": "id.ts",
- "kind": "file",
- "path": "src/util/id.ts",
- "span": "L1-L17",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "5fabc8ddcc3abc907ce69f04ad2ebe51933262cf44aa2dfd40589f71f1926e8a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/util/id.ts#contentHash",
- "name": "contentHash",
- "kind": "function",
- "path": "src/util/id.ts",
- "span": "L9-L11",
- "signature": "function contentHash(input: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "d83ce720108cb9ea3b0c7b1e7034657603640647ca00283905fcd099ac3fe2ed",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/util/id.ts#newId",
- "name": "newId",
- "kind": "function",
- "path": "src/util/id.ts",
- "span": "L4-L6",
- "signature": "function newId(prefix: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "55062dee898e1edb76d65f7daf785b67e998a57a7dfd6f78c7eb17f39e3e1dc0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/util/id.ts#normalizeName",
- "name": "normalizeName",
- "kind": "function",
- "path": "src/util/id.ts",
- "span": "L14-L16",
- "signature": "function normalizeName(name: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "bac0e298462067a441b2b76566ed29c3787280585b956f84b81d7a766cd7211a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/assemble.ts",
- "name": "assemble.ts",
- "kind": "file",
- "path": "src/viz/assemble.ts",
- "span": "L1-L131",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "58ad5caed087bd7b929f5b625501a607e79e0476f998636bec241e0296706ece",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/assemble.ts#assembleContextGraph",
- "name": "assembleContextGraph",
- "kind": "function",
- "path": "src/viz/assemble.ts",
- "span": "L79-L130",
- "signature": "function assembleContextGraph(contextDir: string): VizGraph",
- "exported": true,
- "origin": "ast",
- "body_hash": "8529626bef8abf2e1a326d601cf5a6a4972e0a1b801d6b653ba8227a27b9dbbd",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/assemble.ts#extractSummary",
- "name": "extractSummary",
- "kind": "function",
- "path": "src/viz/assemble.ts",
- "span": "L65-L76",
- "signature": "function extractSummary(body: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "1857e477bdb012672fa843cfca8d43eb543e7cfba2cc496692a65ebe8c0fa6c5",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/assemble.ts#normalizeRelation",
- "name": "normalizeRelation",
- "kind": "function",
- "path": "src/viz/assemble.ts",
- "span": "L56-L58",
- "signature": "function normalizeRelation(rel: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "adfaae55d1d21718adbedaa294194517aa7abdddeb95433642fd358137e48909",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/assemble.ts#VizEdge",
- "name": "VizEdge",
- "kind": "interface",
- "path": "src/viz/assemble.ts",
- "span": "L26-L31",
- "signature": "interface VizEdge",
- "exported": true,
- "origin": "ast",
- "body_hash": "bef3aefe267d463b0d4cf617f379adadd4fffb539e9a0a5e240520be60a191cb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/assemble.ts#VizGraph",
- "name": "VizGraph",
- "kind": "interface",
- "path": "src/viz/assemble.ts",
- "span": "L33-L42",
- "signature": "interface VizGraph",
- "exported": true,
- "origin": "ast",
- "body_hash": "7edd9c49c11acc8e90963256a92ee2f27415c50446334924e2e260b715b56427",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/assemble.ts#VizNode",
- "name": "VizNode",
- "kind": "interface",
- "path": "src/viz/assemble.ts",
- "span": "L18-L24",
- "signature": "interface VizNode",
- "exported": true,
- "origin": "ast",
- "body_hash": "ec19a79898c594e5afc405cab037fcc0c43144c5766af8a955dccda7df733ba6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/serve.ts",
- "name": "serve.ts",
- "kind": "file",
- "path": "src/viz/serve.ts",
- "span": "L1-L149",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "d53b1bd24bff545ea46ed1efbae635a77e4eae43ee4635862c8a7f5564fa94b4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/serve.ts#listen",
- "name": "listen",
- "kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L43-L55",
- "signature": "function listen(server: Server, port: number): Promise<boolean>",
- "exported": false,
- "origin": "ast",
- "body_hash": "b43a357dceb98a6eb6676409503021e6e38f13d7d442d44ba819dda0c0ea6246",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/serve.ts#listen.onError",
- "name": "onError",
- "kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L45-L48",
- "signature": "onError = (err: NodeJS.ErrnoException)",
- "exported": false,
- "origin": "ast",
- "body_hash": "6643919e3ea413fc58afe100fe65dc3beccadb7aa66bf5d3247e072c83d9d000",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/serve.ts#sendJson",
- "name": "sendJson",
- "kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L38-L41",
- "signature": "function sendJson(res: ServerResponse, status: number, body: unknown): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "a2b33c898c929db2715116f964722f5e438e61a58fdfa4607d21c4365df5da6a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/serve.ts#startVizServer",
- "name": "startVizServer",
- "kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L57-L148",
- "signature": "async function startVizServer(opts: VizServerOptions): Promise<VizServer>",
- "exported": true,
- "origin": "ast",
- "body_hash": "b370cb84eccafaf296dec3f910462dc4e3e171b013cc0c7733ada64684730279",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/serve.ts#startVizServer.close",
- "name": "close",
- "kind": "method",
- "path": "src/viz/serve.ts",
- "span": "L140-L146",
- "signature": "close(): Promise<void>",
- "exported": true,
- "origin": "ast",
- "body_hash": "69dc0089d8f1d6e843c8add8fabf2e120fd1045505f9c15632ba93bdc58c01d4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/serve.ts#VizServer",
- "name": "VizServer",
- "kind": "interface",
- "path": "src/viz/serve.ts",
- "span": "L23-L26",
- "signature": "interface VizServer",
- "exported": true,
- "origin": "ast",
- "body_hash": "9c56587daccba8982a5f5da3a0ea5f185becea8c4f4927331b15117f5d456214",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/viz/serve.ts#VizServerOptions",
- "name": "VizServerOptions",
- "kind": "interface",
- "path": "src/viz/serve.ts",
- "span": "L16-L21",
- "signature": "interface VizServerOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "0b439484269a73c19df0d658113fbdc889c2214d1081e08d92bc86ae99e0c795",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/context.test.ts",
- "name": "context.test.ts",
- "kind": "file",
- "path": "test/context.test.ts",
- "span": "L1-L137",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "977ca7f64b4b9e3f5661be18ea3710399b976cb989aa5d17af3c6ee4692aed33",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/context.test.ts#buildOpts",
- "name": "buildOpts",
- "kind": "function",
- "path": "test/context.test.ts",
- "span": "L27-L29",
- "signature": "function buildOpts()",
- "exported": false,
- "origin": "ast",
- "body_hash": "20ec093d8fa9dadc46af8980d9440b6824597f4cdeb74529d4d62ee38d27e52d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/context.test.ts#makeFixture",
- "name": "makeFixture",
- "kind": "function",
- "path": "test/context.test.ts",
- "span": "L14-L25",
- "signature": "function makeFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "515198ac732683d4da4b920e53a0eb439ea8e0107afb22af65cc29c0e702192c",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/helpers.ts",
- "name": "helpers.ts",
- "kind": "file",
- "path": "test/helpers.ts",
- "span": "L1-L55",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e45af1d38d7c6d4abc804fc74e9ae4c3373cf78769c17b16b185c3ee0e2c3228",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/helpers.ts#BracketSynthesizer",
- "name": "BracketSynthesizer",
- "kind": "class",
- "path": "test/helpers.ts",
- "span": "L21-L50",
- "signature": "class BracketSynthesizer implements Synthesizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "6a30b1293990bb2dce95f1f1f77219dbcdc54eef7e6a01d0db03403f4d344bcc",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/helpers.ts#BracketSynthesizer.synthesize",
- "name": "synthesize",
- "kind": "method",
- "path": "test/helpers.ts",
- "span": "L22-L49",
- "signature": "async synthesize(files: FileSummary[]): Promise<SynthNode[]>",
- "exported": true,
- "origin": "ast",
- "body_hash": "b42a19064389576a02ba334fcab8bfb5d8d985a46f995be864095e770d47e26d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/helpers.ts#BracketSynthesizer.synthesize.ensure",
- "name": "ensure",
- "kind": "function",
- "path": "test/helpers.ts",
- "span": "L24-L31",
- "signature": "ensure = (name: string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "3b8cc65a6170766e70a5b038f9f27176e60114ce70e0e2dc1463f720ed384c4c",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/helpers.ts#fakeProviders",
- "name": "fakeProviders",
- "kind": "function",
- "path": "test/helpers.ts",
- "span": "L52-L54",
- "signature": "function fakeProviders()",
- "exported": true,
- "origin": "ast",
- "body_hash": "0395bc21ba030a5d0e1fc9e5fdd0d8780c4309c87d899bedbc940f1bdcd2864f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/helpers.ts#PassthroughSummarizer",
- "name": "PassthroughSummarizer",
- "kind": "class",
- "path": "test/helpers.ts",
- "span": "L9-L13",
- "signature": "class PassthroughSummarizer implements Summarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "43c71f9e449859d657d6cef17b80d2bb650734751530e8401c356fc963f7b012",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/helpers.ts#PassthroughSummarizer.summarize",
- "name": "summarize",
- "kind": "method",
- "path": "test/helpers.ts",
- "span": "L10-L12",
- "signature": "async summarize(code: string): Promise<string>",
- "exported": true,
- "origin": "ast",
- "body_hash": "8836e78c4875dee01aeae5cb976c217cd347554542e387996b7c190b1a73af18",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/viz-assemble.test.ts",
- "name": "viz-assemble.test.ts",
- "kind": "file",
- "path": "test/viz-assemble.test.ts",
- "span": "L1-L106",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "89a2a9f11f459a8110f9d89b2de780dfd164504f3b4c7dc61953a6c83c5911cb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/viz-assemble.test.ts#makeContextDir",
- "name": "makeContextDir",
- "kind": "function",
- "path": "test/viz-assemble.test.ts",
- "span": "L12-L60",
- "signature": "function makeContextDir(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "4fab7dd2dc5bc7c0b9d575f8396bdca67e8d2d5a9f337aa14ef7740dd87b2119",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/viz-serve.test.ts",
- "name": "viz-serve.test.ts",
- "kind": "file",
- "path": "test/viz-serve.test.ts",
- "span": "L1-L100",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "ca8c82a0e53b4d08706744fb2693669682f64552bcfa910e32b5f9b547699cbb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/viz-serve.test.ts#makeDirs",
- "name": "makeDirs",
- "kind": "function",
- "path": "test/viz-serve.test.ts",
- "span": "L13-L27",
- "signature": "function makeDirs(): { contextDir: string; viewerDir: string; root: string }",
- "exported": false,
- "origin": "ast",
- "body_hash": "cff2ec95e868528eec2623a2907ab4c4e3e4a55224d0551b1fb8a63e8bbc124d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts",
- "name": "data.ts",
- "kind": "file",
- "path": "viewer/data.ts",
- "span": "L1-L122",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e9c5c89ad933e06004cbeddc1b1d7b60a6057726a463c66f9673ba20a3c61afd",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#chipKey",
- "name": "chipKey",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L47-L51",
- "signature": "function chipKey(rel: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "85dd128b9f3bf028efaeac2428474b0d70ac47e8e94bcba80c111d59a6006df9",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#CodeGraphV1",
- "name": "CodeGraphV1",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L86-L93",
- "signature": "interface CodeGraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "e494a9a322973f3bc8af2017764ac546a8e9cb7b03cae5aeb730f48ad2521d90",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#colorToken",
- "name": "colorToken",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L72-L75",
- "signature": "function colorToken(tab: \"context\" | \"code\", type: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "dc48f14294140f474d97fdedf0bdbbbe487d5f0bcdeda6ae84f87251ab24b007",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#cvar",
- "name": "cvar",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L77-L79",
- "signature": "function cvar(name: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "89e6f3b44e0dd358542573894691c925266e88da9160b79be00d043ae17245e8",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#Family",
- "name": "Family",
- "kind": "type",
- "path": "viewer/data.ts",
- "span": "L29-L29",
- "signature": "type Family = \"structure\" | \"dependency\" | \"contract\" | \"association\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "324db0cd1c7f2eebbda194734b2a8db880eb835949f0325780ea5ae75308ef05",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#famOf",
- "name": "famOf",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L39-L41",
- "signature": "function famOf(rel: string): Family",
- "exported": true,
- "origin": "ast",
- "body_hash": "faed31084ad49496d754f589593081a76a4cd98e714ff10a10c07d5cd476738d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#loadCodeGraph",
- "name": "loadCodeGraph",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L96-L113",
- "signature": "async function loadCodeGraph(): Promise<VizGraph | null>",
- "exported": true,
- "origin": "ast",
- "body_hash": "343a1a01362fa33345082eb6cd5a04cfc1b7a1411de7bc23422c5ac5ebb1fae1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#loadContextGraph",
- "name": "loadContextGraph",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L81-L84",
- "signature": "async function loadContextGraph(): Promise<VizGraph>",
- "exported": true,
- "origin": "ast",
- "body_hash": "c65d9227bea8ceceffd49b4eb8475677aef8ca8820b966d9228a31875a6589e1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#onServerChange",
- "name": "onServerChange",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L116-L121",
- "signature": "function onServerChange(handler: () => void): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "d864a1d7995232ad54351830e5963a2c6fc8c64cc5a941cf9cfea74d688514c9",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#VizEdge",
- "name": "VizEdge",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L14-L20",
- "signature": "interface VizEdge",
- "exported": true,
- "origin": "ast",
- "body_hash": "13baa6c9acc4c78eec36835e02fd49df79e869f836880341a959be134ceaabb1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#VizGraph",
- "name": "VizGraph",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L22-L26",
- "signature": "interface VizGraph",
- "exported": true,
- "origin": "ast",
- "body_hash": "6448a4bb9c71c7932dce92d9d8a452f99a0a100041bd30c5b6759c5784b0f098",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts#VizNode",
- "name": "VizNode",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L6-L12",
- "signature": "interface VizNode",
- "exported": true,
- "origin": "ast",
- "body_hash": "ec19a79898c594e5afc405cab037fcc0c43144c5766af8a955dccda7df733ba6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/detail.ts",
- "name": "detail.ts",
- "kind": "file",
- "path": "viewer/detail.ts",
- "span": "L1-L59",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "fe8df7c5561f2a8588cf4e1ecb367d19cb6b480fe4855f05e4f96137d8078884",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/detail.ts#esc",
- "name": "esc",
- "kind": "function",
- "path": "viewer/detail.ts",
- "span": "L8-L10",
- "signature": "function esc(s: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "9fb927f7f1c881ee1fe325c0dc8a25b8c5cdb2c101b08ae935a35bb428f5bbdb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/detail.ts#renderDetail",
- "name": "renderDetail",
- "kind": "function",
- "path": "viewer/detail.ts",
- "span": "L12-L58",
- "signature": "function renderDetail( host: HTMLElement, graph: VizGraph | null, tab: \"context\" | \"code\", id: string | null, onNavigate: (id: string) => void, ): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "bbd0db0a7f39cbfbd9b0ca31f88118c9a2cd037d394ad47bff7203a6f399f5ca",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/detail.ts#renderDetail.linkList",
- "name": "linkList",
- "kind": "function",
- "path": "viewer/detail.ts",
- "span": "L40-L50",
- "signature": "linkList = (edges: typeof out, dotColor: string, title: string, other: (e: (typeof out)[number]) => string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "f103fe554602f3315706280d7eba1016c647c77fa6af27e9a4ec0442d6cf1d89",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/detail.ts#renderDetail.name",
- "name": "name",
- "kind": "function",
- "path": "viewer/detail.ts",
- "span": "L29-L29",
- "signature": "name = (nid: string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "617c48812e0f0520b45da770cf91aeea5330b7e690c6d93defd4da77edf11b8a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts",
- "name": "graph.ts",
- "kind": "file",
- "path": "viewer/graph.ts",
- "span": "L1-L335",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "62d2cf91f93364d125d211b05e7bd3aadd738e016c1b13cfc7908068f41cc288",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#el",
- "name": "el",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L42-L46",
- "signature": "function el<K extends keyof SVGElementTagNameMap>(tag: K, attrs: Record<string, string | number>): SVGElementTagNameMap[K]",
- "exported": false,
- "origin": "ast",
- "body_hash": "de7f696c06af5d771e8e661f398d9d275ca2cc06d86f4e91458d671480e346b7",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView",
- "name": "GraphView",
- "kind": "class",
- "path": "viewer/graph.ts",
- "span": "L48-L334",
- "signature": "class GraphView",
- "exported": true,
- "origin": "ast",
- "body_hash": "c56e429cf5ca1f4c12130fedc996a0b69e7c1a506d7a306246fbb44c9fdacc1e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.applyView",
- "name": "applyView",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L268-L270",
- "signature": "private applyView(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "2adb54996d6ef9272cd69144b4b6c4bb92236506a3f5bf2d589faffd5218554b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.bindDrag",
- "name": "bindDrag",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L290-L309",
- "signature": "private bindDrag(group: SVGGElement, node: SimNode): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "00e851d11e1029516256411b627b60e78d781cdc62ada046a0eb93c55c2dd009",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.bindDrag.move",
- "name": "move",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L294-L299",
- "signature": "move = (mv: PointerEvent)",
- "exported": true,
- "origin": "ast",
- "body_hash": "656f371efff6a0eed7868895a4044e4fdf1dc88840de21376c388ba03149fbd0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.bindDrag.up",
- "name": "up",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L300-L305",
- "signature": "up = ()",
- "exported": true,
- "origin": "ast",
- "body_hash": "a935b15e42eefdf45da528afe3172b559d3e9ee97fe4be67f682dedccaac64c2",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.bindPanZoom",
- "name": "bindPanZoom",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L311-L333",
- "signature": "private bindPanZoom(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "737e5f69bc32913d3b061a4a878b61245d242e217f451a81d72d21e1d28fae30",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.buildChrome",
- "name": "buildChrome",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L71-L78",
- "signature": "private buildChrome(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "592cef68d76f99ad8da470cc3c8b4eda64701c02b8740a21e659fdd5e5325def",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.buildElements",
- "name": "buildElements",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L138-L164",
- "signature": "private buildElements(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "a608a77fab16447bd9ef9c465a192abc0cb7167807f7c1718d961d730d7f055d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L65-L69",
- "signature": "constructor(svg: SVGSVGElement)",
- "exported": true,
- "origin": "ast",
- "body_hash": "27abb788d7de0ece37719a0a23d4fed7778c02dda10700bbfb4f110ea8c16984",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.ensureMarkers",
- "name": "ensureMarkers",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L80-L91",
- "signature": "private ensureMarkers(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "9517cfdb2ccb4ce235405356f6ff9b2fb3fcd2f7d687689bde33cf5df9bd6906",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.firstMatch",
- "name": "firstMatch",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L263-L266",
- "signature": "firstMatch(): SimNode | undefined",
- "exported": true,
- "origin": "ast",
- "body_hash": "d43343323ad49732d473f46773ac41a0ee7472f6289d324eb369d739e8cb0352",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.focus",
- "name": "focus",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L252-L261",
- "signature": "focus(id: string): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "a64691876d1786ccdb2027028d00210b8cb56557c65c1afa81a886b506d7b459",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.reheat",
- "name": "reheat",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L286-L288",
- "signature": "reheat(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "ca57d7cb11e71985bcd27b937b4f6d0a62428a0ae84f5a297cb1147861032a59",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.resetView",
- "name": "resetView",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L281-L284",
- "signature": "resetView(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "ae1f1ee82c804ff145b1f4aa9de70cad49a5287735aa9825f6accbe21591794c",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.restyle",
- "name": "restyle",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L185-L243",
- "signature": "restyle(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "0835be5e8636d251dd3a4cd41495603490a7fb09ef71d17d9c3ff9711c9824f9",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.restyle.nodeShown",
- "name": "nodeShown",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L195-L195",
- "signature": "nodeShown = (n: SimNode)",
- "exported": true,
- "origin": "ast",
- "body_hash": "a598aac16da1955aecc62f39590f30d0c7e780d99429b1657c1bbba7d157ddea",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.select",
- "name": "select",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L245-L249",
- "signature": "select(id: string | null): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "7ba52874ad2ddda2bc80c3442e011c9d2b464fb8851a3ba527d3dba8ac6061c2",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.setData",
- "name": "setData",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L94-L136",
- "signature": "setData(graph: VizGraph, tab: \"context\" | \"code\"): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "d8063d2226148959298ca10074e09f00b7530c0b6a87f023502c4bd1c02041a6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.tick",
- "name": "tick",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L166-L182",
- "signature": "private tick(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "0fbefdd43e29e9d5134e756074fe1fa190fa23cf6afaa72a52d27f098ac8e6bb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.zoomBy",
- "name": "zoomBy",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L272-L279",
- "signature": "zoomBy(factor: number): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "2dd28ba55cc461ab1f950d582e10b63c6862804f17d518ef346fe4e3f49af289",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#SimEdge",
- "name": "SimEdge",
- "kind": "interface",
- "path": "viewer/graph.ts",
- "span": "L32-L38",
- "signature": "interface SimEdge",
- "exported": false,
- "origin": "ast",
- "body_hash": "06690141adf5c47ffc6dd6b55a3cf9f041a4750f0b512cf49d3596928485fca8",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/graph.ts#SimNode",
- "name": "SimNode",
- "kind": "interface",
- "path": "viewer/graph.ts",
- "span": "L22-L30",
- "signature": "interface SimNode extends SimulationNodeDatum",
- "exported": false,
- "origin": "ast",
- "body_hash": "b000c5412e66a114ce7349ebddb8f536c040a6c6f158c641a8370ea049b6a69d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts",
- "name": "main.ts",
- "kind": "file",
- "path": "viewer/main.ts",
- "span": "L1-L233",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "ab45ce4dfe66aafbe779b71d49d6370b3fe64482307b994e857ce34d3f317325",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#$",
- "name": "$",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L12-L12",
- "signature": "$ = <T extends HTMLElement>(id: string): T",
- "exported": false,
- "origin": "ast",
- "body_hash": "e46dd7aa9ed3186876ec11a8520b5af609af327108e045bce175d535aa9ed0e5",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#activeGraph",
- "name": "activeGraph",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L23-L25",
- "signature": "function activeGraph(): VizGraph | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "71591b2a66c0aa4d34f5b96cb2f1293248bdf02f55f6a73c2ee48258f6e2c445",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#glyphFor",
- "name": "glyphFor",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L62-L71",
- "signature": "function glyphFor(key: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "bd36f5f7c09e4d09ac342de7015c4cbda2ec86e36ab0c22716dd37b006444581",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#graphTab",
- "name": "graphTab",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L27-L29",
- "signature": "function graphTab(): \"context\" | \"code\"",
- "exported": false,
- "origin": "ast",
- "body_hash": "8bf89d024fe38470c469c719795eaf902c0e903157cf7ed24fe58a85db40cea4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#loadAll",
- "name": "loadAll",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L216-L223",
- "signature": "async function loadAll(): Promise<void>",
- "exported": false,
- "origin": "ast",
- "body_hash": "c896b70116fce23a9b9846a95ed257835d18d1368d091a56cec01674e36bc480",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#renderChips",
- "name": "renderChips",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L32-L60",
- "signature": "function renderChips(): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "1ef41cd967e509d6342b72755564e0975cb6b87edfcc2911fe79404f906eddcb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#renderChips.rank",
- "name": "rank",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L43-L43",
- "signature": "rank = (k: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "2b14b986fe4648076445602ac03c0f7c788760e8910fa9322617251aa60af5ce",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#renderLegend",
- "name": "renderLegend",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L74-L94",
- "signature": "function renderLegend(): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "ec1a1aba1d086d035890c60aadf98d7418c018c5488f106100102deaf0eafc01",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#setTab",
- "name": "setTab",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L129-L167",
- "signature": "function setTab(tab: Tab): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "c269ec25c7011b7343bdcec22729b23b0c65a57255598ac5145a46397809b321",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#showDetail",
- "name": "showDetail",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L115-L124",
- "signature": "function showDetail(id: string | null): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "e2b6f6a27ee1e3bac515ec8140678caa7c6cff3baab943cf43f8fdbdd7ab2e62",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#showEmpty",
- "name": "showEmpty",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L169-L173",
- "signature": "function showEmpty(html: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "981ef1b3d68cfcc89b2804a326c87ce023df618bfee612f158fa72291fe7a6d1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#Tab",
- "name": "Tab",
- "kind": "type",
- "path": "viewer/main.ts",
- "span": "L10-L10",
- "signature": "type Tab = \"context\" | \"code\" | \"outline\";",
- "exported": false,
- "origin": "ast",
- "body_hash": "4cd3b4afb6647f09ba09efccca7c53a333edbebe109fb1e24db04aa24df610de",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#updateCounts",
- "name": "updateCounts",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L103-L112",
- "signature": "function updateCounts(): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "170a2eec2d377c150839d170cd45a244584ecc9fdbd44ad194e8cac97fdfafb6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/main.ts#updateShownCount",
- "name": "updateShownCount",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L96-L101",
- "signature": "function updateShownCount(): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "11ab0ffa5da9e8d010f80cb1f95962900b0649019b7876e2b5213b85605d75ee",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/tree.ts",
- "name": "tree.ts",
- "kind": "file",
- "path": "viewer/tree.ts",
- "span": "L1-L67",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "d66e0157f4c2a1525c16505306eb3aabce82565c3d0e56199ea5b7a860290b01",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/tree.ts#esc",
- "name": "esc",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L7-L9",
- "signature": "function esc(s: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "9fb927f7f1c881ee1fe325c0dc8a25b8c5cdb2c101b08ae935a35bb428f5bbdb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/tree.ts#renderOutline",
- "name": "renderOutline",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L11-L66",
- "signature": "function renderOutline( host: HTMLElement, graph: VizGraph, selected: string | null, openState: Record<string, boolean>, onSelect: (id: string) => void, ): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "1448ed396d7ec6d8adc0e375aba7be5465c4e4db6d4184c6b5b01ac5a0788591",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/tree.ts#renderOutline.countDesc",
- "name": "countDesc",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L23-L26",
- "signature": "countDesc = (pid: string): number",
- "exported": true,
- "origin": "ast",
- "body_hash": "1054af458d2de230dfb45cea7a5a0141f2f4d12521ee04f0919e7defdea719dd",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/tree.ts#renderOutline.kids",
- "name": "kids",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L18-L22",
- "signature": "kids = (pid: string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "67a4d31f225a0006966aa2a39bdf245c514475f777082275626585879ce9b867",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/tree.ts#renderOutline.row",
- "name": "row",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L29-L42",
- "signature": "row = (node: (typeof files)[number]): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "a62af44af8ff57bd1307237e130956ce85cb42fc0c2fc4889907fd4e87e75ab2",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- }
- ],
- "edges": [
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#AgentResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#globToRegExp",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#listFiles",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#runAgent",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#RunAgentOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#runTool",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#safePath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/llm.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "openai",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#listFiles",
- "target": "bench/agent.ts#listFiles.walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#listFiles",
- "target": "bench/agent.ts#listFiles.walk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#listFiles.walk",
- "target": "bench/agent.ts#listFiles.walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runAgent",
- "target": "bench/agent.ts#runAgent.slideCacheBreakpoint",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runAgent",
- "target": "bench/agent.ts#runTool",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runAgent",
- "target": "bench/llm.ts#makeClient",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/agent.ts#runAgent",
- "target": "bench/agent.ts#runAgent.slideCacheBreakpoint",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runTool",
- "target": "bench/agent.ts#globToRegExp",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runTool",
- "target": "bench/agent.ts#listFiles",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runTool",
- "target": "bench/agent.ts#safePath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#extractJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#judge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#JudgeInput",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#Verdict",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "bench/llm.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "openai",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts#judge",
- "target": "bench/judge.ts#extractJson",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts#judge",
- "target": "bench/llm.ts#makeClient",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/llm.ts",
- "target": "bench/llm.ts#makeClient",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/llm.ts",
- "target": "openai",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#aggregate",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#ArmAgg",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#buildMarkdown",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#costOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#fmt",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#mean",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#pctDelta",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#Row",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#aggregate",
- "target": "bench/report.ts#costOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#aggregate",
- "target": "bench/report.ts#mean",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#buildMarkdown",
- "target": "bench/report.ts#aggregate",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#buildMarkdown",
- "target": "bench/report.ts#fmt",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#buildMarkdown",
- "target": "bench/report.ts#pctDelta",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#main",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#Args",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#main",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#makeDocsWorkdir",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#parseArgs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#pool",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "../src/ingest/pdf.js",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/agent.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/judge.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/llm.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/report.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/tasks.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "dotenv/config",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "src/index.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/agent.ts#runAgent",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/judge.ts#judge",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/llm.ts#makeClient",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/report.ts#buildMarkdown",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/run.ts#makeDocsWorkdir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/run.ts#parseArgs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/run.ts#pool",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts#main",
- "target": "src/viz/serve.ts#startVizServer.close",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#pool",
- "target": "bench/run.ts#pool.worker",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/selfcheck.ts#main",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/selfcheck.ts#main",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/selfcheck.ts#makeStubClient",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/agent.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/judge.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/report.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts#main",
- "target": "bench/agent.ts#runAgent",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/selfcheck.ts#main",
- "target": "bench/judge.ts#judge",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/selfcheck.ts#main",
- "target": "bench/report.ts#buildMarkdown",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/selfcheck.ts#main",
- "target": "bench/selfcheck.ts#makeStubClient",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#repoPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#Corpus",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#repoPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#Task",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "scripts/build-viewer.mjs",
- "target": "esbuild",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "scripts/build-viewer.mjs",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "scripts/build-viewer.mjs",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "scripts/build-viewer.mjs",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#CruxSummarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#FileCruxInput",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#NodeCrux",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#NodeRef",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#numberLines",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#OpenRouterCruxSummarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#parseResults",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#userContent",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "openai",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#OpenRouterCruxSummarizer",
- "target": "src/ai/crux.ts#OpenRouterCruxSummarizer.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#OpenRouterCruxSummarizer",
- "target": "src/ai/crux.ts#OpenRouterCruxSummarizer.describeFile",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#OpenRouterCruxSummarizer",
- "target": "src/ai/crux.ts#CruxSummarizer",
- "relation": "implements",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#OpenRouterCruxSummarizer.describeFile",
- "target": "src/ai/crux.ts#parseResults",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#OpenRouterCruxSummarizer.describeFile",
- "target": "src/ai/crux.ts#userContent",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#parseResults",
- "target": "src/ai/crux.ts#parseResults.num",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#parseResults",
- "target": "src/ai/crux.ts#parseResults.num",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#userContent",
- "target": "src/ai/crux.ts#numberLines",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/providers.ts#EngineConfig",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/providers.ts#resolveConfig",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/providers.ts#ResolvedConfig",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/summarize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/synthesize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts",
- "target": "src/ai/summarize.ts#OpenRouterSummarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts",
- "target": "src/ai/summarize.ts#Summarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts",
- "target": "src/ai/summarize.ts#userContent",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts",
- "target": "openai",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts#OpenRouterSummarizer",
- "target": "src/ai/summarize.ts#OpenRouterSummarizer.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts#OpenRouterSummarizer",
- "target": "src/ai/summarize.ts#OpenRouterSummarizer.summarize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts#OpenRouterSummarizer",
- "target": "src/ai/summarize.ts#Summarizer",
- "relation": "implements",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts#OpenRouterSummarizer.summarize",
- "target": "src/ai/summarize.ts#userContent",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#clean",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#FileSummary",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#OpenRouterSynthesizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#Synthesizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#SynthLink",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#SynthNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#userContent",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "openai",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts#OpenRouterSynthesizer",
- "target": "src/ai/synthesize.ts#OpenRouterSynthesizer.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts#OpenRouterSynthesizer",
- "target": "src/ai/synthesize.ts#OpenRouterSynthesizer.synthesize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts#OpenRouterSynthesizer",
- "target": "src/ai/synthesize.ts#Synthesizer",
- "relation": "implements",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts#OpenRouterSynthesizer.synthesize",
- "target": "src/ai/synthesize.ts#clean",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts#OpenRouterSynthesizer.synthesize",
- "target": "src/ai/synthesize.ts#userContent",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#engineFrom",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#fmt",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/context/check.ts#formatCheckReport",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.check",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.checkGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.graph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.init",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/check.ts#formatGraphCheckReport",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/viz/serve.ts#startVizServer",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#engineFrom",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#fmt",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "commander",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "dotenv/config",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/context/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#batchBySize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#batchKey",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildCache",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#buildContext",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildProgress",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#cachePath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#errMsg",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#FileWork",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#loadCache",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#mapWithConcurrency",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#NodeDraft",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#registerName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#resolveSlug",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#saveCache",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/ai/summarize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/ai/synthesize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#batchKey",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#batchBySize",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#batchKey",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#errMsg",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#loadCache",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#mapWithConcurrency",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#registerName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#resolveSlug",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#saveCache",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#deleteNode",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#digestSources",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#existingNodeSlugs",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#slugify",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#writeManifest",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#writeNode",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#loadCache",
- "target": "src/context/build.ts#cachePath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#saveCache",
- "target": "src/context/build.ts#cachePath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#checkContext",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#CheckOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#CheckResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#formatCheckReport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#short",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/check.ts#short",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/node-file.ts#readManifest",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/node-file.ts#readNodes",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#ContextNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#defaultHuman",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#deleteNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#digestSources",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#existingNodeSlugs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#Manifest",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#NodeLink",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#ParsedNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#preserveHuman",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#readManifest",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#readNodes",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#renderGenerated",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#renderNodeFile",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#slugify",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#SourceRef",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#writeManifest",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#writeNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "gray-matter",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts#digestSources",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/node-file.ts#preserveHuman",
- "target": "src/context/node-file.ts#defaultHuman",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts#renderNodeFile",
- "target": "src/context/node-file.ts#renderGenerated",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts#slugify",
- "target": "src/util/id.ts#normalizeName",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/node-file.ts#writeNode",
- "target": "src/context/node-file.ts#defaultHuman",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts#writeNode",
- "target": "src/context/node-file.ts#preserveHuman",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts#writeNode",
- "target": "src/context/node-file.ts#renderNodeFile",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/engine.ts#CheckRunOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/engine.ts#Graft",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/engine.ts#GraphRunOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/engine.ts#InitOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ai/providers.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ai/summarize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ai/synthesize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/context/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/context/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/graph/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.check",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.checkGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.cruxSummarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.graph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.init",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.modelLabel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.requireKey",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.summarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.synthesizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.check",
- "target": "src/context/check.ts#checkContext",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.checkGraph",
- "target": "src/graph/check.ts#checkGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.constructor",
- "target": "src/ai/providers.ts#resolveConfig",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.cruxSummarizer",
- "target": "src/engine.ts#Graft.requireKey",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.graph",
- "target": "src/engine.ts#Graft.cruxSummarizer",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.graph",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.init",
- "target": "src/context/build.ts#buildContext",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.init",
- "target": "src/engine.ts#Graft.modelLabel",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.init",
- "target": "src/engine.ts#Graft.summarizer",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.init",
- "target": "src/engine.ts#Graft.synthesizer",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.summarizer",
- "target": "src/engine.ts#Graft.requireKey",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.synthesizer",
- "target": "src/engine.ts#Graft.requireKey",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#GraphBuildOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#GraphBuildResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#listSourceFiles",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/enrich.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/resolve.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/build.ts#listSourceFiles",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/enrich.ts#enrichGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/extract.ts#extractFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/resolve.ts#resolveEdges",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/write.ts#writeGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#listSourceFiles",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#listSourceFiles",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#checkGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#formatGraphCheckReport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#GraphCheckOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#GraphCheckResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/build.ts#listSourceFiles",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/extract.ts#extractFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#buildCrux",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#collectFileCrux",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#enrichGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#EnrichOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#EnrichStats",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#spanLines",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts#buildCrux",
- "target": "src/graph/enrich.ts#spanLines",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts#collectFileCrux",
- "target": "src/ai/crux.ts#OpenRouterCruxSummarizer.describeFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#buildCrux",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#collectFileCrux",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#spanLines",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#calleeName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#clean",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#DefDescriptor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#describe",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#extractFile",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#ExtractResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#heritageEdges",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#importSpecifier",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#isImport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#Language",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#RawEdge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#tsExported",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#walk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#WalkCtx",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "tree-sitter",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "tree-sitter-python",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "tree-sitter-typescript",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/graph/extract.ts#walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#calleeName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#clean",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#describe",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#heritageEdges",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#importSpecifier",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#isImport",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#tsExported",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#push",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveEdges",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveImport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#push",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveEdges.add",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveImport",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveEdges.add",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Confidence",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Crux",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#EdgeV1",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#GraphV1",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Kind",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#NodeV1",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Relation",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#SummaryState",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "src/graph/write.ts#edgeOrder",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "src/graph/write.ts#readGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "src/graph/write.ts#writeGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ingest/fs.ts",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ingest/fs.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ingest/fs.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ingest/fs.ts#walkDir",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/util/id.ts",
- "target": "src/util/id.ts#contentHash",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/util/id.ts",
- "target": "src/util/id.ts#newId",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/util/id.ts",
- "target": "src/util/id.ts#normalizeName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/util/id.ts",
- "target": "node:crypto",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#assembleContextGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#extractSummary",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#normalizeRelation",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#VizEdge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#VizGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#VizNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "gray-matter",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts#assembleContextGraph",
- "target": "src/viz/assemble.ts#extractSummary",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts#assembleContextGraph",
- "target": "src/viz/assemble.ts#normalizeRelation",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/serve.ts#listen",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/serve.ts#sendJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/serve.ts#startVizServer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/serve.ts#VizServer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/serve.ts#VizServerOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "node:http",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/assemble.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts#listen",
- "target": "src/viz/serve.ts#listen.onError",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts#startVizServer",
- "target": "src/viz/assemble.ts#assembleContextGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/viz/serve.ts#startVizServer",
- "target": "src/viz/serve.ts#listen",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts#startVizServer",
- "target": "src/viz/serve.ts#sendJson",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts#startVizServer",
- "target": "src/viz/serve.ts#startVizServer.close",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts#startVizServer.close",
- "target": "src/viz/serve.ts#startVizServer.close",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "src/context/build.ts#buildContext",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/context.test.ts",
- "target": "src/context/check.ts#checkContext",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/context.test.ts#buildOpts",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/context.test.ts#makeFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/context.test.ts#buildOpts",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/context.test.ts#makeFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "src/context/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "src/context/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/helpers.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts#buildOpts",
- "target": "test/helpers.ts#fakeProviders",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/helpers.ts",
- "target": "test/helpers.ts#BracketSynthesizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts",
- "target": "test/helpers.ts#fakeProviders",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts",
- "target": "test/helpers.ts#PassthroughSummarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts",
- "target": "src/index.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts#BracketSynthesizer",
- "target": "test/helpers.ts#BracketSynthesizer.synthesize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts#BracketSynthesizer",
- "target": "src/ai/synthesize.ts#Synthesizer",
- "relation": "implements",
- "confidence": "inferred"
- },
- {
- "source": "test/helpers.ts#BracketSynthesizer.synthesize",
- "target": "test/helpers.ts#BracketSynthesizer.synthesize.ensure",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts#BracketSynthesizer.synthesize",
- "target": "test/helpers.ts#BracketSynthesizer.synthesize.ensure",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts#PassthroughSummarizer",
- "target": "test/helpers.ts#PassthroughSummarizer.summarize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts#PassthroughSummarizer",
- "target": "src/ai/summarize.ts#Summarizer",
- "relation": "implements",
- "confidence": "inferred"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "src/viz/assemble.ts#assembleContextGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "src/viz/assemble.ts#normalizeRelation",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "test/viz-assemble.test.ts#makeContextDir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "test/viz-assemble.test.ts#makeContextDir",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "src/viz/assemble.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "src/viz/serve.ts#startVizServer",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "src/viz/serve.ts#startVizServer.close",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "test/viz-serve.test.ts#makeDirs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "test/viz-serve.test.ts#makeDirs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:http",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "src/viz/serve.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#chipKey",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#CodeGraphV1",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#colorToken",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#cvar",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#Family",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#famOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#loadCodeGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#loadContextGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#onServerChange",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#VizEdge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#VizGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#VizNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts#chipKey",
- "target": "viewer/data.ts#famOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts",
- "target": "viewer/detail.ts#esc",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts",
- "target": "viewer/detail.ts#renderDetail",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts",
- "target": "viewer/data.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/data.ts#colorToken",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/data.ts#cvar",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/detail.ts#esc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/detail.ts#renderDetail.linkList",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/detail.ts#renderDetail.linkList",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/detail.ts#renderDetail.name",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail.linkList",
- "target": "viewer/detail.ts#esc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail.linkList",
- "target": "viewer/detail.ts#renderDetail.name",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "viewer/graph.ts#el",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "viewer/graph.ts#GraphView",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "viewer/graph.ts#SimEdge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "viewer/graph.ts#SimNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "d3-force",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "viewer/data.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.applyView",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.bindDrag",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.bindPanZoom",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.buildChrome",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.buildElements",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.ensureMarkers",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.firstMatch",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.focus",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.reheat",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.resetView",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.select",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.setData",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.tick",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.zoomBy",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.bindDrag",
- "target": "viewer/graph.ts#GraphView.bindDrag.move",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.bindDrag",
- "target": "viewer/graph.ts#GraphView.bindDrag.up",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.bindPanZoom",
- "target": "viewer/graph.ts#GraphView.applyView",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildChrome",
- "target": "viewer/graph.ts#el",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildChrome",
- "target": "viewer/graph.ts#GraphView.select",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildElements",
- "target": "viewer/graph.ts#el",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildElements",
- "target": "viewer/graph.ts#GraphView.bindDrag",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildElements",
- "target": "viewer/graph.ts#GraphView.ensureMarkers",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildElements",
- "target": "viewer/graph.ts#GraphView.select",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.constructor",
- "target": "viewer/graph.ts#GraphView.bindPanZoom",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.constructor",
- "target": "viewer/graph.ts#GraphView.buildChrome",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.ensureMarkers",
- "target": "viewer/data.ts#cvar",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.ensureMarkers",
- "target": "viewer/graph.ts#el",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.focus",
- "target": "viewer/graph.ts#GraphView.applyView",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.focus",
- "target": "viewer/graph.ts#GraphView.select",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.resetView",
- "target": "viewer/graph.ts#GraphView.applyView",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/data.ts#chipKey",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/data.ts#colorToken",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/data.ts#cvar",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/data.ts#famOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/graph.ts#GraphView.ensureMarkers",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/graph.ts#GraphView.restyle.nodeShown",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/graph.ts#GraphView.restyle.nodeShown",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.select",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.setData",
- "target": "viewer/data.ts#famOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.setData",
- "target": "viewer/graph.ts#GraphView.buildElements",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.setData",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.setData",
- "target": "viewer/graph.ts#GraphView.tick",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.zoomBy",
- "target": "viewer/graph.ts#GraphView.applyView",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/data.ts#onServerChange",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts#GraphView.firstMatch",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts#GraphView.focus",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts#GraphView.resetView",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts#GraphView.zoomBy",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#loadAll",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#renderChips",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#renderLegend",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#setTab",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#showDetail",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#$",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#activeGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#glyphFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#graphTab",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#loadAll",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#renderChips",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#renderLegend",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#setTab",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#showDetail",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#showEmpty",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#Tab",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#updateCounts",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#updateShownCount",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/data.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/detail.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/tree.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#glyphFor",
- "target": "viewer/data.ts#famOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#loadAll",
- "target": "viewer/data.ts#loadCodeGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#loadAll",
- "target": "viewer/data.ts#loadContextGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#loadAll",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#loadAll",
- "target": "viewer/main.ts#setTab",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/data.ts#chipKey",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#activeGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#glyphFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#renderChips",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#renderChips.rank",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#updateShownCount",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#renderChips.rank",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/data.ts#colorToken",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/data.ts#cvar",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/main.ts#activeGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/main.ts#graphTab",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/main.ts#renderLegend",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/main.ts#updateShownCount",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/graph.ts#GraphView.reheat",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/graph.ts#GraphView.resetView",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/graph.ts#GraphView.setData",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#activeGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#graphTab",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#renderChips",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#renderLegend",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#showDetail",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#showEmpty",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#updateCounts",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#updateShownCount",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/tree.ts#renderOutline",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/detail.ts#renderDetail",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/graph.ts#GraphView.focus",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/main.ts#graphTab",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/main.ts#showDetail",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/tree.ts#renderOutline",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#showEmpty",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#updateCounts",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#updateCounts",
- "target": "viewer/main.ts#activeGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#updateShownCount",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#updateShownCount",
- "target": "viewer/main.ts#activeGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts",
- "target": "viewer/tree.ts#esc",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts",
- "target": "viewer/tree.ts#renderOutline",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts",
- "target": "viewer/data.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline",
- "target": "viewer/tree.ts#renderOutline",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline",
- "target": "viewer/tree.ts#renderOutline.countDesc",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline",
- "target": "viewer/tree.ts#renderOutline.kids",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline",
- "target": "viewer/tree.ts#renderOutline.row",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline.countDesc",
- "target": "viewer/tree.ts#renderOutline.countDesc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline.countDesc",
- "target": "viewer/tree.ts#renderOutline.kids",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline.row",
- "target": "viewer/data.ts#colorToken",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/tree.ts#renderOutline.row",
- "target": "viewer/data.ts#cvar",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/tree.ts#renderOutline.row",
- "target": "viewer/tree.ts#esc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline.row",
- "target": "viewer/tree.ts#renderOutline.countDesc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline.row",
- "target": "viewer/tree.ts#renderOutline.kids",
- "relation": "calls",
- "confidence": "extracted"
- }
- ]
-}
diff --git a/.gitignore b/.gitignore
index 9f10fe96..506e5746 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,13 +2,10 @@ node_modules/
dist/
*.log
-# The graph's local LLM-call cache — regenerated, never committed. Everything
-# else in graft/ (concept nodes, wiring cards, .graph/wiring.json, manifest.json)
-# IS committed — it's the lockfile teammates and their agents read.
-graft/.cache/
-
-# Benchmark run artifacts (regenerated per run)
-bench/results/
+# graft's local graph cache — regenerable, not committed. Each dev runs
+# `graft build` locally (it re-adds this line itself), so the folder is a
+# personal cache like node_modules, never a shared artifact.
+graft/
# Env
.env
diff --git a/CHANGELOG.md b/CHANGELOG.md
index aface2a4..53f16bd9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,20 @@
# Changelog
+## 0.7.0
+
+### Changed
+
+- **`graft/` is now a local, git-ignored cache, not a committed artifact.** Every
+ `graft build` adds `graft/` to the repo's `.gitignore` itself, so the graph is
+ regenerated locally (like `node_modules`) rather than shared through git. Commit
+ `.claude/` (hooks, skill, statusline, `.mcp.json`) so teammates' agents pick graft
+ up; each teammate runs `graft build` for their own graph. `graft check` is now a
+ local freshness signal rather than a CI merge gate.
+
+### Removed
+
+- The `bench/` benchmark harness is no longer part of the published repo.
+
## 0.6.0
Consolidates the structural-traversal surface and wires the MCP server into
diff --git a/README.md b/README.md
index 1aeb1f10..230ca7bd 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
<img src="https://img.shields.io/badge/telemetry-none-546FFF?style=for-the-badge" />
</p>
-<!-- numbers from the committed run in bench/results/ (2026-07-22, 162 agent runs, 2 repos) — see Benchmark below -->
+<!-- numbers from a 162-run benchmark (2026-07-22, 2 repos, 3 arms) — see Benchmark below -->
**32% less cost · 46% fewer tool calls · 60% lower latency** with the graph bundle pushed up front, at equal correctness — or **16% less cost with correctness up 5 points** when the agent pulls from the graph on demand. Measured against the same agent going in cold.
</div>
@@ -37,10 +37,10 @@ graft init # build the graph + wire it into Claude Code
That is the whole setup. `graft init` builds `graft/` from your code and drops a statusline and hooks into `.claude/`, so from the next session on Graft rides along in Claude Code: it pulls the matching nodes into each prompt and rebuilds the graph in the background after every turn. No daemon, no re-indexing to remember, nothing to run or maintain by default — the graph is just files.
-Commit `graft/` so everyone who clones the repo (and their agents) gets the map:
+`graft build` adds `graft/` to your `.gitignore` automatically — the graph is a local, regenerable cache (like `node_modules`), not something you commit. What you share is the wiring `init` dropped into `.claude/`; each teammate runs `graft build` to generate their own graph:
```bash
-git add graft && git commit -m "add context graph"
+git add .claude && git commit -m "wire in graft"
```
Prefer not to install globally? `npx @nanonets/graft init` works the same way.
@@ -154,19 +154,18 @@ _Summary, sources, links, and notes ship today in markdown nodes. The crux ships
---
-## Keeping it honest (CI)
+## Keeping it honest
-A graph that has drifted from the code is worse than no graph. `graft check` compares each node's tracked source hashes against the current files and fails if the graph is stale. Drop it in CI so a pull request cannot merge with an out-of-date map.
+A graph that has drifted from the code is worse than no graph. `graft check` compares each node's tracked source hashes against the current files and tells you when your local graph is stale, so you know to rebuild:
```bash
-graft check # exits non-zero if graft/ has drifted
+graft check # reports drift since your last `graft build`
graft check --json # machine-readable drift report
```
-When the wiring graph exists, `graft check` validates it too — structural drift (symbols added, removed, or changed since the last `graft build`) and stale summaries both fail the check. A repo without a wiring graph is not penalized; the markdown graph stands alone.
+When the wiring graph exists, `graft check` validates it too — structural drift (symbols added, removed, or changed since the last `graft build`) and stale summaries. A repo without a wiring graph is not penalized; the markdown graph stands alone.
-<!-- placeholder: planned, not yet in the CLI -->
-> **Planned: auto-regen on PR.** A single CI bot will regenerate changed nodes on a pull request and push the update, so the graph stays current without anyone remembering to run `build`. Until then, regenerate with `graft build --deep` and commit it alongside your code.
+Because `graft/` is a local cache rather than a committed artifact, `check` is a local freshness signal — the statusline surfaces staleness every session and the post-turn hook rebuilds in the background, so in practice the graph tracks your working tree without your having to run anything.
---
@@ -249,15 +248,14 @@ with file/symbol counts, each dir's local hubs, and the global hotspots —
all ranked by in-degree, no LLM, no key:
```
-repo map — 105 files · 582 symbols · 1815 edges · typescript
+repo map — 113 files · 687 symbols · 2186 edges · typescript
-src/ 54 files · 414 symbols hubs: set (bindings.ts, 38←), contextDirFor (node-file.ts, 11←), wiringPath (write.ts, 10←)
-test/ 36 files · 68 symbols hubs: edge (graph-traverse.test.ts, 4←), graphOf (graph-traverse.test.ts, 4←), nodeStub (graph-traverse.test.ts, 3←)
+src/ 63 files · 527 symbols hubs: contextDirFor (node-file.ts, 21←), wiringPath (write.ts, 14←), buildGraph (build.ts, 11←)
+test/ 43 files · 102 symbols hubs: edge (graph-traverse.test.ts, 4←), graphOf (graph-traverse.test.ts, 4←), fileNode (graph-map.test.ts, 3←)
viewer/ 5 files · 58 symbols hubs: $ (main.ts, 9←), activeGraph (main.ts, 5←), cvar (data.ts, 5←)
-bench/ 8 files · 42 symbols hubs: makeClient (llm.ts, 3←), buildMarkdown (report.ts, 2←), judge (judge.ts, 2←)
scripts/ 2 files · 0 symbols
-hotspots: set · method · src/graph/bindings.ts:L21-L23 · 38← contextDirFor · function · src/context/node-file.ts:L100-L103 · 11← wiringPath · function · src/graph/write.ts:L20-L22 · 10← ...
+hotspots: contextDirFor · function · src/context/node-file.ts:L100-L103 · 21← wiringPath · function · src/graph/write.ts:L20-L22 · 14← buildGraph · function · src/graph/build.ts:L104-L218 · 11← ...
```
## Monorepos & multi-repo folders
@@ -271,7 +269,7 @@ Graft handles two shapes without any config:
sub-project can't drown a small one; hits carry `[scope/]` labels, and
`graft map` groups its directory clusters by scope first.
- **A folder of separate git repos** (no `.git` at the top) — `graft build`
- auto-splits: each child keeps its own committable `graft/`, and the parent
+ auto-splits: each child gets its own (git-ignored) `graft/`, and the parent
gets a `graft/workspace.json` index. Queries from the parent federate across
every child, always labeled `<child>/`. Run `graft build` inside a child to
work on just that repo.
@@ -314,7 +312,7 @@ normalized on load — no regeneration needed.
The claim Graft has to earn is simple: an agent that gets its context from the graph is cheaper and faster without getting more answers wrong. The harness runs every task through three arms of the same Claude Sonnet 5 agent with the same file tools: **cold** (explores from zero), **graph (push)** (a `graft ask --source` bundle injected up front), and **graft (pull)** (graft_ask/graft_skeleton tools, nothing injected — context paid for only when asked). An Opus 4.8 judge scores correctness with a required-keyword floor so a fast-but-wrong answer cannot win. Cost is cache-aware (reads ≈0.1×, writes 1.25×) — the billing model agents actually run under.
-Committed run: `bench/results/2026-07-22T13-19-14-246Z` — 162 runs across two repos (graft itself and a real Node/Express auth service), 3 trials each, tasks split between localized (single-file) and multi-file questions.
+A 162-run sweep — two repos (graft itself and a real Node/Express auth service), 3 trials each, tasks split between localized (single-file) and multi-file questions.
| Metric (mean/task) | Cold | Graph (push) | Graft (pull) |
|---|---|---|---|
@@ -324,14 +322,7 @@ Committed run: `bench/results/2026-07-22T13-19-14-246Z` — 162 runs across two
| Latency (s) | 39.8 | **15.8 (−60%)** | 39.5 (−1%) |
| Correctness | 93% | 93% | **98% (+5 pts)** |
-Push is the cost/latency win; pull is the correctness win (and never lost to cold anywhere, including single-file tasks). On one corpus push traded 3 correctness points for its savings — the per-corpus and per-locality splits are in the committed results, not averaged away. Reproduce it yourself:
-
-```bash
-npm run bench -- --smoke # 1 corpus, 1 task, all arms — a quick plumbing check
-npm run bench # full: all corpora, all tasks, 3 arms × 3 trials
-```
-
-See [`bench/README.md`](bench/README.md) for the method and how to add your own repo.
+Push is the cost/latency win; pull is the correctness win (and never lost to cold anywhere, including single-file tasks). On one corpus push traded 3 correctness points for its savings — the wins hold per-corpus and per-locality, not just on average.
---
diff --git a/bench/README.md b/bench/README.md
deleted file mode 100644
index 7b5ac631..00000000
--- a/bench/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-# Benchmark harness
-
-Measures the product's central claim: **an agent that gets its context from the graft graph
-costs less (tokens + latency) than an agent that explores from cold — without losing correctness.**
-And, just as deliberately, it measures where that claim is expected to FAIL: localized
-single-file tasks, where any pre-built context is plausibly net overhead.
-
-## What it does
-
-For each repo corpus it builds the wiring graph once (Tier-1 tree-sitter, $0, keyless, into a
-temp dir — the corpus repo is never written to), then runs every task through three arms of the
-**same** Claude Sonnet 5 agent loop with the **same** filesystem tools
-(`read_file`, `grep`, `glob`, `list_dir`):
-
-- **Cold** — the agent starts from zero and explores to find the answer.
-- **Graph (push)** — the agent additionally gets a `graft ask --source` bundle injected up
- front. The bundle is paid whether or not it helps — this is the "inject context every prompt"
- model.
-- **Graft (pull)** — nothing injected; the agent additionally gets `graft_ask` /
- `graft_skeleton` tools over the prebuilt graph and pays for graph context only when it asks.
- This is the just-in-time model the evidence favors.
-
-Every run records uncached input / output / cached tokens (via Anthropic cache-control
-breakpoints, mirroring how Claude Code bills), tool-call count, wall-clock, and a correctness
-score. Correctness is scored by an **Opus 4.8 judge** (against a reference answer) gated by a
-**required-keyword** floor, so a fast-but-wrong answer can't score a win. Each task runs N
-trials to average out agent stochasticity.
-
-Tasks carry a **locality** label (`localized` = answerable from one file, `multi-file`), and the
-report splits every corpus's table by locality — the honest headline is the split, not the
-average.
-
-## Requirements
-
-- A provider key — the agent (`anthropic/claude-sonnet-5`) and judge
- (`anthropic/claude-opus-4.8`) run through the same vendor-neutral provider
- layer as the engine. Set `GRAFT_API_KEY` (+ `GRAFT_PROVIDER` / `GRAFT_BASE_URL`),
- or the legacy `OPENROUTER_API_KEY`. Graph building is keyless. Override the
- models with `BENCH_AGENT_MODEL` / `BENCH_JUDGE_MODEL`.
-- The committed baseline was recorded via OpenRouter (no extended thinking). If
- you rerun against the **native** `anthropic` provider, note that current Claude
- models enable adaptive thinking by default, which inflates output tokens — so
- those numbers are not directly comparable to the committed baseline.
-
-## Run
-
-```bash
-npm run bench -- --smoke # context-engine, 1 task, all arms, 1 trial — plumbing check
-npm run bench # full: all corpora, all tasks, 3 arms, 3 trials
-npm run bench -- --corpora context-engine --tasks 3 --trials 2
-npm run bench -- --arms cold,pull # a subset of arms
-```
-
-Results are written to `bench/results/<timestamp>.json` (raw per-trial rows) and `<timestamp>.md`
-(the summary table, also printed to stdout). Judge on the **cost** column (cache-aware:
-reads ≈0.1×, writes 1.25×) — "total tokens" overstates any arm that front-loads cacheable context.
-
-## Corpora
-
-Defined in `bench/tasks.ts`.
-
-- `context-engine` — graft's own repo; always present, so the bench is self-contained.
- Mixes localized and multi-file tasks; ground truth cited from source at authoring time.
-- `unified-accounts-login-server` — the Nanonets unified auth service (Node/Express); expected
- as a **sibling** of this repo (override with `BENCH_REPO_UNIFIED_ACCOUNTS_LOGIN_SERVER`).
-- `new-website` — the Nanonets marketing site (Next.js App Router, ~342 `.tsx`); sibling,
- override with `BENCH_REPO_NEW_WEBSITE`. Its README is `create-next-app` boilerplate, so every
- answer requires reading code — a clean cold-arm test.
-- `northwind-docs` — currently **skipped**: the wiring graph indexes code only (no docs
- ingestion in the current engine).
-
-Missing corpora are skipped with a message, never a failure.
-
-**Fairness note:** the wiring graph indexes only code tree-sitter can parse, so README /
-markdown / `package.json` / CSS never enter the graph, while the cold agent *can* read them.
-Code tasks are therefore written to require **code** understanding, not README/config lookups.
-
-To add another repo: add a `kind: "repo"` corpus entry in `bench/tasks.ts` with tasks whose
-answers you can verify from its code, each labeled with `locality`.
-
-## Reading the result honestly
-
-The claim holds only if a graft arm is **both** materially cheaper/faster **and** at least as
-correct — per locality class. Expected shape based on external evidence and graft's earlier
-hono-bench: pull ≥ cold everywhere or nearly free; push helps on multi-file and hurts on
-localized. If push wins localized too, or pull loses anywhere, that's a real finding to report —
-not something the harness hides.
diff --git a/bench/agent.ts b/bench/agent.ts
deleted file mode 100644
index 7dc3aea8..00000000
--- a/bench/agent.ts
+++ /dev/null
@@ -1,341 +0,0 @@
-/**
- * The benchmark agent: a minimal, honest ReAct-style loop with filesystem
- * tools, driven by Claude Sonnet 5 (served via OpenRouter). Both benchmark arms
- * use this exact loop — the only difference is whether a pre-computed graph
- * context bundle is injected up front (graph arm) or not (cold arm). Keeping the
- * loop identical is what makes the token/latency/correctness comparison fair.
- *
- * We run a *manual* loop so we can read `usage` off every turn and sum it, so
- * the reported token cost is exact rather than estimated.
- */
-import { readFileSync, statSync, readdirSync, realpathSync } from "node:fs";
-import { resolve, relative, join, isAbsolute, sep } from "node:path";
-import { SKIP_DIRS, MAX_FILE_BYTES } from "../src/ingest/fs.js";
-import { ask, formatAsk, skeleton, formatSkeleton } from "../src/ask/ask.js";
-import { makeChatModel, AGENT_MODEL } from "./llm.js";
-import type { ChatModel, Message, ToolSpec } from "../src/ai/llm/types.js";
-
-export { AGENT_MODEL };
-
-export interface AgentResult {
- answer: string;
- tokens: { input: number; output: number; cacheRead: number; cacheCreate: number; total: number };
- toolCalls: number;
- iterations: number;
- wallMs: number;
- stopReason: string | null;
- toolLog: Array<{ name: string; input: unknown }>;
-}
-
-export interface RunAgentOptions {
- /** Directory the filesystem tools are confined to. */
- root: string;
- question: string;
- /** When set (graph/push arm), this bundle is injected before the question. */
- contextBundle?: string;
- /** When set (pull arm), the agent additionally gets graft_ask/graft_skeleton
- * tools over the prebuilt graph at this contextDir — nothing injected up
- * front; the agent pays for graph context only when it asks for it. */
- graft?: { contextDir: string };
- maxIterations?: number;
- model?: ChatModel;
-}
-
-const SYSTEM_PROMPT =
- "You are a software engineer answering a factual question about a codebase or a folder of documents. " +
- "The files live under the tool root. Use read_file, grep, glob, and list_dir to find the answer, then " +
- "state it directly. Investigate enough to be correct, but stop exploring once you can answer. " +
- "When you are ready, give your final answer as plain text with no further tool calls.";
-
-/** Resolve a model-supplied path and confine it to `root` (rejects `..`, absolute escapes, symlink escapes). */
-export function safePath(root: string, p: string): string {
- const abs = resolve(root, p);
- let rel = relative(root, abs);
- if (rel.startsWith("..") || isAbsolute(rel)) throw new Error(`path escapes root: ${p}`);
- try {
- const real = realpathSync(abs);
- const realRoot = realpathSync(root);
- rel = relative(realRoot, real);
- if (rel.startsWith("..") || isAbsolute(rel)) throw new Error(`path escapes root: ${p}`);
- return real;
- } catch (e) {
- if (e instanceof Error && e.message.startsWith("path escapes")) throw e;
- return abs;
- }
-}
-
-function listFiles(root: string): string[] {
- const out: string[] = [];
- const walk = (dir: string) => {
- let entries;
- try {
- entries = readdirSync(dir, { withFileTypes: true });
- } catch {
- return;
- }
- for (const e of entries) {
- if (e.name.startsWith(".")) continue;
- const full = join(dir, e.name);
- if (e.isDirectory()) {
- if (SKIP_DIRS.has(e.name)) continue;
- walk(full);
- } else if (e.isFile()) {
- try {
- if (statSync(full).size > MAX_FILE_BYTES) continue;
- } catch {
- continue;
- }
- out.push(full);
- }
- }
- };
- walk(root);
- return out;
-}
-
-/** Very small glob → RegExp (supports **, *, ?), matched against root-relative POSIX paths. */
-function globToRegExp(glob: string): RegExp {
- let re = "";
- for (let i = 0; i < glob.length; i++) {
- const c = glob[i];
- if (c === "*") {
- if (glob[i + 1] === "*") {
- re += ".*";
- i++;
- } else re += "[^/]*";
- } else if (c === "?") re += "[^/]";
- else if (".+^${}()|[]\\".includes(c)) re += "\\" + c;
- else re += c;
- }
- return new RegExp("^" + re + "$");
-}
-
-/** Tool definitions in provider-neutral form. */
-const TOOLS: ToolSpec[] = [
- {
- name: "read_file",
- description: "Read a UTF-8 text file under the root. Optionally limit to a line range.",
- parameters: {
- type: "object",
- properties: {
- path: { type: "string", description: "Path relative to the root" },
- start_line: { type: "integer", description: "1-based first line (optional)" },
- end_line: { type: "integer", description: "1-based last line (optional)" },
- },
- required: ["path"],
- },
- },
- {
- name: "grep",
- description: "Search file contents with a JavaScript regular expression. Returns matching lines as path:line: text.",
- parameters: {
- type: "object",
- properties: {
- pattern: { type: "string", description: "Regular expression" },
- path: { type: "string", description: "Restrict to this subdirectory or file (optional)" },
- ignore_case: { type: "boolean", description: "Case-insensitive match (optional)" },
- },
- required: ["pattern"],
- },
- },
- {
- name: "glob",
- description: "List files whose root-relative path matches a glob (e.g. src/**/*.ts).",
- parameters: { type: "object", properties: { pattern: { type: "string" } }, required: ["pattern"] },
- },
- {
- name: "list_dir",
- description: "List the entries of a directory under the root.",
- parameters: {
- type: "object",
- properties: { path: { type: "string", description: "Directory relative to the root (default: root)" } },
- required: [],
- },
- },
-];
-
-/** Extra tools for the pull arm: the graft graph as an on-demand service. */
-const GRAFT_TOOLS: ToolSpec[] = [
- {
- name: "graft_ask",
- description:
- "Query this repo's prebuilt context graph in plain words. Returns ranked symbols/concepts with exact file:line spans and the relevant source inlined — the cheapest way to locate and understand code. Prefer it over grep/read_file for orientation; use structural phrasings too ('who calls X').",
- parameters: {
- type: "object",
- properties: {
- query: { type: "string", description: "What you want to understand, in plain words" },
- limit: { type: "integer", description: "Max results (default 5)" },
- full: { type: "boolean", description: "Inline whole definition spans instead of crux excerpts" },
- },
- required: ["query"],
- },
- },
- {
- name: "graft_skeleton",
- description:
- "Signatures-only view of one file — every definition's signature + line span, ~10× cheaper than reading the file.",
- parameters: {
- type: "object",
- properties: { file: { type: "string", description: "Repo-relative file path" } },
- required: ["file"],
- },
- },
-];
-
-const MAX_GREP_MATCHES = 100;
-const MAX_GLOB_RESULTS = 200;
-const MAX_READ_LINES = 400;
-
-function runTool(root: string, name: string, input: any, graft?: { contextDir: string }): string {
- try {
- if (graft && name === "graft_ask") {
- const limit = typeof input.limit === "number" ? input.limit : 5;
- const r = ask(root, String(input.query ?? ""), {
- contextDir: graft.contextDir, limit, source: true, full: input.full === true,
- });
- return formatAsk(r);
- }
- if (graft && name === "graft_skeleton") {
- return formatSkeleton(skeleton(root, String(input.file ?? ""), { contextDir: graft.contextDir }));
- }
- if (name === "read_file") {
- const file = safePath(root, String(input.path));
- const lines = readFileSync(file, "utf8").split("\n");
- const start = input.start_line ? Math.max(1, input.start_line) : 1;
- const end = input.end_line ? Math.min(lines.length, input.end_line) : Math.min(lines.length, start - 1 + MAX_READ_LINES);
- const slice = lines.slice(start - 1, end);
- const numbered = slice.map((l: string, i: number) => `${start + i}\t${l}`).join("\n");
- const more = end < lines.length ? `\n… (${lines.length - end} more lines)` : "";
- return numbered + more || "(empty file)";
- }
- if (name === "list_dir") {
- const dir = input.path ? safePath(root, String(input.path)) : root;
- const entries = readdirSync(dir, { withFileTypes: true })
- .filter((e) => !e.name.startsWith(".") && !SKIP_DIRS.has(e.name))
- .map((e) => (e.isDirectory() ? e.name + "/" : e.name));
- return entries.length ? entries.join("\n") : "(empty directory)";
- }
- if (name === "glob") {
- const re = globToRegExp(String(input.pattern));
- const hits = listFiles(root)
- .map((f) => relative(root, f).split(sep).join("/"))
- .filter((rel) => re.test(rel))
- .slice(0, MAX_GLOB_RESULTS);
- return hits.length ? hits.join("\n") : "(no files matched)";
- }
- if (name === "grep") {
- const flags = input.ignore_case ? "i" : "";
- let re: RegExp;
- try {
- re = new RegExp(String(input.pattern), flags);
- } catch (e) {
- return `invalid regex: ${e instanceof Error ? e.message : String(e)}`;
- }
- const base = input.path ? safePath(root, String(input.path)) : root;
- const files = statSync(base).isDirectory() ? listFiles(base) : [base];
- const out: string[] = [];
- for (const f of files) {
- let text: string;
- try {
- text = readFileSync(f, "utf8");
- } catch {
- continue;
- }
- const rel = relative(root, f).split(sep).join("/");
- const fl = text.split("\n");
- for (let i = 0; i < fl.length; i++) {
- if (re.test(fl[i])) {
- out.push(`${rel}:${i + 1}: ${fl[i].trim().slice(0, 200)}`);
- if (out.length >= MAX_GREP_MATCHES) return out.join("\n") + "\n… (truncated)";
- }
- }
- }
- return out.length ? out.join("\n") : "(no matches)";
- }
- return `unknown tool: ${name}`;
- } catch (e) {
- return `error: ${e instanceof Error ? e.message : String(e)}`;
- }
-}
-
-export async function runAgent(opts: RunAgentOptions): Promise<AgentResult> {
- const model = opts.model ?? makeChatModel(AGENT_MODEL);
- const root = resolve(opts.root);
- const maxIterations = opts.maxIterations ?? 15;
-
- const userText = opts.contextBundle
- ? `A knowledge graph of these files was queried for this task and returned the context below. ` +
- `Use it to answer; you may still use the tools to confirm or fill gaps.\n\n` +
- `<graph_context>\n${opts.contextBundle}\n</graph_context>\n\nQuestion: ${opts.question}`
- : `Question: ${opts.question}`;
-
- // Cache breakpoints (Message.cacheBreakpoint) let the adapter mark a stable
- // prefix as cacheable. The system + tools + the (possibly large) bundle are a
- // stable head, cached once; a breakpoint then slides onto the newest tool
- // result each turn so the entire prior transcript is a cache read rather than
- // re-billed at full price — which is how Claude Code actually runs, and what
- // makes the token numbers fair.
- const systemText = opts.graft
- ? SYSTEM_PROMPT +
- " This repo also has a prebuilt context graph: the graft_ask and graft_skeleton tools query it and are much cheaper than grep/read_file for finding and understanding code."
- : SYSTEM_PROMPT;
- const tools = opts.graft ? [...TOOLS, ...GRAFT_TOOLS] : TOOLS;
- const messages: Message[] = [
- { role: "system", content: systemText, cacheBreakpoint: true },
- { role: "user", content: userText, cacheBreakpoint: true },
- ];
-
- /** Keep the cache breakpoint on the most recent tool result (strip it from older ones). */
- const slideCacheBreakpoint = () => {
- const toolMsgs = messages.filter((m) => m.role === "tool");
- toolMsgs.forEach((m, i) => {
- m.cacheBreakpoint = i === toolMsgs.length - 1;
- });
- };
- const tokens = { input: 0, output: 0, cacheRead: 0, cacheCreate: 0, total: 0 };
- const toolLog: AgentResult["toolLog"] = [];
- let toolCalls = 0;
- let iterations = 0;
- let stopReason: string | null = null;
- let answer = "";
-
- const started = Date.now();
- for (iterations = 1; iterations <= maxIterations; iterations++) {
- const resp = await model.create({ messages, tools, maxTokens: 4096 });
- // Usage is already normalized (input = uncached-only) by the adapter.
- tokens.input += resp.usage.input;
- tokens.output += resp.usage.output;
- tokens.cacheRead += resp.usage.cacheRead;
- tokens.cacheCreate += resp.usage.cacheCreate;
- stopReason = resp.stopReason;
-
- messages.push(resp.assistant); // preserve the assistant turn (verbatim replay) for the next request
-
- if (resp.toolCalls.length === 0) {
- answer = resp.text.trim();
- break;
- }
-
- for (const tc of resp.toolCalls) {
- toolCalls++;
- const input = (tc.args ?? {}) as any; // already parsed by the adapter
- toolLog.push({ name: tc.name, input });
- const result = runTool(root, tc.name, input, opts.graft);
- messages.push({ role: "tool", toolCallId: tc.id, content: result });
- }
- slideCacheBreakpoint();
- }
-
- if (!answer) {
- // Loop hit the cap — take the last assistant text we have.
- for (let i = messages.length - 1; i >= 0; i--) {
- if (messages[i].role === "assistant" && messages[i].content.trim()) {
- answer = messages[i].content.trim();
- break;
- }
- }
- }
-
- tokens.total = tokens.input + tokens.output + tokens.cacheRead;
- return { answer, tokens, toolCalls, iterations, wallMs: Date.now() - started, stopReason, toolLog };
-}
diff --git a/bench/judge.ts b/bench/judge.ts
deleted file mode 100644
index 2e0de53b..00000000
--- a/bench/judge.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Correctness scoring. Two layers, deliberately:
- *
- * 1. A deterministic required-keyword floor — the answer must contain every
- * `requiredKeywords` substring (case-insensitive). Cheap, can't be gamed by
- * a confident-but-wrong answer, and catches an over-generous LLM judge.
- * 2. An LLM judge (Claude Opus 4.8, via OpenRouter — deliberately stronger than
- * the Sonnet 5 agent, so it isn't grading itself) that scores the answer
- * against a reference and returns JSON.
- *
- * Final correctness = judge says correct AND the keyword floor passed.
- */
-import { makeChatModel, JUDGE_MODEL } from "./llm.js";
-import type { ChatModel } from "../src/ai/llm/types.js";
-
-export { JUDGE_MODEL };
-
-export interface Verdict {
- score: number; // 0..1 from the judge
- judgeCorrect: boolean;
- keywordPass: boolean; // deterministic floor
- correct: boolean; // judgeCorrect && keywordPass
- reasoning: string;
-}
-
-export interface JudgeInput {
- question: string;
- referenceAnswer: string;
- agentAnswer: string;
- requiredKeywords: string[];
- model?: ChatModel;
-}
-
-/** Pull the first {...} JSON object out of a string (models sometimes wrap JSON in prose/fences). */
-function extractJson(text: string): any {
- try {
- return JSON.parse(text);
- } catch {
- const m = text.match(/\{[\s\S]*\}/);
- if (m) {
- try {
- return JSON.parse(m[0]);
- } catch {
- /* fall through */
- }
- }
- return null;
- }
-}
-
-export async function judge(input: JudgeInput): Promise<Verdict> {
- const model = input.model ?? makeChatModel(JUDGE_MODEL);
-
- const kw = input.requiredKeywords ?? [];
- const hay = input.agentAnswer.toLowerCase();
- const keywordPass = kw.every((k) => hay.includes(k.toLowerCase()));
-
- const prompt =
- `You are grading an AI agent's answer to a factual question about a codebase/document set. ` +
- `Respond with ONLY a JSON object of the form {"correct": boolean, "score": number, "reasoning": string} ` +
- `where score is 0.0 (wrong/irrelevant) to 1.0 (fully correct and complete). No prose, no code fences.\n\n` +
- `Question:\n${input.question}\n\n` +
- `Reference answer (ground truth):\n${input.referenceAnswer}\n\n` +
- `Agent's answer:\n${input.agentAnswer}\n\n` +
- `Grade whether the agent's answer is factually correct and responsive, judged against the reference. ` +
- `Extra correct detail is fine; contradicting the reference or missing the core fact is not.`;
-
- const resp = await model.create({
- maxTokens: 1024,
- messages: [{ role: "user", content: prompt }],
- responseFormat: { kind: "json" },
- });
-
- const text = resp.text;
- const parsed = extractJson(text) ?? { correct: false, score: 0, reasoning: `unparseable judge output: ${text.slice(0, 200)}` };
-
- const score = Math.max(0, Math.min(1, Number(parsed.score) || 0));
- const judgeCorrect = Boolean(parsed.correct);
- return {
- score,
- judgeCorrect,
- keywordPass,
- correct: judgeCorrect && keywordPass,
- reasoning: String(parsed.reasoning ?? ""),
- };
-}
diff --git a/bench/llm.ts b/bench/llm.ts
deleted file mode 100644
index f6e43202..00000000
--- a/bench/llm.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * LLM plumbing for the benchmark. Routed through the same vendor-neutral
- * provider layer the engine uses (`src/ai/llm`), so the bench runs against
- * whatever provider is configured (`GRAFT_PROVIDER` / `GRAFT_API_KEY` /
- * `GRAFT_BASE_URL`, or the legacy `OPENROUTER_API_KEY`). The default models are
- * OpenRouter-style Claude ids; override per role via env.
- */
-import { resolveConfig } from "../src/ai/providers.js";
-import { createChatModel } from "../src/ai/llm/factory.js";
-import type { ChatModel } from "../src/ai/llm/types.js";
-
-export const AGENT_MODEL = process.env.BENCH_AGENT_MODEL ?? "anthropic/claude-sonnet-5";
-export const JUDGE_MODEL = process.env.BENCH_JUDGE_MODEL ?? "anthropic/claude-opus-4.8";
-
-/** A configured transport for `model`. Throws if no provider key is set. */
-export function makeChatModel(model: string): ChatModel {
- const cfg = resolveConfig({ model });
- if (!cfg.apiKey) {
- throw new Error("Set GRAFT_API_KEY (or OPENROUTER_API_KEY) — the bench agent + judge need a provider key.");
- }
- return createChatModel({
- provider: cfg.provider,
- apiKey: cfg.apiKey,
- model,
- baseUrl: cfg.baseUrl,
- headers: cfg.headers,
- });
-}
diff --git a/bench/report.ts b/bench/report.ts
deleted file mode 100644
index 056422b4..00000000
--- a/bench/report.ts
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * Aggregation and reporting. Turns the raw per-trial rows into the summary
- * table that is the actual launch deliverable: per corpus, cold vs graph, with
- * the token / latency / correctness deltas that either back the pitch or don't.
- */
-export type Arm = "cold" | "graph" | "pull";
-
-export interface Row {
- corpus: string;
- taskId: string;
- arm: Arm;
- trial: number;
- /** "localized" (single-file answer) or "multi-file". */
- locality: string;
- tokensInput: number;
- tokensOutput: number;
- tokensTotal: number;
- cacheRead: number;
- cacheCreate: number;
- toolCalls: number;
- wallMs: number;
- correct: boolean;
- score: number;
- keywordPass: boolean;
- judgeCorrect: boolean;
- iterations: number;
- stopReason: string | null;
- answer: string;
- reasoning: string;
-}
-
-// Sonnet 5 pricing per MTok (standard sticker; intro is $2/$10 through 2026-08-31).
-const IN_PER_TOK = 3 / 1_000_000;
-const OUT_PER_TOK = 15 / 1_000_000;
-
-/** Approximate USD cost of one agent run, accounting for cache read/write multipliers. */
-export function costOf(r: { tokensInput: number; tokensOutput: number; cacheRead: number; cacheCreate: number }): number {
- return (
- (r.tokensInput + r.cacheCreate * 1.25 + r.cacheRead * 0.1) * IN_PER_TOK +
- r.tokensOutput * OUT_PER_TOK
- );
-}
-
-function mean(xs: number[]): number {
- return xs.length ? xs.reduce((a, b) => a + b, 0) / xs.length : 0;
-}
-
-interface ArmAgg {
- n: number;
- tokensTotal: number;
- tokensInput: number;
- tokensOutput: number;
- toolCalls: number;
- wallMs: number;
- correctness: number; // fraction 0..1
- score: number;
- cost: number;
-}
-
-function aggregate(rows: Row[]): ArmAgg {
- return {
- n: rows.length,
- tokensTotal: mean(rows.map((r) => r.tokensTotal)),
- tokensInput: mean(rows.map((r) => r.tokensInput)),
- tokensOutput: mean(rows.map((r) => r.tokensOutput)),
- toolCalls: mean(rows.map((r) => r.toolCalls)),
- wallMs: mean(rows.map((r) => r.wallMs)),
- correctness: mean(rows.map((r) => (r.correct ? 1 : 0))),
- score: mean(rows.map((r) => r.score)),
- cost: mean(rows.map((r) => costOf(r))),
- };
-}
-
-function pctDelta(cold: number, graph: number): string {
- if (cold === 0) return "n/a";
- const d = ((graph - cold) / cold) * 100;
- return (d > 0 ? "+" : "") + d.toFixed(0) + "%";
-}
-
-function fmt(n: number): string {
- return n >= 1000 ? Math.round(n).toLocaleString() : n.toFixed(n < 10 ? 1 : 0);
-}
-
-const ARM_LABEL: Record<Arm, string> = { cold: "Cold", graph: "Graph (push)", pull: "Graft (pull)" };
-
-/** The metric table for one row subset, one column per arm plus a Δ-vs-cold
- * column for every non-cold arm present. */
-function metricTable(rows: Row[], arms: Arm[]): string[] {
- const agg = new Map<Arm, ArmAgg>(arms.map((a) => [a, aggregate(rows.filter((r) => r.arm === a))]));
- const cold = agg.get("cold");
-
- const header = ["Metric", ...arms.map((a) => ARM_LABEL[a])];
- const cells = (label: string, value: (a: ArmAgg) => number, render: (v: number) => string, delta?: (c: number, x: number) => string) => {
- const out = [label];
- for (const a of arms) {
- const v = value(agg.get(a)!);
- let cell = render(v);
- if (delta && cold && a !== "cold") cell += ` (${delta(value(cold), v)})`;
- out.push(cell);
- }
- return `| ${out.join(" | ")} |`;
- };
-
- const lines = [`| ${header.join(" | ")} |`, `|${header.map(() => "---").join("|")}|`];
- lines.push(cells("Cost / task ($)", (a) => a.cost, (v) => v.toFixed(4), pctDelta));
- lines.push(cells("Uncached input tokens", (a) => a.tokensInput, fmt, pctDelta));
- lines.push(cells("Total tokens (incl. cached)", (a) => a.tokensTotal, fmt, pctDelta));
- lines.push(cells("Output tokens", (a) => a.tokensOutput, fmt, pctDelta));
- lines.push(cells("Tool calls", (a) => a.toolCalls, fmt, pctDelta));
- lines.push(cells("Wall-clock (s)", (a) => a.wallMs, (v) => (v / 1000).toFixed(1), pctDelta));
- lines.push(cells("Correctness", (a) => a.correctness, (v) => (v * 100).toFixed(0) + "%"));
- lines.push(cells("Judge score", (a) => a.score, (v) => v.toFixed(2)));
- return lines;
-}
-
-/** Cost + correctness verdict for one non-cold arm vs cold. */
-function verdictFor(label: string, c: ArmAgg, g: ArmAgg): string {
- const cheaper = g.cost < c.cost;
- const correctnessHeld = g.correctness >= c.correctness - 0.001;
- return cheaper && correctnessHeld
- ? `✅ ${label} is cheaper (${pctDelta(c.cost, g.cost)} cost) and correctness held or improved.`
- : !cheaper && g.correctness > c.correctness + 0.001
- ? `➖ ${label} costs more (${pctDelta(c.cost, g.cost)}) but is more correct (+${((g.correctness - c.correctness) * 100).toFixed(0)} pts) — a quality win, not a cost win.`
- : cheaper
- ? `⚠️ ${label} is cheaper but correctness dropped ${((c.correctness - g.correctness) * 100).toFixed(0)} pts — not a clean win.`
- : `❌ ${label} costs more with no correctness gain here.`;
-}
-
-export function buildMarkdown(rows: Row[]): string {
- const corpora = [...new Set(rows.map((r) => r.corpus))];
- const armOrder: Arm[] = ["cold", "graph", "pull"];
- const lines: string[] = [];
- lines.push("# graft — Benchmark Results", "");
- lines.push(
- `Agent: Claude Sonnet 5 · Judge: Claude Opus 4.8 · ${rows.length} agent runs total.`,
- "",
- "Each cell is the mean across all tasks × trials for that subset/arm; Δ is vs cold. " +
- "**Cold** = agent explores with filesystem tools from zero. **Graph (push)** = same agent, " +
- "same tools, plus a `graft ask --source` bundle injected up front. **Graft (pull)** = same " +
- "agent plus graft_ask/graft_skeleton tools over the prebuilt graph — nothing injected; " +
- "graph context is paid only when the agent asks for it.",
- "",
- "Judge on **cost** (cache-aware: reads ≈0.1×, writes 1.25×) + correctness — \"total tokens\" " +
- "overstates any arm that front-loads cacheable context.",
- "",
- );
-
- for (const corpus of corpora) {
- const inCorpus = rows.filter((r) => r.corpus === corpus);
- const arms = armOrder.filter((a) => inCorpus.some((r) => r.arm === a));
-
- lines.push(`## ${corpus}`, "");
- lines.push(...metricTable(inCorpus, arms), "");
-
- const cold = aggregate(inCorpus.filter((r) => r.arm === "cold"));
- if (arms.includes("cold")) {
- for (const a of arms.filter((x) => x !== "cold")) {
- lines.push(verdictFor(ARM_LABEL[a], cold, aggregate(inCorpus.filter((r) => r.arm === a))));
- }
- lines.push("");
- }
-
- // The locality split is the honest headline: pre-built context is expected
- // to help on multi-file questions and to be net overhead on localized ones.
- const localities = [...new Set(inCorpus.map((r) => r.locality))];
- if (localities.length > 1) {
- for (const loc of localities.sort()) {
- const sub = inCorpus.filter((r) => r.locality === loc);
- lines.push(`### ${corpus} — ${loc} tasks only`, "");
- lines.push(...metricTable(sub, arms), "");
- }
- }
- }
- return lines.join("\n");
-}
diff --git a/bench/run.ts b/bench/run.ts
deleted file mode 100644
index 4f83329a..00000000
--- a/bench/run.ts
+++ /dev/null
@@ -1,209 +0,0 @@
-/**
- * Benchmark orchestrator.
- *
- * npm run bench # full run: all corpora, all tasks, 3 trials
- * npm run bench -- --smoke # 1 corpus, 1 task, 1 trial (plumbing check)
- * npm run bench -- --corpora context-engine --tasks 3 --trials 2
- * npm run bench -- --arms cold,pull # subset of arms
- *
- * Three arms, identical agent loop:
- * cold — filesystem tools only, from zero.
- * graph — same, plus a pre-computed `graft ask --source` bundle injected
- * up front (push: the bundle is paid whether or not it helps).
- * pull — same tools plus graft_ask/graft_skeleton over the prebuilt graph;
- * nothing injected — graph context is paid only when requested.
- *
- * Needs OPENROUTER_API_KEY for the agent (Sonnet 5) and judge (Opus 4.8).
- * The graph itself builds keyless (Tier-1 tree-sitter, $0) into a temp dir —
- * corpora repos are never written to. Override models with BENCH_AGENT_MODEL /
- * BENCH_JUDGE_MODEL.
- */
-import "dotenv/config";
-import { existsSync, mkdtempSync, mkdirSync, writeFileSync, rmSync } from "node:fs";
-import { tmpdir } from "node:os";
-import { join, dirname } from "node:path";
-import { fileURLToPath } from "node:url";
-import { buildGraph } from "../src/graph/build.js";
-import { ask, formatAsk } from "../src/ask/ask.js";
-import { CORPORA } from "./tasks.js";
-import { runAgent } from "./agent.js";
-import { judge } from "./judge.js";
-import { makeChatModel, AGENT_MODEL, JUDGE_MODEL } from "./llm.js";
-import { resolveConfig } from "../src/ai/providers.js";
-import { buildMarkdown, type Row, type Arm } from "./report.js";
-
-const here = dirname(fileURLToPath(import.meta.url));
-
-const ALL_ARMS: Arm[] = ["cold", "graph", "pull"];
-
-interface Args {
- corpora?: string[];
- tasks?: number;
- trials: number;
- arms: Arm[];
- concurrency: number;
-}
-
-function parseArgs(argv: string[]): Args {
- const a: Args = { trials: 3, arms: [...ALL_ARMS], concurrency: 6 };
- for (let i = 0; i < argv.length; i++) {
- const arg = argv[i];
- if (arg === "--smoke") {
- a.corpora = ["context-engine"]; // self-contained — always present
- a.tasks = 1;
- a.trials = 1;
- } else if (arg === "--corpora" || arg === "--repos") a.corpora = argv[++i].split(",");
- else if (arg === "--tasks") a.tasks = Number(argv[++i]);
- else if (arg === "--trials") a.trials = Number(argv[++i]);
- else if (arg === "--arms") a.arms = argv[++i].split(",") as Arm[];
- else if (arg === "--concurrency") a.concurrency = Math.max(1, Number(argv[++i]));
- }
- const bad = a.arms.filter((x) => !ALL_ARMS.includes(x));
- if (bad.length) {
- console.error(`Unknown arm(s): ${bad.join(", ")}. Valid: ${ALL_ARMS.join(", ")}`);
- process.exit(1);
- }
- return a;
-}
-
-/** Run items through `fn` with at most `n` in flight. Independent agent/judge calls, so safe to parallelize. */
-async function pool<T, R>(items: T[], n: number, fn: (item: T) => Promise<R>): Promise<R[]> {
- const results: R[] = new Array(items.length);
- let next = 0;
- async function worker() {
- while (next < items.length) {
- const idx = next++;
- results[idx] = await fn(items[idx]);
- }
- }
- await Promise.all(Array.from({ length: Math.min(n, items.length) }, worker));
- return results;
-}
-
-async function main() {
- const args = parseArgs(process.argv.slice(2));
- if (!resolveConfig().apiKey) {
- console.error("Set GRAFT_API_KEY (or OPENROUTER_API_KEY) — the agent and judge need a provider key.");
- process.exit(1);
- }
- const agentModel = makeChatModel(AGENT_MODEL);
- const judgeModel = makeChatModel(JUDGE_MODEL);
-
- const corpora = CORPORA.filter((c) => !args.corpora || args.corpora.includes(c.id));
- if (corpora.length === 0) {
- console.error(`No matching corpora. Available: ${CORPORA.map((c) => c.id).join(", ")}`);
- process.exit(1);
- }
-
- const rows: Row[] = [];
- const tmpDirs: string[] = [];
-
- for (const corpus of corpora) {
- if (corpus.kind === "docs") {
- console.log(`\n=== corpus: ${corpus.id} — SKIPPED (wiring graph indexes code only; no docs ingestion) ===`);
- continue;
- }
- if (!existsSync(corpus.path)) {
- console.log(`\n=== corpus: ${corpus.id} — SKIPPED (path not found: ${corpus.path}) ===`);
- continue;
- }
- const tasks = args.tasks ? corpus.tasks.slice(0, args.tasks) : corpus.tasks;
- console.log(`\n=== corpus: ${corpus.id} — ${tasks.length} tasks × ${args.arms.length} arms × ${args.trials} trials ===`);
-
- // Build the wiring graph once per corpus into a TEMP contextDir — Tier-1
- // tree-sitter only ($0, keyless), and the corpus repo is never written to.
- const graftDir = mkdtempSync(join(tmpdir(), "graft-bench-ctx-"));
- tmpDirs.push(graftDir);
- const t0 = Date.now();
- const g = await buildGraph(corpus.path, {
- contextDir: graftDir,
- onProgress: (p) => process.stdout.write(`\r build: ${p.phase} ${p.index + 1}/${p.total} `),
- });
- console.log(`\n graph: ${g.nodes} nodes / ${g.edges} edges in ${((Date.now() - t0) / 1000).toFixed(1)}s`);
- if (g.errors.length) console.log(` build errors: ${g.errors.length} (first: ${g.errors[0]})`);
-
- // Precompute each task's push bundle once (reused across trials). `ask` is
- // deterministic and local, so doing it up front keeps the pool self-contained.
- const bundles = new Map<string, string>();
- if (args.arms.includes("graph")) {
- for (const task of tasks) {
- bundles.set(task.id, formatAsk(ask(corpus.path, task.question, { contextDir: graftDir, source: true, limit: 5 })));
- }
- }
-
- // Every (task, arm, trial) is an independent unit — run them through a bounded pool.
- const units: Array<{ task: (typeof tasks)[number]; arm: Arm; trial: number }> = [];
- for (const task of tasks) for (const arm of args.arms) for (let trial = 1; trial <= args.trials; trial++) units.push({ task, arm, trial });
-
- let done = 0;
- const total = units.length;
- const corpusRows = await pool(units, args.concurrency, async ({ task, arm, trial }) => {
- const base = {
- corpus: corpus.id, taskId: task.id, arm, trial,
- locality: task.locality ?? "multi-file",
- };
- try {
- const ar = await runAgent({
- model: agentModel,
- root: corpus.path,
- question: task.question,
- contextBundle: arm === "graph" ? bundles.get(task.id) : undefined,
- graft: arm === "pull" ? { contextDir: graftDir } : undefined,
- });
- const v = await judge({
- model: judgeModel,
- question: task.question,
- referenceAnswer: task.referenceAnswer,
- agentAnswer: ar.answer,
- requiredKeywords: task.requiredKeywords,
- });
- console.log(` (${++done}/${total}) [${task.id}] ${arm} t${trial}: ${v.correct ? "✓" : "✗"} ${ar.tokens.total} tok, ${ar.toolCalls} tools, ${(ar.wallMs / 1000).toFixed(1)}s`);
- return {
- ...base,
- tokensInput: ar.tokens.input, tokensOutput: ar.tokens.output, tokensTotal: ar.tokens.total,
- cacheRead: ar.tokens.cacheRead, cacheCreate: ar.tokens.cacheCreate,
- toolCalls: ar.toolCalls, wallMs: ar.wallMs,
- correct: v.correct, score: v.score, keywordPass: v.keywordPass, judgeCorrect: v.judgeCorrect,
- iterations: ar.iterations, stopReason: ar.stopReason, answer: ar.answer, reasoning: v.reasoning,
- } as Row;
- } catch (e) {
- // Non-fatal: record the failure and keep going so one error can't sink the run.
- console.log(` (${++done}/${total}) [${task.id}] ${arm} t${trial}: ERROR ${e instanceof Error ? e.message : String(e)}`);
- return {
- ...base,
- tokensInput: 0, tokensOutput: 0, tokensTotal: 0, cacheRead: 0, cacheCreate: 0,
- toolCalls: 0, wallMs: 0, correct: false, score: 0, keywordPass: false,
- judgeCorrect: false, iterations: 0, stopReason: "error", answer: "",
- reasoning: `run error: ${e instanceof Error ? e.message : String(e)}`,
- } as Row;
- }
- });
- rows.push(...corpusRows);
- }
-
- if (rows.length === 0) {
- console.error("\nNo runnable corpora (all skipped).");
- process.exit(1);
- }
-
- // Write results + summary. Timestamp comes from Date (fine in a standalone script).
- const stamp = new Date().toISOString().replace(/[:.]/g, "-");
- const outDir = join(here, "results");
- mkdirSync(outDir, { recursive: true });
- const jsonPath = join(outDir, `${stamp}.json`);
- const mdPath = join(outDir, `${stamp}.md`);
- writeFileSync(jsonPath, JSON.stringify({ generatedAt: stamp, rows }, null, 2));
- const md = buildMarkdown(rows);
- writeFileSync(mdPath, md);
-
- console.log("\n" + md);
- console.log(`\nRaw rows → ${jsonPath}`);
- console.log(`Summary → ${mdPath}`);
-
- for (const d of tmpDirs) rmSync(d, { recursive: true, force: true });
-}
-
-main().catch((err) => {
- console.error(err);
- process.exit(1);
-});
diff --git a/bench/selfcheck.ts b/bench/selfcheck.ts
deleted file mode 100644
index 4f8a134e..00000000
--- a/bench/selfcheck.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Offline verification of the harness plumbing — no API key needed. Drives the
- * agent loop, tool execution, judge, and report with a stubbed Claude client so
- * we can confirm control flow end-to-end before spending on a live run.
- *
- * npx tsx bench/selfcheck.ts
- */
-import { mkdtempSync, writeFileSync, mkdirSync } from "node:fs";
-import { tmpdir } from "node:os";
-import { join } from "node:path";
-import assert from "node:assert/strict";
-import { runAgent } from "./agent.js";
-import { judge } from "./judge.js";
-import { buildMarkdown, type Row } from "./report.js";
-import type { ChatModel } from "../src/ai/llm/types.js";
-
-const usage = { input: 100, output: 50, cacheRead: 0, cacheCreate: 0 };
-
-/** Stub {@link ChatModel}: agent uses grep then answers; a `json` request is the judge. */
-function makeStubModel(): ChatModel {
- let agentTurn = 0;
- return {
- label: "stub:model",
- async create(req) {
- if (req.responseFormat?.kind === "json") {
- const text = JSON.stringify({ correct: true, score: 0.9, reasoning: "matches reference" });
- return { text, toolCalls: [], usage, stopReason: "stop", assistant: { role: "assistant", content: text } };
- }
- // Agent call. First turn: use grep. Second turn: final answer.
- agentTurn++;
- if (agentTurn === 1) {
- const toolCalls = [{ id: "tc_1", name: "grep", args: { pattern: "SECRET_TOKEN" } }];
- return { text: "", toolCalls, usage, stopReason: "tool_use", assistant: { role: "assistant", content: "", toolCalls } };
- }
- const text = "The secret token is SECRET_TOKEN, defined in config.ts.";
- return { text, toolCalls: [], usage, stopReason: "stop", assistant: { role: "assistant", content: text } };
- },
- };
-}
-
-async function main() {
- const root = mkdtempSync(join(tmpdir(), "cge-selfcheck-"));
- mkdirSync(join(root, "src"), { recursive: true });
- writeFileSync(join(root, "src", "config.ts"), "export const token = 'SECRET_TOKEN';\n");
-
- const model = makeStubModel();
-
- // 1. Agent loop: should call the grep tool once, then answer.
- const ar = await runAgent({ model, root, question: "What is the secret token?" });
- assert.equal(ar.toolCalls, 1, "expected exactly one tool call");
- assert.equal(ar.toolLog[0].name, "grep", "expected the grep tool to run");
- assert.ok(ar.answer.includes("SECRET_TOKEN"), "answer should contain the fact");
- assert.equal(ar.tokens.total, 300, "tokens should sum across 2 turns (150 each)");
- assert.equal(ar.stopReason, "stop");
- console.log(`✓ agent loop: ${ar.toolCalls} tool call, ${ar.tokens.total} tokens, answer="${ar.answer}"`);
-
- // 2. Real tool execution actually found the file (grep ran against the temp repo).
- const graphAr = await runAgent({
- model: makeStubModel(),
- root,
- question: "What is the secret token?",
- contextBundle: "# Context\nSECRET_TOKEN lives in config.ts",
- });
- assert.ok(graphAr.answer.includes("SECRET_TOKEN"));
- console.log(`✓ graph arm (bundle injected): answer="${graphAr.answer}"`);
-
- // 3. Judge: keyword floor + parsed verdict.
- const v = await judge({
- model,
- question: "What is the secret token?",
- referenceAnswer: "SECRET_TOKEN",
- agentAnswer: ar.answer,
- requiredKeywords: ["SECRET_TOKEN"],
- });
- assert.equal(v.keywordPass, true);
- assert.equal(v.judgeCorrect, true);
- assert.equal(v.correct, true);
- assert.equal(v.score, 0.9);
- console.log(`✓ judge: correct=${v.correct} score=${v.score} keywordPass=${v.keywordPass}`);
-
- // 3b. Keyword floor overrides an over-generous judge.
- const vMiss = await judge({
- model,
- question: "q",
- referenceAnswer: "SECRET_TOKEN",
- agentAnswer: "I could not find it.",
- requiredKeywords: ["SECRET_TOKEN"],
- });
- assert.equal(vMiss.keywordPass, false);
- assert.equal(vMiss.correct, false, "keyword floor must veto the judge's 'correct'");
- console.log(`✓ keyword floor vetoes judge: correct=${vMiss.correct}`);
-
- // 4. Report renders.
- const rows: Row[] = [
- { corpus: "demo", taskId: "t1", arm: "cold", trial: 1, locality: "multi-file", tokensInput: 5000, tokensOutput: 800, tokensTotal: 5800, cacheRead: 0, cacheCreate: 0, toolCalls: 6, wallMs: 12000, correct: true, score: 0.9, keywordPass: true, judgeCorrect: true, iterations: 4, stopReason: "end_turn", answer: "a", reasoning: "r" },
- { corpus: "demo", taskId: "t1", arm: "graph", trial: 1, locality: "multi-file", tokensInput: 2000, tokensOutput: 400, tokensTotal: 2400, cacheRead: 0, cacheCreate: 0, toolCalls: 1, wallMs: 5000, correct: true, score: 0.92, keywordPass: true, judgeCorrect: true, iterations: 2, stopReason: "end_turn", answer: "a", reasoning: "r" },
- ];
- const md = buildMarkdown(rows);
- assert.ok(md.includes("## demo"));
- assert.ok(md.includes("Total tokens"));
- assert.ok(md.includes("✅"), "graph is cheaper + correctness held → should show a clean win");
- console.log("✓ report renders with cold-vs-graph deltas and verdict");
-
- console.log("\nAll harness self-checks passed. (Live runs use OPENROUTER_API_KEY.)");
-}
-
-main().catch((e) => {
- console.error(e);
- process.exit(1);
-});
diff --git a/bench/tasks.ts b/bench/tasks.ts
deleted file mode 100644
index afb21a46..00000000
--- a/bench/tasks.ts
+++ /dev/null
@@ -1,364 +0,0 @@
-/**
- * The benchmark corpus and task set. This file *is* the benchmark's validity:
- * every task must have a verifiable answer, grounded in the actual source
- * (cited during authoring), not guessed. Tasks carry a `locality` label so the
- * report can split the verdict: multi-file questions are where graph context
- * should help; localized single-file questions are where it is expected to be
- * net overhead — the bench must measure both, not select for the winner.
- *
- * Corpora: graft's own repo (context-engine — always present, self-contained),
- * plus real external repos expected as siblings of this one under the same
- * parent directory (override a path with BENCH_REPO_<ID_UPPER> if needed):
- * - unified-accounts-login-server — the Nanonets unified auth service (Node/Express).
- * - new-website — the Nanonets marketing site (Next.js App Router).
- * Plus the checked-in demo docs (northwind-docs) as a knowledge-folder data
- * point (currently skipped: the wiring graph indexes code only).
- *
- * Note on fairness: the wiring graph indexes only code files tree-sitter can
- * parse, so README/markdown/package.json/CSS do NOT enter the graph — while
- * the cold agent can read them. Code questions therefore target *code*
- * understanding, not README/config lookups.
- */
-import { dirname, resolve } from "node:path";
-import { fileURLToPath } from "node:url";
-
-const here = dirname(fileURLToPath(import.meta.url));
-const repoRoot = resolve(here, "..");
-const parent = resolve(repoRoot, "..");
-
-/** Sibling repo path by default; overridable via BENCH_REPO_<ID_UPPER> (dashes → underscores). */
-function repoPath(id: string): string {
- const envKey = "BENCH_REPO_" + id.toUpperCase().replace(/-/g, "_");
- return process.env[envKey] ?? resolve(parent, id);
-}
-
-export interface Task {
- id: string;
- question: string;
- referenceAnswer: string;
- /** Case-insensitive substrings the answer must contain (deterministic floor). */
- requiredKeywords: string[];
- /** "localized" = answerable from one file (where graph context is expected to
- * be net overhead — the hono-bench finding this bench must reproduce, not
- * hide). Absent = "multi-file", the shape the original corpus was limited to. */
- locality?: "localized" | "multi-file";
-}
-
-export interface Corpus {
- id: string;
- /** "repo" → ingestRepo + agent reads source directly. "docs" → ingestDir + agent reads extracted text. */
- kind: "repo" | "docs";
- path: string;
- tasks: Task[];
-}
-
-const UNIFIED: Corpus = {
- id: "unified-accounts-login-server",
- kind: "repo",
- path: repoPath("unified-accounts-login-server"),
- tasks: [
- {
- id: "auth-provider-flows",
- question: "What authentication provider does this service use, and what login flows does it support?",
- referenceAnswer:
- "Auth0. Two flows: an Authorization Code flow for Google social login (connection google-oauth2), and a Resource Owner Password Grant (password-realm, realm Username-Password-Authentication) for on-page email/password login.",
- requiredKeywords: ["auth0"],
- },
- {
- id: "redirect-precedence",
- question: "After a successful login, how does the service decide which app to redirect the user to?",
- referenceAnswer:
- "splitService.getRedirectDestination resolves in order: a valid return_url first, then redirect_to (agents→AGENTS_URL, context→CONTEXT_URL/atlas.nanonets.ai, app→APP_NANONETS_URL), defaulting to APP_NANONETS_URL. return_url is validated to a hostname ending in nanonets.com, nanonets.ai, or exactly localhost.",
- requiredKeywords: ["return_url"],
- },
- {
- id: "session-cookie",
- question: "What is the session cookie called and what are its flags?",
- referenceAnswer:
- "The cookie is session_token: httpOnly false (frontends read it in JS), secure only in production, sameSite lax in dev / none in prod, domain unset in dev / .nanonets.com in prod, path '/'.",
- requiredKeywords: ["session_token"],
- },
- {
- id: "session-jwt",
- question: "How is the session token created and validated?",
- referenceAnswer:
- "sessionService mints a JWT signed with HS256 using SESSION_SECRET_KEY, with claims including session_id, email, user_id, auth_type 'auth0', redirect_app, and type:'session'; default expiry 24h applied to both the JWT exp and the cookie maxAge. Validation rejects any token whose type is not 'session'.",
- requiredKeywords: ["session"],
- },
- {
- id: "callback-csrf",
- question: "How does the /callback route protect against CSRF before exchanging the Auth0 code?",
- referenceAnswer:
- "It verifies the Auth0 `state` returned in the query against the value stored in the `auth_state` cookie, and only exchanges the code for tokens if they match.",
- requiredKeywords: ["auth_state"],
- },
- {
- id: "app-handoff",
- question: "When app-handoff is enabled, how does the server decide whether to send a user to the app or to agents?",
- referenceAnswer:
- "When appHandoff is enabled and there is no explicit return_url and redirect_to is empty or 'agents', it makes an HMAC-signed server-to-server call to app's user-exists endpoint; existing app users are 302'd to app via a one-time app_handoff code, while unknown/new users go to AGENTS_URL. On any error/timeout it defaults to agents. The logic exists twice (in /callback and in finalizeAuthSession for the password path).",
- requiredKeywords: ["handoff"],
- },
- {
- id: "required-config",
- question: "Which configuration values are required for the server to boot, and what happens if they are missing?",
- referenceAnswer:
- "validateConfig() runs at startup and process.exit(1)s if AUTH0_CLIENT_ID, AUTH0_CLIENT_SECRET, or SESSION_SECRET_KEY are missing (plus the app-handoff secrets when handoff is enabled).",
- requiredKeywords: ["auth0_client_id", "session_secret_key"],
- },
- {
- id: "product-preference",
- question: "How is a user's product preference stored and where is it set?",
- referenceAnswer:
- "It is stored in a SQLite table user_preferences (email primary key, preferred_app). The POST /choose-product route writes it via userService.setUserPreference and only accepts product in {app, agents}.",
- requiredKeywords: ["preference"],
- },
- {
- id: "signup-password-stash",
- question: "During signup with email verification, how are the user's credentials handled while waiting for verification?",
- referenceAnswer:
- "signupIntentService stores the signup password AES-256-GCM-encrypted with an HKDF-derived key from SESSION_SECRET_KEY, with a 30-minute TTL; consumption is single-use and uses crypto.timingSafeEqual.",
- requiredKeywords: ["encrypt"],
- },
- {
- id: "entry-and-port",
- question: "What is the server's entry point and what port does it listen on by default?",
- referenceAnswer:
- "The entry point is src/app.js (an Express app); the default port is 5001 (env PORT). Note the README/.env.example mention 3000, but the code default is 5001.",
- requiredKeywords: ["5001"],
- },
- ],
-};
-
-const NEW_WEBSITE: Corpus = {
- id: "new-website",
- kind: "repo",
- path: repoPath("new-website"),
- tasks: [
- {
- id: "framework",
- question: "What framework and routing approach does this site use?",
- referenceAnswer:
- "Next.js (v16) with the App Router (file-based routing under src/app), React 19, and TypeScript.",
- requiredKeywords: ["next.js"],
- },
- {
- id: "dynamic-route",
- question: "Is there any dynamic route, and what does it do?",
- referenceAnswer:
- "Yes — /customers/unlock/[slug], a password-gated case-study route. It calls notFound() unless the slug is in PROTECTED_SLUGS, and marks itself robots noindex.",
- requiredKeywords: ["unlock"],
- },
- {
- id: "case-study-auth",
- question: "How does the case-study password gate actually work, and is it secure?",
- referenceAnswer:
- "It is client-side only: passwords are a hardcoded slug→password map in src/lib/case-study-passwords.ts, and UnlockForm compares the typed password in the browser. The passwords are shipped to the client, so it is not real security.",
- requiredKeywords: ["client"],
- },
- {
- id: "redirects",
- question: "Where are URL redirects configured and give an example.",
- referenceAnswer:
- "In next.config.ts, which defines several permanent redirects (e.g. /agent → /agents, /products/nano → /agent/nano, /case-studies/roche → /customers/roche). middleware.ts is a no-op.",
- requiredKeywords: ["redirect"],
- },
- {
- id: "analytics-stack",
- question: "What analytics and tracking tools are wired into the site?",
- referenceAnswer:
- "PostHog plus Google Tag Manager, Google Analytics (gtag), LinkedIn Insight, Intercom, and Termly consent — mostly gated on production. PostHog is set up in src/components/analytics.tsx.",
- requiredKeywords: ["posthog"],
- },
- {
- id: "posthog-proxy",
- question: "How are PostHog analytics requests routed?",
- referenceAnswer:
- "next.config.ts rewrites /ingest/* to https://events.nanonets.com (a self-hosted PostHog proxy); the PostHog host defaults to events.nanonets.com.",
- requiredKeywords: ["ingest"],
- },
- {
- id: "primary-cta",
- question: "What is the site's primary call-to-action and how is it implemented?",
- referenceAnswer:
- "A 'Book a demo' button (BookDemoButton) that opens a Calendly scheduling URL and fires a LinkedIn conversion on calendly.event_scheduled; it is used across most pages.",
- requiredKeywords: ["calendly"],
- },
- {
- id: "forms",
- question: "How are lead-capture forms (e.g. the AP cost calculator) served?",
- referenceAnswer:
- "As static HTML files under public/forms/, wired via next.config.ts rewrites (/forms/<name> → /forms/<name>.html). There are no Next API routes.",
- requiredKeywords: ["forms"],
- },
- {
- id: "styling",
- question: "What styling system does the site use?",
- referenceAnswer:
- "Tailwind CSS v4 via @tailwindcss/postcss, with no tailwind.config file — theme tokens are defined in CSS (@theme) in globals.css. Font is DM Sans via next/font.",
- requiredKeywords: ["tailwind"],
- },
- {
- id: "content-source",
- question: "Where does the page content come from — a CMS, markdown, or code?",
- referenceAnswer:
- "Content is hardcoded in TSX components/pages; there is no CMS and no MDX/markdown content source, and no data-fetching calls.",
- requiredKeywords: [],
- },
- ],
-};
-
-const NORTHWIND_DOCS: Corpus = {
- id: "northwind-docs",
- kind: "docs",
- path: resolve(repoRoot, "examples", "demo-docs"),
- tasks: [
- {
- id: "failed-charge-flow",
- question: "What happens when a customer charge fails in the Northwind billing system?",
- referenceAnswer:
- "The Payments Service emits payment_failed; the Dunning Worker retries up to 3 times with exponential backoff (1h, 6h, 24h). After the third failed retry the subscription is marked past_due, and after 7 days past_due it is automatically suspended.",
- requiredKeywords: ["past_due"],
- },
- {
- id: "token-expiry",
- question: "How long do Northwind access tokens last, and what backs the Auth Service?",
- referenceAnswer:
- "Access tokens expire after 15 minutes and refresh tokens after 30 days; the Auth Service is backed by Redis for token revocation lists.",
- requiredKeywords: ["redis"],
- },
- {
- id: "databases",
- question: "Which databases do the Orders and Inventory services use?",
- referenceAnswer:
- "The Orders Service uses a PostgreSQL database named orders_db and the Inventory Service uses a separate PostgreSQL database named inventory_db.",
- requiredKeywords: ["orders_db", "inventory_db"],
- },
- {
- id: "billing-escalation",
- question: "Who do you escalate a Stripe outage to in billing, and where do you post updates?",
- referenceAnswer:
- "Escalate to the Payments team lead, Dana Whitfield, and post an update in the #billing-incidents Slack channel; page on-call via PagerDuty service 'northwind-billing'.",
- requiredKeywords: ["dana"],
- },
- {
- id: "charge-success-alert",
- question: "What is the target charge success rate, and when does an alert fire?",
- referenceAnswer:
- "Target charge success rate is above 97%; an alert fires if it drops below 95% over any 30-minute window.",
- requiredKeywords: ["97"],
- },
- {
- id: "notifications-providers",
- question: "How does Northwind send transactional email and SMS?",
- referenceAnswer: "The Notifications Service sends transactional email through SendGrid and SMS through Twilio.",
- requiredKeywords: ["sendgrid", "twilio"],
- },
- {
- id: "deployment",
- question: "Where and how is Northwind deployed?",
- referenceAnswer:
- "On Kubernetes in AWS us-east-1; each service is a separate Deployment with a minimum of 3 replicas; images are built by GitHub Actions and pushed to Amazon ECR; production deploys require Platform-team approval.",
- requiredKeywords: ["us-east-1"],
- },
- {
- id: "refund-approval",
- question: "What approval is needed to issue a large refund?",
- referenceAnswer:
- "Refunds above $500 require approval from a Finance team lead; all refunds are logged to the audit_log table in payments_db and reflected in Stripe within 24 hours.",
- requiredKeywords: ["500"],
- },
- {
- id: "org-structure",
- question: "How is Northwind engineering organized and who is the VP of Engineering?",
- referenceAnswer:
- "Four teams — Platform (infra/CI-CD), Payments (Payments Service and billing), Orders (Orders and Inventory), and Growth (Notifications and customer-facing). The VP of Engineering is Priya Nair.",
- requiredKeywords: ["priya"],
- },
- {
- id: "local-setup",
- question: "What are the steps to set up the Northwind platform locally?",
- referenceAnswer:
- "Clone the northwind-inc/platform monorepo, install Node.js 20 and Docker, run 'make bootstrap' to start local Postgres/Redis/Kafka via docker-compose, copy .env.sample to .env with your API keys, and run 'make test'.",
- requiredKeywords: ["bootstrap"],
- },
- ],
-};
-
-/** graft's own repo: the one corpus that is always present, so the bench runs
- * self-contained (the sibling Nanonets repos are often absent). Mixes localized
- * single-file questions with multi-file traces, so the report can split the
- * verdict by locality. Answers cited from source at authoring time. */
-const CONTEXT_ENGINE: Corpus = {
- id: "context-engine",
- kind: "repo",
- path: repoRoot,
- tasks: [
- {
- id: "orientation-budget",
- question: "How many bytes of INDEX.md does the Claude SessionStart hook inject at most?",
- referenceAnswer:
- "1500 bytes — formatOrientation in src/claude/format.ts slices the INDEX.md text to a budgetBytes parameter that defaults to 1500.",
- requiredKeywords: ["1500"],
- locality: "localized",
- },
- {
- id: "span-cap",
- question: "How many source lines can `graft ask --source` inline per hit before truncating?",
- referenceAnswer:
- "80 lines — MAX_SPAN_LINES in src/ask/ask.ts; longer definitions are truncated with a marker naming the file:line range to open.",
- requiredKeywords: ["80"],
- locality: "localized",
- },
- {
- id: "lock-freshness",
- question: "When does acquireLock treat an existing sync lock file as stale?",
- referenceAnswer:
- "When the lock file's mtime is at least LOCK_STALE_MS = 300000 ms (5 minutes) old — then it is removed and re-created; a fresher lock makes acquireLock return false.",
- requiredKeywords: ["300000"],
- locality: "localized",
- },
- {
- id: "link-verbs",
- question: "Which relation verbs is the synthesis LLM allowed to use for links between concept nodes?",
- referenceAnswer:
- "Exactly seven: part_of, uses, depends_on, produces, configures, validates, implements — enforced both in the prompt and by an enum in the record_graph JSON schema.",
- requiredKeywords: ["part_of", "configures", "validates"],
- locality: "localized",
- },
- {
- id: "cache-multipliers",
- question: "What cache read/write cost multipliers does the bench's costOf function apply?",
- referenceAnswer:
- "Cache creation is billed at 1.25× the input rate and cache reads at 0.1×, on Sonnet-5 pricing of $3/MTok input and $15/MTok output.",
- requiredKeywords: ["1.25", "0.1"],
- locality: "localized",
- },
- {
- id: "post-edit-flow",
- question: "After Claude edits a source file, what does graft's PostToolUse hook do, end to end?",
- referenceAnswer:
- "handlePostEdit ignores edits under graft/, otherwise marks the stats dirty with a fresh staleCount from `graft check --json` and records the file basename, then reads the wiring graph and injects a blast-radius block (incoming edges from other files to symbols in the edited file, capped at 8) as PostToolUse additionalContext.",
- requiredKeywords: ["blast radius", "dirty"],
- locality: "multi-file",
- },
- {
- id: "sidecar-consistency",
- question: "How does graft guarantee the ask-index sidecar can never change ranking results versus live tokenization?",
- referenceAnswer:
- "tokenize/counts live only in src/ask/index-file.ts and both build-time indexing and query-time fallback import them, so both sides split text identically; at query time the sidecar is used only if its doc count matches the graph's node count and every node id is present, and the stored df plus live-tokenized concept bags reproduce exactly the idf that computeIdf would produce live — anything off falls back to live tokenization.",
- requiredKeywords: ["tokenize"],
- locality: "multi-file",
- },
- {
- id: "tier2-recompute",
- question: "When is a symbol's Tier-2 summary (crux/summary) recomputed versus reused from cache?",
- referenceAnswer:
- "Enrichment is keyed on the node's body_hash (sha256 of the definition text): buildGraph folds the prior wiring.json in as a cache, and enrichGraph re-summarizes a node only when its body_hash changed (or it was never summarized); unchanged bodies keep their summary, and a Tier-1-only run never wipes Tier-2 fields.",
- requiredKeywords: ["body_hash"],
- locality: "multi-file",
- },
- ],
-};
-
-export const CORPORA: Corpus[] = [CONTEXT_ENGINE, UNIFIED, NEW_WEBSITE, NORTHWIND_DOCS];
diff --git a/bench/token-ab.ts b/bench/token-ab.ts
deleted file mode 100644
index 94abb3f4..00000000
--- a/bench/token-ab.ts
+++ /dev/null
@@ -1,278 +0,0 @@
-/**
- * token-ab.ts — a manual A/B harness to see whether graft saves an agent tokens.
- *
- * Same question, same model, two arms:
- * COLD — the agent gets only `search` + `read_file` tools and must explore
- * the repo itself (what a normal coding agent does).
- * GRAFT — the agent gets the SAME tools, but the `graft ask --source` pack is
- * pasted into its context up front, so it can answer without exploring.
- *
- * It prints a side-by-side metrics table (tokens, LLM round-trips, tool calls,
- * files opened, wall-clock) and BOTH final answers, so you judge equivalence.
- *
- * Prereqs:
- * 1. OPENROUTER_API_KEY in context-engine/.env (already there).
- * 2. graft built in the target repo: cd <REPO> && graft build
- *
- * Run: npx tsx bench/token-ab.ts
- * Tune: edit the CONFIG block, or override via env (REPO, QUESTION, MODEL, MAX_STEPS).
- */
-import "dotenv/config";
-import { execFileSync } from "node:child_process";
-import { readFileSync, existsSync } from "node:fs";
-import { resolve, relative, isAbsolute } from "node:path";
-import { makeChatModel } from "./llm.js";
-import type { Message, ToolSpec } from "../src/ai/llm/types.js";
-
-// ─────────────────────────── CONFIG (edit freely) ───────────────────────────
-const CONFIG = {
- REPO: process.env.REPO ?? "/Users/anirudh/Documents/assign/frontend",
- QUESTION:
- process.env.QUESTION ??
- "When a user sends a message to an agent in the chat UI, trace the full path end to end: " +
- "which component handles the submit, how the message reaches the backend API, how the optimistic " +
- "update and the polling query stay in sync via the React Query cache key, where the agent is " +
- "resolved from the route, and where a quota/402 billing error is handled. " +
- "List the specific files and functions in order.",
- MODEL: process.env.MODEL ?? "openai/gpt-4o-mini",
- MAX_STEPS: Number(process.env.MAX_STEPS ?? 14), // cap on agent tool-loop round-trips
- SEARCH_MAX_LINES: 60, // cap rows returned per search
- READ_MAX_LINES: 400, // cap lines returned per read_file
- READ_MAX_CHARS: 12_000, // hard char cap per read_file
- // Optional cost estimate: set $ per 1M tokens for your model to see a $ column.
- PRICE_IN_PER_M: Number(process.env.PRICE_IN_PER_M ?? 0),
- PRICE_OUT_PER_M: Number(process.env.PRICE_OUT_PER_M ?? 0),
-};
-// ─────────────────────────────────────────────────────────────────────────────
-
-if (!existsSync(CONFIG.REPO)) {
- console.error(`✗ REPO not found: ${CONFIG.REPO}`);
- process.exit(1);
-}
-
-const model = makeChatModel(CONFIG.MODEL);
-
-interface Metrics {
- arm: string;
- llmCalls: number;
- promptTokens: number;
- completionTokens: number;
- toolCalls: number;
- filesRead: Set<string>;
- ms: number;
- answer: string;
-}
-
-const SYSTEM =
- "You are a senior engineer answering a question about an unfamiliar codebase. " +
- "Be accurate and cite specific files and functions. When you have enough to answer, " +
- "STOP calling tools and write the final answer as prose. Do not pad.";
-
-const TOOLS: ToolSpec[] = [
- {
- name: "search",
- description:
- "Regex search across the repo's source (ripgrep). Returns matching file:line: text rows.",
- parameters: {
- type: "object",
- properties: { pattern: { type: "string", description: "regex or literal to search for" } },
- required: ["pattern"],
- },
- },
- {
- name: "read_file",
- description: "Read a source file (optionally a line range) relative to the repo root.",
- parameters: {
- type: "object",
- properties: {
- path: { type: "string", description: "repo-relative path, e.g. src/components/chat/TaskFeed.tsx" },
- start_line: { type: "number", description: "1-based start line (optional)" },
- end_line: { type: "number", description: "1-based end line (optional)" },
- },
- required: ["path"],
- },
- },
-];
-
-// ── tool implementations (sandboxed to REPO) ────────────────────────────────
-function runSearch(pattern: string): string {
- const args = [
- "--no-heading", "-n", "-S", "--max-count", "40",
- "-g", "*.ts", "-g", "*.tsx", "-g", "!node_modules",
- pattern, CONFIG.REPO,
- ];
- let out = "";
- try {
- out = execFileSync("rg", args, { encoding: "utf8", maxBuffer: 8 << 20 });
- } catch (e: any) {
- // rg exits 1 on "no matches"; also handle rg-not-installed by falling back to grep.
- if (e?.code === "ENOENT") {
- try {
- out = execFileSync(
- "grep",
- ["-rniE", "--include=*.ts", "--include=*.tsx", "--exclude-dir=node_modules", pattern, CONFIG.REPO],
- { encoding: "utf8", maxBuffer: 8 << 20 },
- );
- } catch (g: any) {
- out = g?.stdout?.toString() ?? "";
- }
- } else {
- out = e?.stdout?.toString() ?? "";
- }
- }
- const lines = out.split("\n").filter(Boolean).map((l) => l.replace(CONFIG.REPO + "/", ""));
- if (lines.length === 0) return "(no matches)";
- const clipped = lines.slice(0, CONFIG.SEARCH_MAX_LINES);
- const note = lines.length > clipped.length ? `\n… ${lines.length - clipped.length} more rows omitted` : "";
- return clipped.join("\n") + note;
-}
-
-function runRead(path: string, start?: number, end?: number): { text: string; resolved: string } {
- const abs = isAbsolute(path) ? resolve(path) : resolve(CONFIG.REPO, path);
- const rel = relative(CONFIG.REPO, abs);
- if (rel.startsWith("..") || isAbsolute(rel)) return { text: `(refused: ${path} is outside the repo)`, resolved: rel };
- if (!existsSync(abs)) return { text: `(not found: ${rel})`, resolved: rel };
- let content = readFileSync(abs, "utf8");
- const allLines = content.split("\n");
- let lines = allLines;
- if (start || end) {
- const s = Math.max(1, start ?? 1);
- const e = Math.min(allLines.length, end ?? allLines.length);
- lines = allLines.slice(s - 1, e).map((l, i) => `${s + i}\t${l}`);
- }
- if (lines.length > CONFIG.READ_MAX_LINES) lines = lines.slice(0, CONFIG.READ_MAX_LINES);
- let text = lines.join("\n");
- if (text.length > CONFIG.READ_MAX_CHARS) text = text.slice(0, CONFIG.READ_MAX_CHARS) + "\n… (truncated)";
- return { text, resolved: rel };
-}
-
-// ── the agent loop, shared by both arms ──────────────────────────────────────
-async function runAgent(arm: string, extraContext: string | null): Promise<Metrics> {
- const m: Metrics = {
- arm, llmCalls: 0, promptTokens: 0, completionTokens: 0, toolCalls: 0,
- filesRead: new Set(), ms: 0, answer: "",
- };
- const t0 = Date.now();
-
- const userParts = [`QUESTION:\n${CONFIG.QUESTION}`];
- if (extraContext) {
- userParts.push(
- "\nYou have been given a pre-computed context pack from a code-graph tool below. " +
- "Prefer it; only use the search/read_file tools if it is genuinely insufficient.\n\n" +
- "=== CONTEXT PACK ===\n" + extraContext,
- );
- }
- const messages: Message[] = [
- { role: "system", content: SYSTEM },
- { role: "user", content: userParts.join("\n") },
- ];
-
- for (let step = 0; step < CONFIG.MAX_STEPS; step++) {
- const resp = await model.create({ temperature: 0, maxTokens: 4096, messages, tools: TOOLS });
- m.llmCalls++;
- m.promptTokens += resp.usage.input + resp.usage.cacheRead;
- m.completionTokens += resp.usage.output;
-
- messages.push(resp.assistant);
-
- if (resp.toolCalls.length === 0) {
- m.answer = resp.text || "(empty)";
- break;
- }
-
- for (const call of resp.toolCalls) {
- m.toolCalls++;
- let result = "";
- try {
- const args = (call.args ?? {}) as any;
- if (call.name === "search") {
- result = runSearch(String(args.pattern ?? ""));
- } else if (call.name === "read_file") {
- const r = runRead(String(args.path ?? ""), args.start_line, args.end_line);
- if (existsSync(resolve(CONFIG.REPO, String(args.path ?? "")))) m.filesRead.add(r.resolved);
- result = r.text;
- } else {
- result = `(unknown tool ${call.name})`;
- }
- } catch (e: any) {
- result = `(tool error: ${e?.message ?? e})`;
- }
- messages.push({ role: "tool", toolCallId: call.id, content: result });
- }
- if (step === CONFIG.MAX_STEPS - 1) m.answer = "(hit MAX_STEPS without a final answer)";
- }
-
- m.ms = Date.now() - t0;
- return m;
-}
-
-// ── graft pack for the GRAFT arm ─────────────────────────────────────────────
-function graftPack(): { pack: string; ms: number } {
- const t0 = Date.now();
- if (!existsSync(resolve(CONFIG.REPO, "graft"))) {
- console.error(`✗ no graft/ index in ${CONFIG.REPO}. Run: cd ${CONFIG.REPO} && graft build`);
- process.exit(1);
- }
- const pack = execFileSync("graft", ["ask", CONFIG.QUESTION, CONFIG.REPO, "--source"], {
- encoding: "utf8",
- maxBuffer: 16 << 20,
- });
- return { pack, ms: Date.now() - t0 };
-}
-
-function cost(m: Metrics): string {
- if (!CONFIG.PRICE_IN_PER_M && !CONFIG.PRICE_OUT_PER_M) return "—";
- const c = (m.promptTokens / 1e6) * CONFIG.PRICE_IN_PER_M + (m.completionTokens / 1e6) * CONFIG.PRICE_OUT_PER_M;
- return "$" + c.toFixed(4);
-}
-
-function row(label: string, a: string | number, b: string | number): string {
- return `${label.padEnd(22)} ${String(a).padStart(14)} ${String(b).padStart(14)}`;
-}
-
-async function main() {
- console.log(`\nREPO: ${CONFIG.REPO}`);
- console.log(`MODEL: ${CONFIG.MODEL}`);
- console.log(`QUESTION: ${CONFIG.QUESTION.slice(0, 100)}…\n`);
-
- console.log("→ generating graft pack (graft ask --source)…");
- const { pack, ms: graftMs } = graftPack();
- const packTokEst = Math.round(pack.length / 4); // rough: ~4 chars/token
- console.log(` pack: ${pack.length} chars (~${packTokEst} tok), produced in ${graftMs}ms ($0, local)\n`);
-
- console.log("→ running COLD arm (agent explores the repo itself)…");
- const cold = await runAgent("COLD", null);
- console.log(` done in ${cold.ms}ms, ${cold.llmCalls} LLM calls\n`);
-
- console.log("→ running GRAFT arm (agent handed the pack up front)…");
- const graft = await runAgent("GRAFT", pack);
- console.log(` done in ${graft.ms}ms, ${graft.llmCalls} LLM calls\n`);
-
- const totC = cold.promptTokens + cold.completionTokens;
- const totG = graft.promptTokens + graft.completionTokens;
- const pct = (a: number, b: number) => (a === 0 ? "—" : `${Math.round((1 - b / a) * 100)}%`);
-
- console.log("═".repeat(54));
- console.log(row("metric", "COLD", "GRAFT"));
- console.log("─".repeat(54));
- console.log(row("prompt tokens", cold.promptTokens, graft.promptTokens));
- console.log(row("completion tokens", cold.completionTokens, graft.completionTokens));
- console.log(row("TOTAL tokens", totC, totG));
- console.log(row("LLM round-trips", cold.llmCalls, graft.llmCalls));
- console.log(row("tool calls", cold.toolCalls, graft.toolCalls));
- console.log(row("files opened", cold.filesRead.size, graft.filesRead.size));
- console.log(row("wall-clock (ms)", cold.ms, graft.ms));
- console.log(row("est. cost", cost(cold), cost(graft)));
- console.log("─".repeat(54));
- console.log(`token saving with graft: ${pct(totC, totG)} (COLD→GRAFT)`);
- console.log("═".repeat(54));
-
- console.log("\n──────── COLD answer ────────\n" + cold.answer);
- console.log("\n──────── GRAFT answer ────────\n" + graft.answer);
- console.log("\n(Judge the two answers yourself — the point is equal quality at fewer tokens.)");
-}
-
-main().catch((e) => {
- console.error(e);
- process.exit(1);
-});
diff --git a/docs/index.html b/docs/index.html
index 0eee8fef..79f03073 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Context Graph — read the graph before you work</title>
-<meta name="description" content="Point it at a repo and it builds a context graph — a folder of linked markdown files that lives in the repo and stays in sync with the code through git. Agents that read it first use 31% fewer tool calls." />
+<meta name="description" content="Point it at a repo and it builds a context graph — a folder of linked markdown files, built locally in one command and kept fresh as the code changes. Agents that read it first use 31% fewer tool calls." />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:opsz,[email protected],300;9..40,400;9..40,500&family=DM+Mono:wght@400;500&display=swap" rel="stylesheet" />
@@ -235,8 +235,8 @@
<h1><em>31%</em> fewer tool calls. <em>23%</em> less cost. <em>17%</em> lower latency.</h1>
<p class="hero-sub">
That's what your agent gets from reading the repo's context graph before it works.
- The graph is a folder of plain markdown files in the repo, kept in sync with the code
- through git — so <b>anyone who clones the repo has it, no setup.</b>
+ The graph is a folder of plain markdown files, built from your code in one command and
+ kept fresh as you work — <b>no server, no database, no keys.</b>
</p>
<div class="hero-actions">
<button class="cmd" id="copy-cmd" type="button" aria-label="Copy command">
@@ -247,7 +247,7 @@
<a class="btn" href="https://github.com/NanoNets/context-graph-engine">View source</a>
</div>
<p class="hero-note">
- No database, no server, no embeddings — just files in git.
+ No database, no server, no embeddings — just files, built locally.
<a href="#quickstart">Set it up in about a minute</a>.
</p>
</div>
@@ -259,7 +259,7 @@
<span class="corner bl"></span><span class="corner br"></span>
<div class="panel-head">
<span>graft/ — 41 entities</span>
- <span class="live"><i></i>tracked in git</span>
+ <span class="live"><i></i>local · git-ignored</span>
</div>
<div class="fg-body">
<span class="muted">graft/</span><br />
@@ -277,7 +277,7 @@
</div>
<div class="panel-foot">
<span>the files are nodes, the links are edges</span>
- <span class="add" id="diff">billing.md changed in the same PR as the code</span>
+ <span class="add" id="diff">billing.md rebuilt when the code changed</span>
</div>
</div>
</div>
@@ -287,9 +287,9 @@
<section id="how" class="section-pad">
<div class="wrap">
<p class="kicker">How it works</p>
- <h2>Push builds it. Clone pulls it. Your agent reads it.</h2>
+ <h2>Build it. It rides along. Your agent reads it.</h2>
<p class="section-sub">
- No pipelines, no server to run. The graph is files in the repo, so git does the syncing.
+ No pipelines, no server to run. The graph is a local cache that rebuilds itself; commit the <code>.claude/</code> wiring and every teammate's agent picks it up.
</p>
<div class="steps">
<div class="step">
@@ -300,9 +300,9 @@
</div>
<div class="step">
<p class="n">02</p>
- <h3>Commit it</h3>
- <p>The graph is just files in git, so git is the sync. Anyone who clones has it, and CI keeps it fresh — you see the graph diff next to the code, in the same PR.</p>
- <div class="art">$ git add graft<br /><b>auth-service.md</b> <span class="hl">+3 −1</span> · alongside the code</div>
+ <h3>It rides along</h3>
+ <p>The graph is a local, git-ignored cache — <code>graft build</code> adds it to <code>.gitignore</code> for you. Commit the <code>.claude/</code> wiring instead; every teammate runs <code>graft build</code> for their own, and it rebuilds in the background as the code changes.</p>
+ <div class="art">$ git add .claude<br /><b>graft/</b> <span class="hl">git-ignored</span> · rebuilt locally</div>
</div>
<div class="step">
<p class="n">03</p>
@@ -350,10 +350,10 @@
<span class="corner tl"></span><span class="corner tr"></span>
<span class="corner bl"></span><span class="corner br"></span>
<pre><span class="c"># in your repo</span>
-<span class="hl">graft build --deep</span> <span class="c"># builds graft/ from your code</span>
-git add graft &amp;&amp; git commit
+<span class="hl">graft build --deep</span> <span class="c"># builds graft/ (git-ignored, local)</span>
+git add .claude &amp;&amp; git commit <span class="c"># share the wiring; teammates build their own</span>
-<span class="c"># keep it honest — fails CI if the graph is stale</span>
+<span class="c"># keep it fresh — reports drift since your last build</span>
<span class="hl">graft check</span></pre>
</div>
<p class="quick-note">
diff --git a/docs/superpowers/plans/2026-07-15-graft-viz.md b/docs/superpowers/plans/2026-07-15-graft-viz.md
deleted file mode 100644
index de66746b..00000000
--- a/docs/superpowers/plans/2026-07-15-graft-viz.md
+++ /dev/null
@@ -1,110 +0,0 @@
-# graft viz Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** Ship `graft viz` — a local interactive visualizer for both Graft graphs, with semantic edges per the approved spec.
-
-**Architecture:** A zero-runtime-dep `node:http` server (`src/viz/serve.ts`) exposes the assembled context graph (`src/viz/assemble.ts`), the raw `graph.json`, and an SSE reload channel; a prebuilt vanilla-TS viewer (`viewer/` → `dist/viewer/` via esbuild) renders tabs (Context/Code/Outline), a d3-force graph with the semantic edge grammar, detail panel, search, and themes. Spec: `docs/superpowers/specs/2026-07-15-graft-viz-design.md`. Visual reference of record: the approved mockup (artifact "graft viz — design & mockup").
-
-**Tech Stack:** TypeScript ESM (Node ≥ 20), commander, gray-matter (already deps); new devDeps: `esbuild`, `d3-force` (+ `@types/d3-force`) — bundled into the viewer, never a runtime dep.
-
-## Global Constraints
-
-- Node >= 20, ESM (`"type": "module"`), strict TS — match existing `tsconfig.json`
-- No new **runtime** dependencies (server uses `node:http`, `node:fs`, `node:path`, `node:child_process` only)
-- Relation enum (engine + viewer normalization): `part_of, uses, depends_on, produces, configures, validates, implements` — legacy mapping `influences→configures`; `supports|defines|measures→validates`
-- Tests: node built-in runner via `npm test` (`node --import tsx --test test/*.test.ts`)
-- Byte-stable outputs where applicable; no timestamps in generated JSON
-- Commit after each task; branch `feat/graft-viz`
-
----
-
-### Task 1: Graph assembly (`assemble.ts`) — TDD
-
-**Files:**
-- Create: `src/viz/assemble.ts`
-- Create: `test/viz-assemble.test.ts`
-- Create: `test/fixtures/viz-context/{alpha.md, beta.md, broken.md, manifest.json}`
-
-**Interfaces:**
-- Produces: `assembleContextGraph(contextDir: string): VizGraph` where
- `VizGraph = { meta: { nodeCount: number; edgeCount: number; skippedFiles: number; droppedEdges: number }, nodes: VizNode[], edges: VizEdge[] }`,
- `VizNode = { id: string; name: string; type: string; summary: string; sources: string[] }`,
- `VizEdge = { source: string; target: string; relation: string; description?: string }`
-- Also exports `NORMALIZE_RELATION: Record<string,string>` and `normalizeRelation(rel: string): string`
-
-- [ ] **Step 1: Write fixtures + failing tests** — fixture `alpha.md` links to `beta` (`relation: influences`) and to missing `gamma`; `broken.md` has invalid YAML. Tests assert: 2 nodes; 1 edge normalized to `configures`; `droppedEdges === 1`; `skippedFiles === 1`; summary extracted from generated block.
-- [ ] **Step 2: Run** `npm test -- test/viz-assemble.test.ts` → FAIL (module not found)
-- [ ] **Step 3: Implement** — read `*.md` (excluding non-node files) with gray-matter; node id = slug (fallback: filename); summary = body text inside `<!-- context:generated:start/end -->` stripped of `## Summary`/`## Related` headings, first 500 chars; edges from `links[]`; drop dangling; normalize relations.
-- [ ] **Step 4: Run tests** → PASS
-- [ ] **Step 5: Commit** `feat(viz): assemble context graph JSON from .context markdown`
-
-### Task 2: Server (`serve.ts`) — TDD
-
-**Files:**
-- Create: `src/viz/serve.ts`
-- Create: `test/viz-serve.test.ts`
-
-**Interfaces:**
-- Consumes: `assembleContextGraph`
-- Produces: `startVizServer(opts: { contextDir: string; viewerDir: string; port: number; repoName: string }): Promise<{ url: string; close(): Promise<void> }>` — tries `port..port+10`; routes: `GET /` `/app.js` `/style.css` (static from viewerDir), `GET /api/context-graph` (assembled JSON + `repoName` in meta), `GET /api/code-graph` (`graph.json` passthrough if `meta.version === 1`, else 404 `{error}`), `GET /events` (SSE, `fs.watch` on contextDir debounced 300 ms → `data: change\n\n`)
-
-- [ ] **Step 1: Failing tests** — start on port 0-ish random base against fixtures dir + temp viewer dir with stub `index.html`; assert context-graph shape, code-graph 404 without file and 200 with valid fixture `graph.json`, port fallback (occupy base port first), SSE emits on file touch.
-- [ ] **Step 2: Run** → FAIL
-- [ ] **Step 3: Implement** (no runtime deps; content-types html/js/css/json; SSE keeps sockets, closes cleanly)
-- [ ] **Step 4: Run tests** → PASS
-- [ ] **Step 5: Commit** `feat(viz): local http server with SSE live reload`
-
-### Task 3: Viewer
-
-**Files:**
-- Create: `viewer/index.html`, `viewer/style.css`, `viewer/main.ts`, `viewer/graph.ts`, `viewer/tree.ts`, `viewer/detail.ts`, `viewer/data.ts`
-- Create: `scripts/build-viewer.mjs` (esbuild: bundle `main.ts` → `dist/viewer/app.js`, copy html/css)
-- Modify: `package.json` (devDeps `esbuild`, `d3-force`, `@types/d3-force`; `"build": "tsc -p tsconfig.json && node scripts/build-viewer.mjs"`; add `dist/viewer` to published files if a `files` field exists)
-
-**Interfaces:**
-- Consumes: `/api/context-graph`, `/api/code-graph`, `/events` from Task 2
-- Produces: `dist/viewer/{index.html, app.js, style.css}`
-
-- [ ] **Step 1: Port the approved mockup** (visual reference of record; local working copy at the session scratchpad `graft-viz-design.html`) into modules, replacing the hand-rolled sim with `d3-force` (`forceSimulation`, `forceManyBody`, `forceLink` with per-family `distance` [part_of 85 / uses-family 145 / contract 150 / association 185], `forceCenter`, `forceCollide`) and persistent SVG elements (create once, update `transform`/`d` per tick — no rebuild). Keep verbatim: token palette & both themes, tabs, semantic edge grammar (form per family, chevron/hollow/filled markers), verb chips with counts + hints, focus mode (amber out / teal in + labels only on focused edges), detail panel (Depends on / Depended on by), outline tree, search (Enter zooms), theme toggle, zoom/pan/drag. Add: SSE refetch that preserves positions by node id; empty states ("run `graft init`" / "run `graft graph`"); `references` chip hint "mentioned but never called"; inferred-confidence edges render dashed.
-- [ ] **Step 2: Build** `node scripts/build-viewer.mjs` → `dist/viewer/*` exists, `app.js` < 150 kB
-- [ ] **Step 3: Manual smoke** — serve fixtures via Task 2 server, check tabs/selection/chips in browser
-- [ ] **Step 4: Commit** `feat(viz): viewer app (semantic edges, focus mode, outline, themes)`
-
-### Task 4: CLI wiring
-
-**Files:**
-- Modify: `src/cli.ts` (add `viz` command), `src/index.ts` (export viz types)
-
-**Interfaces:**
-- Consumes: `startVizServer`
-- Produces: `graft viz [dir] --port <n> --no-open`; viewerDir resolved relative to compiled module (`new URL("../viewer/", import.meta.url)` from `dist/`); browser open via `open`/`xdg-open`/`start` spawn, skipped with `--no-open`; exit 1 + guidance when context dir missing
-
-- [ ] **Step 1: Implement command** (commander, matching existing `init`/`graph`/`check` style and `--dir` global)
-- [ ] **Step 2: Verify** `npm run cli -- viz . --no-open` prints URL; curl endpoints respond
-- [ ] **Step 3: Commit** `feat(cli): graft viz command`
-
-### Task 5: Engine — closed relation enum
-
-**Files:**
-- Modify: `src/ai/synthesize.ts` (tool schema `relation` → `enum: ["part_of","uses","depends_on","produces","configures","validates","implements"]`; prompt text lists the verbs with their reviewer-questions)
-- Test: extend `test/viz-assemble.test.ts` with normalization table cases
-
-- [ ] **Step 1: Failing test** for `normalizeRelation` full table (influences→configures; supports/defines/measures→validates; known verbs pass through)
-- [ ] **Step 2: Run** → FAIL, **Step 3: implement enum + prompt edit**, **Step 4: tests PASS**
-- [ ] **Step 5: Commit** `feat(engine): closed relation vocabulary for synthesized links`
-
-### Task 6: End-to-end + docs
-
-**Files:**
-- Modify: `README.md` (viz section: command, screenshot placeholder-free description, verb vocabulary table)
-
-- [ ] **Step 1:** `npm run build && npm test` → all green
-- [ ] **Step 2:** `node dist/cli.js viz . --no-open` against this repo's real `.context/`; browser-verify against the design reference (chips: part of 2 · uses 2 · configures 1 · produces 1 · validates 2 after normalization)
-- [ ] **Step 3:** Commit `docs: README section for graft viz`
-
-## Self-Review
-
-- Spec coverage: tabs/delivery/interactions (T3–T4), semantic edges + vocabulary (T1, T3, T5), scale items 3–5 (T3; 1–2 explicitly v2 in spec), error handling (T1, T2, T4), testing (T1, T2, T6). ✔
-- No placeholders: viewer task consumes an existing concrete source file (the approved mockup) rather than pseudo-code. ✔
-- Type consistency: `VizGraph/VizNode/VizEdge` defined once in Task 1 and consumed by name in Tasks 2–3. ✔
diff --git a/docs/superpowers/plans/2026-07-20-graft-claude-code-integration.md b/docs/superpowers/plans/2026-07-20-graft-claude-code-integration.md
deleted file mode 100644
index 27ef15d1..00000000
--- a/docs/superpowers/plans/2026-07-20-graft-claude-code-integration.md
+++ /dev/null
@@ -1,1215 +0,0 @@
-# Graft × Claude Code Integration Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** Ship a `.claude/` integration that makes Graft visible (a live statusline) and active (retrieval, orientation, blast-radius) inside a Claude Code session, and keeps the graph fresh via turn-end auto-sync.
-
-**Architecture:** Reader/writer/state split. Testable logic lives in `src/claude/*.ts` (compiled to `dist/claude/`); thin `.claude/helpers/*.cjs` shims invoke it. A pure `statusline` reader renders from small precomputed state files (`graft/.cache/stats.json`) plus Claude Code's stdin; `hooks` fire on real events (edit, prompt, session-start, stop) to write state and inject context; a detached `sync-run` rebuilds the graph in the background under a lock.
-
-**Tech Stack:** Node 20+ (ESM), TypeScript (strict), `node:test` + `node:assert/strict`, `tsx`. No new dependencies. Graft CLI (`node dist/cli.js`) invoked as a child process for `ask` / `check` / `build`.
-
-## Global Constraints
-
-- **Money guard (hard rule):** auto-sync and every hook run **only** plain `graft build` / `graft ask` / `graft check`. **Never** `graft build --deep` (spends OpenRouter credits). Copied verbatim from spec §7.
-- **Honest data only:** never display `$` cost or a "tokens saved %". Only real (on-disk / stdin) or instrumented-then-real signals. (spec §2, §5)
-- **`enrichedPct` visibility:** show the enriched segment **only when `readyCount ≥ 1`**; hide entirely for a structural-only graph. (spec §5, §13.1)
-- **`graftReads`/`sourceReads`:** present as **reserved fields** in `SessionState` (schema ready, default 0), **not displayed** and **not yet populated** — population lands with the deferred PreToolUse read-counter (spec §3). Do not add a counter hook in this plan. (spec §13.2)
-- **Statusline is a pure reader:** it must read only small files + stdin and spawn **no** subprocess. (spec §5)
-- **All hooks are best-effort:** any failure logs/degrades and exits 0; never throw out of a hook. (spec §10)
-- **Node ESM:** `src/` is `"type": "module"`; import paths use `.js` extensions. `.cjs` shims load ESM via dynamic `import()`.
-- **State location:** all mutable state under `graft/.cache/` (gitignored). (spec §2, §4)
-- **Ignore edits under `graft/`** — they never set dirty and never trigger sync (avoid loops). (spec §7)
-
----
-
-## File Structure
-
-**Created (committed):**
-- `src/claude/state.ts` — types (`Stats`, `SessionState`), paths, atomic read/write, lock.
-- `src/claude/stats.ts` — `readWiring`, `computeStats`.
-- `src/claude/format.ts` — pure renderers/formatters (statusline, blast-radius, retrieval, orientation).
-- `src/claude/statusline.ts` — statusline entry (`main`).
-- `src/claude/hooks.ts` — hook dispatcher (`main(event)`).
-- `src/claude/sync-run.ts` — detached background sync runner.
-- `.claude/helpers/graft-statusline.cjs` — statusline shim.
-- `.claude/helpers/graft-hooks.cjs` — hooks shim.
-- `.claude/settings.json` — wires statusLine, subagentStatusLine, hooks, footerLinksRegexes.
-- `test/claude-state.test.ts`, `test/claude-stats.test.ts`, `test/claude-format.test.ts`, `test/claude-hooks.test.ts` — tests.
-
-**Modified:** none in `src/` proper; `tsconfig.json` only if it doesn't already include `src/claude` (it includes `src`, so no change expected — a build step verifies `dist/claude/` appears).
-
-**State (gitignored, runtime):** `graft/.cache/stats.json`, `graft/.cache/session/<id>.json`, `graft/.cache/.sync.lock`.
-
----
-
-## Task 1: State module (types, storage, lock)
-
-**Files:**
-- Create: `src/claude/state.ts`
-- Test: `test/claude-state.test.ts`
-
-**Interfaces:**
-- Produces:
- - `interface Stats { nodeCount:number; edgeCount:number; languages:string[]; totalCount:number; readyCount:number; staleCount:number; dirty:boolean; syncing:boolean; syncedAt:string|null; lastFile:string|null }`
- - `interface SessionState { lastQuery:string|null; perAgentQuery:Record<string,string>; graftReads:number; sourceReads:number }`
- - `emptyStats(): Stats`
- - `cacheDir(projectDir:string): string`
- - `readStats(dir:string): Stats|null`
- - `writeStats(dir:string, s:Stats): void`
- - `patchStats(dir:string, patch:Partial<Stats>): Stats`
- - `readSession(dir:string, id:string): SessionState`
- - `writeSession(dir:string, id:string, s:SessionState): void`
- - `acquireLock(dir:string): boolean`
- - `releaseLock(dir:string): void`
- - `const LOCK_STALE_MS = 300000`
-
-- [ ] **Step 1: Write the failing test**
-
-```ts
-// test/claude-state.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { mkdtempSync, existsSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import {
- emptyStats, readStats, writeStats, patchStats,
- readSession, writeSession, acquireLock, releaseLock, cacheDir,
-} from '../src/claude/state.js';
-
-function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-state-')); }
-
-test('stats round-trip and patch merge', () => {
- const d = fresh();
- assert.equal(readStats(d), null);
- writeStats(d, { ...emptyStats(), nodeCount: 319, edgeCount: 730 });
- assert.equal(readStats(d)!.nodeCount, 319);
- const patched = patchStats(d, { dirty: true, staleCount: 4 });
- assert.equal(patched.dirty, true);
- assert.equal(patched.staleCount, 4);
- assert.equal(readStats(d)!.edgeCount, 730, 'patch preserves other fields');
-});
-
-test('session defaults and round-trip', () => {
- const d = fresh();
- const s = readSession(d, 'abc');
- assert.deepEqual(s, { lastQuery: null, perAgentQuery: {}, graftReads: 0, sourceReads: 0 });
- s.lastQuery = 'pkce'; s.graftReads = 2;
- writeSession(d, 'abc', s);
- assert.equal(readSession(d, 'abc').lastQuery, 'pkce');
- assert.equal(readSession(d, 'xyz').graftReads, 0, 'other sessions isolated');
-});
-
-test('lock is exclusive then releasable', () => {
- const d = fresh();
- assert.equal(acquireLock(d), true);
- assert.equal(acquireLock(d), false, 'second acquire blocked while held');
- assert.ok(existsSync(join(cacheDir(d), '.sync.lock')));
- releaseLock(d);
- assert.equal(acquireLock(d), true, 'reacquire after release');
-});
-```
-
-- [ ] **Step 2: Run test to verify it fails**
-
-Run: `npm test -- test/claude-state.test.ts` (or `node --import tsx --test test/claude-state.test.ts`)
-Expected: FAIL — `Cannot find module '../src/claude/state.js'`.
-
-- [ ] **Step 3: Write minimal implementation**
-
-```ts
-// src/claude/state.ts
-import { readFileSync, writeFileSync, mkdirSync, existsSync, renameSync, rmSync, statSync } from 'node:fs';
-import { join } from 'node:path';
-
-export interface Stats {
- nodeCount: number; edgeCount: number; languages: string[];
- totalCount: number; readyCount: number;
- staleCount: number; dirty: boolean; syncing: boolean;
- syncedAt: string | null; lastFile: string | null;
-}
-export interface SessionState {
- lastQuery: string | null;
- perAgentQuery: Record<string, string>;
- graftReads: number; sourceReads: number;
-}
-
-export const LOCK_STALE_MS = 300000;
-
-export function emptyStats(): Stats {
- return { nodeCount: 0, edgeCount: 0, languages: [], totalCount: 0, readyCount: 0,
- staleCount: 0, dirty: false, syncing: false, syncedAt: null, lastFile: null };
-}
-function emptySession(): SessionState {
- return { lastQuery: null, perAgentQuery: {}, graftReads: 0, sourceReads: 0 };
-}
-
-export function cacheDir(projectDir: string): string { return join(projectDir, 'graft', '.cache'); }
-function statsPath(d: string): string { return join(cacheDir(d), 'stats.json'); }
-function sessionPath(d: string, id: string): string { return join(cacheDir(d), 'session', `${id}.json`); }
-function lockPath(d: string): string { return join(cacheDir(d), '.sync.lock'); }
-
-function readJson<T>(p: string): T | null {
- try { return JSON.parse(readFileSync(p, 'utf8')) as T; } catch { return null; }
-}
-function writeJsonAtomic(p: string, value: unknown): void {
- mkdirSync(join(p, '..'), { recursive: true });
- const tmp = `${p}.${process.pid}.tmp`;
- writeFileSync(tmp, JSON.stringify(value, null, 2));
- renameSync(tmp, p);
-}
-
-export function readStats(d: string): Stats | null { return readJson<Stats>(statsPath(d)); }
-export function writeStats(d: string, s: Stats): void { writeJsonAtomic(statsPath(d), s); }
-export function patchStats(d: string, patch: Partial<Stats>): Stats {
- const next: Stats = { ...(readStats(d) ?? emptyStats()), ...patch };
- writeStats(d, next);
- return next;
-}
-export function readSession(d: string, id: string): SessionState {
- return readJson<SessionState>(sessionPath(d, id)) ?? emptySession();
-}
-export function writeSession(d: string, id: string, s: SessionState): void {
- writeJsonAtomic(sessionPath(d, id), s);
-}
-
-export function acquireLock(d: string): boolean {
- const p = lockPath(d);
- if (existsSync(p) && Date.now() - statSync(p).mtimeMs < LOCK_STALE_MS) return false;
- mkdirSync(cacheDir(d), { recursive: true });
- writeFileSync(p, JSON.stringify({ pid: process.pid, at: new Date().toISOString() }));
- return true;
-}
-export function releaseLock(d: string): void { try { rmSync(lockPath(d)); } catch { /* already gone */ } }
-```
-
-- [ ] **Step 4: Run test to verify it passes**
-
-Run: `node --import tsx --test test/claude-state.test.ts`
-Expected: PASS (3 tests).
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/claude/state.ts test/claude-state.test.ts
-git commit -m "feat(claude): state module — stats/session storage + sync lock"
-```
-
----
-
-## Task 2: Stats computation from wiring.json
-
-**Files:**
-- Create: `src/claude/stats.ts`
-- Test: `test/claude-stats.test.ts`
-
-**Interfaces:**
-- Consumes: `Stats` from `state.ts`; `GraphV1` from `src/graph/types.ts`.
-- Produces:
- - `readWiring(projectDir:string): GraphV1|null`
- - `computeStats(w:GraphV1): Pick<Stats,'nodeCount'|'edgeCount'|'languages'|'totalCount'|'readyCount'>`
-
-- [ ] **Step 1: Write the failing test**
-
-```ts
-// test/claude-stats.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { computeStats } from '../src/claude/stats.js';
-
-const wiring = {
- meta: { version: 1, nodeCount: 3, edgeCount: 2, languages: ['typescript'] },
- nodes: [
- { id: 'a', summary_state: 'ready' },
- { id: 'b', summary_state: 'pending' },
- { id: 'c', summary_state: 'ready' },
- ],
- edges: [{ from: 'a', to: 'b' }, { from: 'c', to: 'a' }],
-} as any;
-
-test('computeStats derives counts and readyCount', () => {
- const s = computeStats(wiring);
- assert.equal(s.nodeCount, 3);
- assert.equal(s.edgeCount, 2);
- assert.deepEqual(s.languages, ['typescript']);
- assert.equal(s.totalCount, 3);
- assert.equal(s.readyCount, 2);
-});
-
-test('computeStats tolerates missing meta by counting arrays', () => {
- const s = computeStats({ nodes: [{ id: 'x', summary_state: 'pending' }], edges: [] } as any);
- assert.equal(s.nodeCount, 1);
- assert.equal(s.edgeCount, 0);
- assert.equal(s.readyCount, 0);
-});
-```
-
-- [ ] **Step 2: Run test to verify it fails**
-
-Run: `node --import tsx --test test/claude-stats.test.ts`
-Expected: FAIL — cannot find `../src/claude/stats.js`.
-
-- [ ] **Step 3: Write minimal implementation**
-
-```ts
-// src/claude/stats.ts
-import { readFileSync } from 'node:fs';
-import { join } from 'node:path';
-import type { GraphV1 } from '../graph/types.js';
-import type { Stats } from './state.js';
-
-export function readWiring(projectDir: string): GraphV1 | null {
- try {
- return JSON.parse(readFileSync(join(projectDir, 'graft', '.graph', 'wiring.json'), 'utf8')) as GraphV1;
- } catch { return null; }
-}
-
-export function computeStats(
- w: GraphV1,
-): Pick<Stats, 'nodeCount' | 'edgeCount' | 'languages' | 'totalCount' | 'readyCount'> {
- const nodes = w.nodes ?? [];
- const edges = w.edges ?? [];
- const readyCount = nodes.filter((n) => n.summary_state === 'ready').length;
- return {
- nodeCount: w.meta?.nodeCount ?? nodes.length,
- edgeCount: w.meta?.edgeCount ?? edges.length,
- languages: w.meta?.languages ?? [],
- totalCount: nodes.length,
- readyCount,
- };
-}
-```
-
-> If `tsc` reports that `GraphV1` lacks `nodes`/`edges`/`meta` or `NodeV1` lacks `summary_state`, open `src/graph/types.ts` and use the exact exported names (spec §2 lists them: `meta.{nodeCount,edgeCount,languages}`, node `summary_state`). Adjust the property access to match; do not redefine the types.
-
-- [ ] **Step 4: Run test to verify it passes**
-
-Run: `node --import tsx --test test/claude-stats.test.ts`
-Expected: PASS (2 tests).
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/claude/stats.ts test/claude-stats.test.ts
-git commit -m "feat(claude): computeStats + readWiring"
-```
-
----
-
-## Task 3: Statusline renderer + shim + settings (the visible bar)
-
-**Files:**
-- Create: `src/claude/format.ts`, `src/claude/statusline.ts`, `.claude/helpers/graft-statusline.cjs`, `.claude/settings.json`
-- Test: `test/claude-format.test.ts`
-
-**Interfaces:**
-- Consumes: `Stats`, `SessionState` from `state.ts`; `readStats`, `readSession`.
-- Produces (in `format.ts`):
- - `renderStatusline(stats:Stats|null, session:SessionState|null, ctx:{ctxPct:number|null}): string[]`
- - `enrichedSegment(s:Stats): string|null`
- - `freshnessSegment(s:Stats): string`
-- Produces (in `statusline.ts`): `main(): void`
-
-- [ ] **Step 1: Write the failing test** (assert on plain text — strip ANSI)
-
-```ts
-// test/claude-format.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { renderStatusline, enrichedSegment } from '../src/claude/format.js';
-import { emptyStats } from '../src/claude/state.js';
-
-const strip = (s: string) => s.replace(/\x1b\[[0-9;]*m/g, '');
-
-test('not-built state', () => {
- const lines = renderStatusline(null, null, { ctxPct: null });
- assert.match(strip(lines[0]), /not built/);
-});
-
-test('enriched segment hidden when zero ready', () => {
- assert.equal(enrichedSegment({ ...emptyStats(), totalCount: 10, readyCount: 0 }), null);
-});
-
-test('enriched segment shown when >=1 ready', () => {
- const seg = enrichedSegment({ ...emptyStats(), totalCount: 4, readyCount: 2 });
- assert.equal(strip(seg!), '50% enriched');
-});
-
-test('two-line bar: size + freshness + ctx + last', () => {
- const stats = { ...emptyStats(), nodeCount: 319, edgeCount: 730, totalCount: 319, readyCount: 0,
- dirty: true, staleCount: 4, lastFile: 'pkce.ts' };
- const lines = renderStatusline(stats, null, { ctxPct: 34 }).map(strip);
- assert.match(lines[0], /graft/);
- assert.match(lines[0], /319 nodes \/ 730 edges/);
- assert.doesNotMatch(lines[0], /enriched/); // hidden at readyCount 0
- assert.match(lines[0], /⚠ 4 stale/);
- assert.match(lines[1], /ctx 34%/);
- assert.match(lines[1], /last: pkce\.ts/);
-});
-
-test('syncing overrides stale; synced when clean', () => {
- const base = { ...emptyStats(), nodeCount: 1, edgeCount: 0, totalCount: 1 };
- assert.match(strip(renderStatusline({ ...base, syncing: true, dirty: true }, null, { ctxPct: null })[0]), /syncing/);
- assert.match(strip(renderStatusline(base, null, { ctxPct: null })[0]), /✓ synced/);
-});
-```
-
-- [ ] **Step 2: Run test to verify it fails**
-
-Run: `node --import tsx --test test/claude-format.test.ts`
-Expected: FAIL — cannot find `../src/claude/format.js`.
-
-- [ ] **Step 3: Write `format.ts` (statusline parts only for now)**
-
-```ts
-// src/claude/format.ts
-import { basename } from 'node:path';
-import type { Stats, SessionState } from './state.js';
-
-const C = {
- indigo: (s: string) => `\x1b[38;2;84;111;255m${s}\x1b[0m`,
- amber: (s: string) => `\x1b[38;2;224;165;68m${s}\x1b[0m`,
- muted: (s: string) => `\x1b[38;5;244m${s}\x1b[0m`,
- text: (s: string) => `\x1b[38;5;251m${s}\x1b[0m`,
-};
-const SEP = C.muted(' · ');
-
-export function enrichedSegment(s: Stats): string | null {
- if (s.readyCount < 1) return null;
- const pct = s.totalCount ? Math.round((s.readyCount / s.totalCount) * 100) : 0;
- return C.indigo(`${pct}% enriched`);
-}
-
-export function freshnessSegment(s: Stats): string {
- if (s.syncing) return C.amber('syncing…');
- if (s.dirty && s.staleCount > 0) return C.amber(`⚠ ${s.staleCount} stale`);
- if (s.dirty) return C.amber('⚠ stale');
- return C.indigo('✓ synced');
-}
-
-export function renderStatusline(
- stats: Stats | null,
- _session: SessionState | null,
- ctx: { ctxPct: number | null },
-): string[] {
- if (!stats || stats.nodeCount === 0) {
- return [C.muted('◤ graft · not built · run ') + C.text('graft build')];
- }
- const top = [C.muted('◤ ') + C.indigo('graft'), C.text(`${stats.nodeCount} nodes / ${stats.edgeCount} edges`)];
- const enr = enrichedSegment(stats);
- if (enr) top.push(enr);
- top.push(freshnessSegment(stats));
-
- const bottom: string[] = [];
- if (typeof ctx.ctxPct === 'number') bottom.push(C.text(`ctx ${ctx.ctxPct}%`));
- if (stats.lastFile) bottom.push(C.muted('last: ') + C.text(basename(stats.lastFile)));
-
- const lines = [top.join(SEP)];
- if (bottom.length) lines.push(C.muted('▸ ') + bottom.join(SEP));
- return lines;
-}
-```
-
-- [ ] **Step 4: Run test to verify it passes**
-
-Run: `node --import tsx --test test/claude-format.test.ts`
-Expected: PASS (5 tests).
-
-- [ ] **Step 5: Write the statusline entry**
-
-```ts
-// src/claude/statusline.ts
-import { readFileSync } from 'node:fs';
-import { renderStatusline } from './format.js';
-import { readStats, readSession } from './state.js';
-
-export function main(): void {
- let input: any = {};
- try { input = JSON.parse(readFileSync(0, 'utf8')); } catch { /* no/invalid stdin */ }
- const dir = process.env.CLAUDE_PROJECT_DIR || input.cwd || process.cwd();
- const stats = readStats(dir);
- const session = readSession(dir, input.session_id || 'default');
- const raw = input?.context_window?.used_percentage;
- const ctxPct = typeof raw === 'number' ? Math.round(raw) : null;
- process.stdout.write(renderStatusline(stats, session, { ctxPct }).join('\n'));
-}
-```
-
-- [ ] **Step 6: Write the shim**
-
-```js
-// .claude/helpers/graft-statusline.cjs
-#!/usr/bin/env node
-const path = require('path');
-const dir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
-import(path.join(dir, 'dist', 'claude', 'statusline.js'))
- .then((m) => m.main())
- .catch(() => { /* graft not built or unavailable — render nothing */ });
-```
-
-- [ ] **Step 7: Write `.claude/settings.json`**
-
-```json
-{
- "statusLine": {
- "type": "command",
- "command": "node \"${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-statusline.cjs\""
- }
-}
-```
-
-- [ ] **Step 8: Build and smoke-test the shim end-to-end**
-
-```bash
-npm run build
-echo '{"session_id":"t","cwd":"'"$PWD"'","context_window":{"used_percentage":34}}' \
- | node .claude/helpers/graft-statusline.cjs
-```
-Expected: a line like `◤ graft · 319 nodes / 730 edges · ✓ synced` then `▸ ctx 34%` (no `stats.json` yet → falls back to "not built"; that's fine — after Task 5 a real build populates it. To see the full bar now, run: `node -e "const{writeStats,emptyStats}=require('./dist/claude/state.js');writeStats(process.cwd(),{...emptyStats(),nodeCount:319,edgeCount:730,totalCount:319})"` then re-run the pipe).
-
-> `require('./dist/claude/state.js')` in that one-liner works because Node 20+ allows `require()` of ESM without top-level await.
-
-- [ ] **Step 9: Commit**
-
-```bash
-git add src/claude/format.ts src/claude/statusline.ts test/claude-format.test.ts \
- .claude/helpers/graft-statusline.cjs .claude/settings.json
-git commit -m "feat(claude): statusline reader + shim + settings"
-```
-
----
-
-## Task 4: Post-edit hook — drift flag + blast-radius injection
-
-**Files:**
-- Modify: `src/claude/format.ts` (add `incomingEdges`, `formatBlastRadius`)
-- Create: `src/claude/hooks.ts`, `.claude/helpers/graft-hooks.cjs`
-- Modify: `.claude/settings.json` (add `PostToolUse`)
-- Test: `test/claude-format.test.ts` (add cases), `test/claude-hooks.test.ts`
-
-**Interfaces:**
-- Consumes: `readWiring` (stats.ts); `patchStats` (state.ts); `GraphV1`, `EdgeV1` (src/graph/types.ts).
-- Produces (format.ts): `incomingEdges(w:GraphV1, filePath:string): EdgeV1[]`; `formatBlastRadius(w:GraphV1, filePath:string, cap?:number): string|null`
-- Produces (hooks.ts): `main(event:string): Promise<void>`; `underGraft(dir:string, file:string): boolean` (exported for test)
-
-- [ ] **Step 1: Write the failing test for blast-radius**
-
-```ts
-// append to test/claude-format.test.ts
-import { incomingEdges, formatBlastRadius } from '../src/claude/format.js';
-
-const wiring2 = {
- meta: { nodeCount: 3, edgeCount: 2, languages: ['typescript'] },
- nodes: [
- { id: 'src/pkce.ts#verify', name: 'verify', path: 'src/pkce.ts', summary_state: 'ready' },
- { id: 'src/client.ts#exchange', name: 'exchange', path: 'src/client.ts', summary_state: 'ready' },
- { id: 'src/pkce.ts#gen', name: 'gen', path: 'src/pkce.ts', summary_state: 'ready' },
- ],
- edges: [
- { source: 'src/client.ts#exchange', target: 'src/pkce.ts#verify', relation: 'calls', confidence: 'extracted' },
- { source: 'src/pkce.ts#gen', target: 'src/pkce.ts#verify', relation: 'calls', confidence: 'extracted' },
- ],
-} as any;
-
-test('incomingEdges: external callers of nodes in the edited file', () => {
- const e = incomingEdges(wiring2, '/abs/repo/src/pkce.ts');
- assert.equal(e.length, 1, 'same-file edge (gen→verify) excluded');
- assert.equal(e[0].source, 'src/client.ts#exchange');
-});
-
-test('formatBlastRadius renders callers or null', () => {
- const txt = formatBlastRadius(wiring2, '/abs/repo/src/pkce.ts');
- assert.match(strip(txt!), /blast radius for pkce\.ts/);
- assert.match(strip(txt!), /exchange \(client\.ts\)/);
- assert.equal(formatBlastRadius(wiring2, '/abs/repo/src/unknown.ts'), null);
-});
-```
-
-- [ ] **Step 2: Run to verify it fails**
-
-Run: `node --import tsx --test test/claude-format.test.ts`
-Expected: FAIL — `incomingEdges`/`formatBlastRadius` not exported.
-
-- [ ] **Step 3: Add blast-radius to `format.ts`**
-
-```ts
-// append to src/claude/format.ts
-import type { GraphV1, EdgeV1 } from '../graph/types.js';
-
-function nodeIdsInFile(w: GraphV1, filePath: string): Set<string> {
- const nodes = w.nodes ?? [];
- return new Set(
- nodes.filter((n) => n.path && (filePath === n.path || filePath.endsWith(`/${n.path}`) || filePath.endsWith(n.path)))
- .map((n) => n.id),
- );
-}
-
-export function incomingEdges(w: GraphV1, filePath: string): EdgeV1[] {
- const ids = nodeIdsInFile(w, filePath);
- if (!ids.size) return [];
- return (w.edges ?? []).filter((e) => ids.has(e.target) && !ids.has(e.source));
-}
-
-export function formatBlastRadius(w: GraphV1, filePath: string, cap = 8): string | null {
- const edges = incomingEdges(w, filePath);
- if (!edges.length) return null;
- const byId = new Map((w.nodes ?? []).map((n) => [n.id, n]));
- const items = edges.slice(0, cap).map((e) => {
- const n = byId.get(e.source);
- const label = n ? `${n.name} (${basename(n.path)})` : e.from;
- return ` • ${e.relation} ← ${label}`;
- });
- const more = edges.length > cap ? `\n • +${edges.length - cap} more` : '';
- return `[graft] blast radius for ${basename(filePath)} — who depends on it:\n${items.join('\n')}${more}`;
-}
-```
-
-- [ ] **Step 4: Run to verify format tests pass**
-
-Run: `node --import tsx --test test/claude-format.test.ts`
-Expected: PASS (7 tests).
-
-- [ ] **Step 5: Write the failing hooks test**
-
-```ts
-// test/claude-hooks.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { mkdtempSync, mkdirSync, writeFileSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { underGraft, main } from '../src/claude/hooks.js';
-import { readStats } from '../src/claude/state.js';
-
-test('underGraft detects edits inside graft/', () => {
- assert.equal(underGraft('/repo', '/repo/graft/x.md'), true);
- assert.equal(underGraft('/repo', '/repo/src/cli.ts'), false);
-});
-
-test('post-edit marks dirty and records lastFile', async () => {
- const d = mkdtempSync(join(tmpdir(), 'graft-hooks-'));
- mkdirSync(join(d, 'graft', '.graph'), { recursive: true });
- writeFileSync(join(d, 'graft', '.graph', 'wiring.json'),
- JSON.stringify({ meta: { nodeCount: 0, edgeCount: 0, languages: [] }, nodes: [], edges: [] }));
- // graft check will fail (no dist/cli.js here) → staleCount falls back to 0, but dirty must still be set.
- process.env.CLAUDE_PROJECT_DIR = d;
- const stdin = JSON.stringify({ tool_input: { file_path: join(d, 'src', 'auth.ts') } });
- await runWithStdin(stdin, () => main('post-edit'));
- const s = readStats(d)!;
- assert.equal(s.dirty, true);
- assert.equal(s.lastFile, 'auth.ts');
-});
-
-test('post-edit ignores edits inside graft/', async () => {
- const d = mkdtempSync(join(tmpdir(), 'graft-hooks-'));
- process.env.CLAUDE_PROJECT_DIR = d;
- await runWithStdin(JSON.stringify({ tool_input: { file_path: join(d, 'graft', 'a.md') } }), () => main('post-edit'));
- assert.equal(readStats(d), null, 'no state written for graft/ edits');
-});
-
-// helper: hooks.ts reads process.env.GRAFT_TEST_STDIN first (test seam), else fd 0.
-async function runWithStdin(text: string, fn: () => Promise<void>): Promise<void> {
- process.env.GRAFT_TEST_STDIN = text;
- try { await fn(); } finally { delete process.env.GRAFT_TEST_STDIN; }
-}
-```
-
-> Testing stdin is awkward, so `hooks.ts` reads `process.env.GRAFT_TEST_STDIN` first (test seam), then falls back to fd 0. This keeps tests hermetic without spawning subprocesses.
-
-- [ ] **Step 6: Run to verify it fails**
-
-Run: `node --import tsx --test test/claude-hooks.test.ts`
-Expected: FAIL — cannot find `../src/claude/hooks.js`.
-
-- [ ] **Step 7: Write `hooks.ts` (post-edit + stop stub + dispatcher)**
-
-```ts
-// src/claude/hooks.ts
-import { readFileSync } from 'node:fs';
-import { execFileSync, spawn } from 'node:child_process';
-import { join, basename } from 'node:path';
-import { readWiring } from './stats.js';
-import { formatBlastRadius } from './format.js';
-import { patchStats, readStats, acquireLock } from './state.js';
-
-function readStdin(): any {
- const seam = process.env.GRAFT_TEST_STDIN;
- const raw = seam !== undefined ? seam : safeReadFd0();
- try { return JSON.parse(raw); } catch { return {}; }
-}
-function safeReadFd0(): string { try { return readFileSync(0, 'utf8'); } catch { return ''; } }
-
-function projectDir(input: any): string {
- return process.env.CLAUDE_PROJECT_DIR || input.cwd || process.cwd();
-}
-export function underGraft(dir: string, file: string): boolean {
- const rel = file.startsWith(dir) ? file.slice(dir.length) : file;
- return rel.replace(/^[/\\]+/, '').replace(/\\/g, '/').startsWith('graft/');
-}
-function graftJson(dir: string, args: string[]): any | null {
- try {
- const out = execFileSync(process.execPath, [join(dir, 'dist', 'cli.js'), ...args],
- { cwd: dir, encoding: 'utf8', timeout: 8000, stdio: ['ignore', 'pipe', 'ignore'] });
- return JSON.parse(out);
- } catch { return null; }
-}
-function checkStaleCount(dir: string): number {
- const r = graftJson(dir, ['check', '.', '--json']);
- const g = r?.graph ?? {};
- return (g.changed?.length ?? 0) + (g.added?.length ?? 0) + (g.removed?.length ?? 0);
-}
-function emit(eventName: string, additionalContext: string): void {
- process.stdout.write(JSON.stringify({ hookSpecificOutput: { hookEventName: eventName, additionalContext } }));
-}
-
-export async function main(event: string): Promise<void> {
- const input = readStdin();
- const dir = projectDir(input);
-
- if (event === 'post-edit') {
- const file: string | undefined = input?.tool_input?.file_path;
- if (!file || underGraft(dir, file)) return;
- patchStats(dir, { dirty: true, staleCount: checkStaleCount(dir), lastFile: basename(file) });
- const w = readWiring(dir);
- if (w) { const br = formatBlastRadius(w, file); if (br) emit('PostToolUse', br); }
- return;
- }
-
- if (event === 'stop') {
- const stats = readStats(dir);
- if (stats?.dirty && acquireLock(dir)) {
- patchStats(dir, { syncing: true });
- const child = spawn(process.execPath, [join(dir, 'dist', 'claude', 'sync-run.js'), dir],
- { detached: true, stdio: 'ignore' });
- child.unref();
- }
- return;
- }
-}
-```
-
-- [ ] **Step 8: Run to verify hooks tests pass**
-
-Run: `node --import tsx --test test/claude-hooks.test.ts`
-Expected: PASS (3 tests). (The `stop` path isn't exercised until Task 5; `sync-run.js` spawn is guarded by the lock + dirty check.)
-
-- [ ] **Step 9: Write the hooks shim**
-
-```js
-// .claude/helpers/graft-hooks.cjs
-#!/usr/bin/env node
-const path = require('path');
-const dir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
-import(path.join(dir, 'dist', 'claude', 'hooks.js'))
- .then((m) => m.main(process.argv[2]))
- .catch(() => { /* best-effort: never disrupt the session */ });
-```
-
-- [ ] **Step 10: Add `PostToolUse` to `.claude/settings.json`**
-
-```json
-{
- "statusLine": {
- "type": "command",
- "command": "node \"${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-statusline.cjs\""
- },
- "hooks": {
- "PostToolUse": [
- {
- "matcher": "Write|Edit|MultiEdit",
- "hooks": [
- { "type": "command", "command": "node \"${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-hooks.cjs\" post-edit", "timeout": 10000 }
- ]
- }
- ]
- }
-}
-```
-
-- [ ] **Step 11: Build and commit**
-
-```bash
-npm run build
-git add src/claude/format.ts src/claude/hooks.ts test/claude-format.test.ts test/claude-hooks.test.ts \
- .claude/helpers/graft-hooks.cjs .claude/settings.json
-git commit -m "feat(claude): post-edit hook — drift flag + blast-radius injection"
-```
-
----
-
-## Task 5: Auto-sync — background rebuild runner (closes the loop)
-
-**Files:**
-- Create: `src/claude/sync-run.ts`
-- Modify: `.claude/settings.json` (add `Stop`)
-- Test: `test/claude-hooks.test.ts` (add sync-run behavior test)
-
-**Interfaces:**
-- Consumes: `readWiring`, `computeStats` (stats.ts); `patchStats`, `releaseLock` (state.ts).
-- Produces: `src/claude/sync-run.ts` with `runSync(dir:string, build:(d:string)=>void): void` (build injected for testability) and a `main()` that calls `runSync` with the real `graft build`.
-
-- [ ] **Step 1: Write the failing test (inject a fake build)**
-
-```ts
-// append to test/claude-hooks.test.ts
-import { runSync } from '../src/claude/sync-run.js';
-import { writeStats, emptyStats, acquireLock } from '../src/claude/state.js';
-
-test('runSync clears dirty/syncing, recomputes stats, releases lock', () => {
- const d = mkdtempSync(join(tmpdir(), 'graft-sync-'));
- mkdirSync(join(d, 'graft', '.graph'), { recursive: true });
- writeStats(d, { ...emptyStats(), dirty: true, syncing: true, staleCount: 3 });
- acquireLock(d);
- // fake build: write a fresh wiring.json with 2 nodes, 1 ready
- const fakeBuild = (dir: string) => writeFileSync(join(dir, 'graft', '.graph', 'wiring.json'),
- JSON.stringify({ meta: { nodeCount: 2, edgeCount: 1, languages: ['typescript'] },
- nodes: [{ id: 'a', summary_state: 'ready' }, { id: 'b', summary_state: 'pending' }],
- edges: [{ from: 'a', to: 'b' }] }));
- runSync(d, fakeBuild);
- const s = readStats(d)!;
- assert.equal(s.dirty, false);
- assert.equal(s.syncing, false);
- assert.equal(s.staleCount, 0);
- assert.equal(s.nodeCount, 2);
- assert.equal(s.readyCount, 1);
- assert.ok(s.syncedAt);
- assert.equal(acquireLock(d), true, 'lock released, so reacquire succeeds');
-});
-
-test('runSync clears syncing even if build throws (money-safe failure)', () => {
- const d = mkdtempSync(join(tmpdir(), 'graft-sync-'));
- writeStats(d, { ...emptyStats(), dirty: true, syncing: true });
- acquireLock(d);
- runSync(d, () => { throw new Error('build failed'); });
- const s = readStats(d)!;
- assert.equal(s.syncing, false);
- assert.equal(s.dirty, true, 'stays dirty so the bar keeps ⚠ and it retries next turn');
- assert.equal(acquireLock(d), true, 'lock always released');
-});
-```
-
-- [ ] **Step 2: Run to verify it fails**
-
-Run: `node --import tsx --test test/claude-hooks.test.ts`
-Expected: FAIL — cannot find `../src/claude/sync-run.js`.
-
-- [ ] **Step 3: Write `sync-run.ts`**
-
-```ts
-// src/claude/sync-run.ts
-import { execFileSync } from 'node:child_process';
-import { join } from 'node:path';
-import { readWiring, computeStats } from './stats.js';
-import { patchStats, releaseLock } from './state.js';
-
-/** MONEY GUARD: plain `graft build` only — structural, $0, offline. Never --deep. */
-function realBuild(dir: string): void {
- execFileSync(process.execPath, [join(dir, 'dist', 'cli.js'), 'build', '.'],
- { cwd: dir, stdio: 'ignore', timeout: 120000 });
-}
-
-export function runSync(dir: string, build: (d: string) => void = realBuild): void {
- try {
- build(dir);
- const w = readWiring(dir);
- const patch: Record<string, unknown> = { dirty: false, staleCount: 0, syncing: false, syncedAt: new Date().toISOString() };
- if (w) Object.assign(patch, computeStats(w));
- patchStats(dir, patch);
- } catch {
- patchStats(dir, { syncing: false }); // leave dirty=true; retry next turn
- } finally {
- releaseLock(dir);
- }
-}
-
-export function main(): void {
- const dir = process.argv[2];
- if (dir) runSync(dir);
-}
-main();
-```
-
-> `main()` runs on import so the detached `node dist/claude/sync-run.js <dir>` process (spawned by the `stop` hook in Task 4) executes `runSync` and exits. The `build` parameter default is the real, `--deep`-free build; tests inject a fake.
-
-- [ ] **Step 4: Run to verify sync tests pass**
-
-Run: `node --import tsx --test test/claude-hooks.test.ts`
-Expected: PASS (5 tests total in this file).
-
-- [ ] **Step 5: Add `Stop` to `.claude/settings.json`**
-
-Add this key alongside `PostToolUse` inside `hooks`:
-
-```json
- "Stop": [
- {
- "hooks": [
- { "type": "command", "command": "node \"${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-hooks.cjs\" stop", "timeout": 8000 }
- ]
- }
- ]
-```
-
-- [ ] **Step 6: Build, then verify the full loop end-to-end (money-safe)**
-
-```bash
-npm run build
-# 1) simulate an edit → expect dirty + a stale count
-echo '{"cwd":"'"$PWD"'","tool_input":{"file_path":"'"$PWD"'/src/cli.ts"}}' \
- | node .claude/helpers/graft-hooks.cjs post-edit
-node -e "console.log(require('./dist/claude/state.js').readStats(process.cwd()))" # dirty:true
-# 2) simulate turn end → spawns background sync (plain build, $0)
-echo '{"cwd":"'"$PWD"'"}' | node .claude/helpers/graft-hooks.cjs stop
-sleep 5
-node -e "console.log(require('./dist/claude/state.js').readStats(process.cwd()))" # dirty:false, syncedAt set
-```
-Expected: after the sleep, `dirty:false`, `syncing:false`, `syncedAt` populated. Confirm **no** OpenRouter/network call happened (plain build only). Then `git checkout graft/` if the build rewrote committed graph files during this manual test.
-
-- [ ] **Step 7: Commit**
-
-```bash
-git add src/claude/sync-run.ts test/claude-hooks.test.ts .claude/settings.json
-git commit -m "feat(claude): turn-end auto-sync — detached \$0 rebuild under lock (never --deep)"
-```
-
----
-
-## Task 6: Active retrieval — inject graft matches on each prompt
-
-**Files:**
-- Modify: `src/claude/format.ts` (add `formatRetrieval`), `src/claude/hooks.ts` (add `prompt` event), `.claude/settings.json` (add `UserPromptSubmit`)
-- Test: `test/claude-format.test.ts` (add cases)
-
-**Interfaces:**
-- Consumes: `graftJson` (internal to hooks.ts); `readSession`/`writeSession` (state.ts).
-- Produces (format.ts): `interface AskJson { query:string; mode:string; hits:{kind:string;title:string;pointer:string;snippet:string;score:number}[] }`; `formatRetrieval(ask:AskJson, cap?:number): string|null`
-
-- [ ] **Step 1: Write the failing test**
-
-```ts
-// append to test/claude-format.test.ts
-import { formatRetrieval } from '../src/claude/format.js';
-
-test('formatRetrieval renders top hits, trims snippet, first pointer only', () => {
- const ask = { query: 'pkce', mode: 'lexical', hits: [
- { kind: 'concept', title: 'PKCE', pointer: 'src/pkce.ts, src/client.ts', snippet: 'Validates the challenge.', score: 1 },
- ] } as any;
- const txt = strip(formatRetrieval(ask)!);
- assert.match(txt, /relevant context/);
- assert.match(txt, /PKCE — src\/pkce\.ts — Validates the challenge\./);
- assert.doesNotMatch(txt, /client\.ts/); // only the first pointer segment
-});
-
-test('formatRetrieval returns null for no hits', () => {
- assert.equal(formatRetrieval({ query: 'x', mode: 'empty', hits: [] } as any), null);
-});
-```
-
-- [ ] **Step 2: Run to verify it fails**
-
-Run: `node --import tsx --test test/claude-format.test.ts`
-Expected: FAIL — `formatRetrieval` not exported.
-
-- [ ] **Step 3: Add `formatRetrieval` to `format.ts`**
-
-```ts
-// append to src/claude/format.ts
-export interface AskJson {
- query: string; mode: string;
- hits: { kind: string; title: string; pointer: string; snippet: string; score: number }[];
-}
-
-export function formatRetrieval(ask: AskJson, cap = 5): string | null {
- const hits = (ask.hits ?? []).slice(0, cap);
- if (!hits.length) return null;
- const lines = hits.map((h) => {
- const ptr = (h.pointer ?? '').split(',')[0].trim();
- const snip = (h.snippet ?? '').replace(/\s+/g, ' ').trim().slice(0, 140);
- return ` • ${h.title} — ${ptr} — ${snip}`;
- });
- return `[graft] relevant context for this prompt:\n${lines.join('\n')}`;
-}
-```
-
-- [ ] **Step 4: Run to verify format tests pass**
-
-Run: `node --import tsx --test test/claude-format.test.ts`
-Expected: PASS (9 tests).
-
-- [ ] **Step 5: Add the `prompt` branch to `hooks.ts`**
-
-Insert before the closing of `main`, after the `stop` block:
-
-```ts
- if (event === 'prompt') {
- const prompt = String(input?.prompt ?? '').trim();
- if (prompt.length < 8) return;
- const ask = graftJson(dir, ['ask', prompt, '.', '--json', '-n', '5']);
- if (!ask) return;
- const txt = formatRetrieval(ask);
- if (!txt) return;
- emit('UserPromptSubmit', txt);
- const id = input.session_id || 'default';
- const s = readSession(dir, id);
- s.lastQuery = prompt;
- const agent = input?.agent?.name;
- if (agent) s.perAgentQuery[agent] = prompt;
- writeSession(dir, id, s);
- }
-```
-
-Add to the imports at the top of `hooks.ts`:
-
-```ts
-import { formatBlastRadius, formatRetrieval } from './format.js';
-import { patchStats, readStats, acquireLock, readSession, writeSession } from './state.js';
-```
-
-- [ ] **Step 6: Add `UserPromptSubmit` to `.claude/settings.json`** (inside `hooks`)
-
-```json
- "UserPromptSubmit": [
- {
- "hooks": [
- { "type": "command", "command": "node \"${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-hooks.cjs\" prompt", "timeout": 8000 }
- ]
- }
- ]
-```
-
-- [ ] **Step 7: Build and smoke-test**
-
-```bash
-npm run build
-echo '{"cwd":"'"$PWD"'","session_id":"t","prompt":"how does pkce verification work"}' \
- | node .claude/helpers/graft-hooks.cjs prompt
-```
-Expected: JSON with `hookSpecificOutput.additionalContext` containing `[graft] relevant context…` and real hits from this repo.
-
-- [ ] **Step 8: Commit**
-
-```bash
-git add src/claude/format.ts src/claude/hooks.ts test/claude-format.test.ts .claude/settings.json
-git commit -m "feat(claude): active retrieval — inject graft ask matches on prompt"
-```
-
----
-
-## Task 7: Session orientation — inject the repo map at session start
-
-**Files:**
-- Modify: `src/claude/format.ts` (add `formatOrientation`), `src/claude/hooks.ts` (add `session-start`), `.claude/settings.json` (add `SessionStart`)
-- Test: `test/claude-format.test.ts` (add case)
-
-**Interfaces:**
-- Produces (format.ts): `formatOrientation(indexMd:string, budgetBytes?:number): string`
-
-- [ ] **Step 1: Write the failing test**
-
-```ts
-// append to test/claude-format.test.ts
-import { formatOrientation } from '../src/claude/format.js';
-
-test('formatOrientation labels and truncates to budget', () => {
- const md = 'X'.repeat(3000);
- const out = strip(formatOrientation(md, 1500));
- assert.match(out, /repo map/);
- assert.ok(out.length < 1600, 'trimmed to budget + short header');
-});
-```
-
-- [ ] **Step 2: Run to verify it fails**
-
-Run: `node --import tsx --test test/claude-format.test.ts`
-Expected: FAIL — `formatOrientation` not exported.
-
-- [ ] **Step 3: Add `formatOrientation` to `format.ts`**
-
-```ts
-// append to src/claude/format.ts
-export function formatOrientation(indexMd: string, budgetBytes = 1500): string {
- return `[graft] repo map (graft/INDEX.md):\n${indexMd.slice(0, budgetBytes)}`;
-}
-```
-
-- [ ] **Step 4: Run to verify it passes**
-
-Run: `node --import tsx --test test/claude-format.test.ts`
-Expected: PASS (10 tests).
-
-- [ ] **Step 5: Add the `session-start` branch to `hooks.ts`**
-
-Add import at top: `import { readFileSync } from 'node:fs';` is already present. Add `formatOrientation` to the format import:
-
-```ts
-import { formatBlastRadius, formatRetrieval, formatOrientation } from './format.js';
-```
-
-Add the branch inside `main`:
-
-```ts
- if (event === 'session-start') {
- try {
- const idx = readFileSync(join(dir, 'graft', 'INDEX.md'), 'utf8');
- emit('SessionStart', formatOrientation(idx));
- } catch { /* no INDEX.md — skip */ }
- }
-```
-
-- [ ] **Step 6: Add `SessionStart` to `.claude/settings.json`** (inside `hooks`)
-
-```json
- "SessionStart": [
- {
- "hooks": [
- { "type": "command", "command": "node \"${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-hooks.cjs\" session-start", "timeout": 8000 }
- ]
- }
- ]
-```
-
-- [ ] **Step 7: Build, smoke-test, commit**
-
-```bash
-npm run build
-echo '{"cwd":"'"$PWD"'"}' | node .claude/helpers/graft-hooks.cjs session-start # expect INDEX.md head in additionalContext
-git add src/claude/format.ts src/claude/hooks.ts test/claude-format.test.ts .claude/settings.json
-git commit -m "feat(claude): session-start orientation — inject graft/INDEX.md head"
-```
-
----
-
-## Task 8: Display extras — per-subagent row + clickable node refs
-
-**Files:**
-- Modify: `src/claude/statusline.ts` (per-agent line when `agent.name` present), `.claude/settings.json` (add `subagentStatusLine` + `footerLinksRegexes`)
-- Test: `test/claude-format.test.ts` (add per-agent render case)
-
-**Interfaces:**
-- Consumes: `renderStatusline`, `readSession`.
-- Produces (format.ts): `renderSubagent(agentName:string, session:SessionState|null): string`
-
-- [ ] **Step 1: Write the failing test**
-
-```ts
-// append to test/claude-format.test.ts
-import { renderSubagent } from '../src/claude/format.js';
-
-test('renderSubagent shows agent name and its last query', () => {
- const out = strip(renderSubagent('Explore', { lastQuery: null, perAgentQuery: { Explore: 'pkce flow' }, graftReads: 0, sourceReads: 0 }));
- assert.match(out, /Explore/);
- assert.match(out, /pkce flow/);
-});
-
-test('renderSubagent without a query still shows the agent', () => {
- const out = strip(renderSubagent('Plan', null));
- assert.match(out, /Plan/);
-});
-```
-
-- [ ] **Step 2: Run to verify it fails**
-
-Run: `node --import tsx --test test/claude-format.test.ts`
-Expected: FAIL — `renderSubagent` not exported.
-
-- [ ] **Step 3: Add `renderSubagent` to `format.ts`**
-
-```ts
-// append to src/claude/format.ts
-export function renderSubagent(agentName: string, session: SessionState | null): string {
- const q = session?.perAgentQuery?.[agentName];
- const tail = q ? SEP + C.muted('graft: ') + C.text(q) : '';
- return C.muted('◤ ') + C.indigo(agentName) + tail;
-}
-```
-
-- [ ] **Step 4: Run to verify it passes**
-
-Run: `node --import tsx --test test/claude-format.test.ts`
-Expected: PASS (12 tests).
-
-- [ ] **Step 5: Use it in `statusline.ts`**
-
-Replace the body of `main` so it renders the subagent row when `agent.name` is set:
-
-```ts
-// src/claude/statusline.ts
-import { readFileSync } from 'node:fs';
-import { renderStatusline, renderSubagent } from './format.js';
-import { readStats, readSession } from './state.js';
-
-export function main(): void {
- let input: any = {};
- try { input = JSON.parse(readFileSync(0, 'utf8')); } catch { /* no/invalid stdin */ }
- const dir = process.env.CLAUDE_PROJECT_DIR || input.cwd || process.cwd();
- const session = readSession(dir, input.session_id || 'default');
- const agent = input?.agent?.name;
- if (agent) { process.stdout.write(renderSubagent(agent, session)); return; }
- const stats = readStats(dir);
- const raw = input?.context_window?.used_percentage;
- const ctxPct = typeof raw === 'number' ? Math.round(raw) : null;
- process.stdout.write(renderStatusline(stats, session, { ctxPct }).join('\n'));
-}
-```
-
-> The same shim backs both `statusLine` and `subagentStatusLine`; the presence of `agent.name` on stdin selects the per-agent row. This keeps one entry point.
-
-- [ ] **Step 6: Add `subagentStatusLine` + `footerLinksRegexes` to `.claude/settings.json`** (top level)
-
-```json
- "subagentStatusLine": {
- "type": "command",
- "command": "node \"${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-statusline.cjs\""
- },
- "footerLinksRegexes": ["graft/[\\w./-]+\\.md"]
-```
-
-- [ ] **Step 7: Build, smoke-test, commit**
-
-```bash
-npm run build
-echo '{"cwd":"'"$PWD"'","agent":{"name":"Explore"}}' | node .claude/helpers/graft-statusline.cjs # expect "◤ Explore …"
-git add src/claude/format.ts src/claude/statusline.ts test/claude-format.test.ts .claude/settings.json
-git commit -m "feat(claude): per-subagent statusline row + clickable graft node refs"
-```
-
----
-
-## Task 9: Full suite green + dogfood verification
-
-**Files:** none (verification only)
-
-- [ ] **Step 1: Run the entire test suite**
-
-Run: `npm test`
-Expected: all `test/*.test.ts` pass, including the four new `claude-*` files and the pre-existing engine tests (no regressions).
-
-- [ ] **Step 2: Build clean**
-
-Run: `npm run build`
-Expected: exits 0; `dist/claude/{state,stats,format,statusline,hooks,sync-run}.js` all present (`ls dist/claude`).
-
-- [ ] **Step 3: Dogfood the live loop in this repo**
-
-In a Claude Code session opened on `context-graph-engine`:
-1. Confirm the statusline shows `◤ graft · 319 nodes / 730 edges · ✓ synced` (once a real build has populated `stats.json`; run `graft build` once if needed).
-2. Ask a question → confirm a `[graft] relevant context…` block was injected (visible in the transcript's context or via `/context`).
-3. Edit a source file → statusline flips to `⚠ N stale`; a blast-radius note appears after the edit.
-4. End the turn → within a few seconds the statusline returns to `✓ synced`.
-5. **Money check:** confirm no OpenRouter request fired during auto-sync (structural build only). If `graft/` was rewritten by the manual build, `git add graft/` as an intended refresh or `git checkout graft/` to discard.
-
-- [ ] **Step 4: Final commit (if any dogfood tweaks were needed)**
-
-```bash
-git add -A
-git commit -m "chore(claude): verify full suite + dogfood the drift→sync loop"
-```
-
----
-
-## Notes for the implementer
-
-- **Never** add `--deep` to any `graft build` invocation. The only build command in this plan is plain `graft build .` in `sync-run.ts`.
-- The statusline path must never call `execFileSync`/`spawn` — it reads `stats.json`, one session file, and stdin. All Graft invocations live in `hooks.ts` / `sync-run.ts`, which fire on discrete events, not on every render.
-- If `src/graph/types.ts` export names differ from those assumed in Task 2, match the file — do not invent types.
-- All hooks are best-effort: the `.cjs` shims already swallow errors so a failure can never break the session.
diff --git a/docs/superpowers/plans/2026-07-20-graft-init-onboarding.md b/docs/superpowers/plans/2026-07-20-graft-init-onboarding.md
deleted file mode 100644
index 93c9b6e6..00000000
--- a/docs/superpowers/plans/2026-07-20-graft-init-onboarding.md
+++ /dev/null
@@ -1,545 +0,0 @@
-# `graft init` Onboarding Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** Make the Claude Code integration work in any repo via `npm i -D @nanonets/graft` + `npx graft init`, then publish `0.3.0`.
-
-**Architecture:** A pure `mergeGraftSettings` + shim-source generators live in `src/claude/`; `runInit` orchestrates writing `.claude/` files and (optionally) building the graph; `cli.ts` exposes `graft init`. Consumer shims resolve the installed package on disk and dynamic-import the absolute file (bypassing the restrictive `exports` map). A `postinstall` script prints a one-line nudge.
-
-**Tech Stack:** Node 20+ (ESM), TypeScript (strict), `node:test` + `node:assert/strict`, `tsx`, `commander`. No new dependencies.
-
-## Global Constraints
-
-- **Money guard:** `graft init`'s build step runs only plain `graft build` — structural, offline, `$0`. Never `--deep`. (spec §4.6)
-- **Never clobber user config:** merging `.claude/settings.json` preserves all foreign keys; a foreign `statusLine`/`subagentStatusLine` is left untouched with a warning; Graft hook entries are appended (and de-duplicated on re-run). (spec §4.3)
-- **Idempotent:** re-running `graft init` updates in place — no duplicate hook entries, no duplicate footer regex. (spec §4.4)
-- **Best-effort install:** `postinstall` never fails an install (any error → exit 0); silent when `CI` is set or already initialized. (spec §4.5)
-- **Smart shim resolution:** shims resolve `@nanonets/graft/package.json` from the target dir and import `<pkgRoot>/dist/claude/<file>`; fall back to `<dir>/dist/claude/<file>` for Graft's own repo. Absolute-path `import()` bypasses `exports`. (spec §4.1)
-- Node ESM (`.js` import extensions in `src/`). State/most conventions follow the existing `src/claude/*`.
-
----
-
-## File Structure
-
-**Created:** `src/claude/shim-template.ts`, `src/claude/settings-merge.ts`, `src/claude/init.ts`, `scripts/postinstall.mjs`, `test/claude-shim-template.test.ts`, `test/claude-settings-merge.test.ts`, `test/claude-init.test.ts`.
-**Modified:** `src/cli.ts` (add `init`), `.claude/helpers/graft-statusline.cjs` + `graft-hooks.cjs` (smart form), `package.json` (`exports["./package.json"]`, `scripts.postinstall`, version `0.3.0`).
-
----
-
-## Task 1: Smart shim template + own-repo shims + exports
-
-**Files:**
-- Create: `src/claude/shim-template.ts`, `test/claude-shim-template.test.ts`
-- Modify: `.claude/helpers/graft-statusline.cjs`, `.claude/helpers/graft-hooks.cjs`, `package.json` (`exports`)
-
-**Interfaces:**
-- Produces: `statuslineShim(): string`, `hooksShim(): string`
-
-- [ ] **Step 1: Write the failing test**
-
-```ts
-// test/claude-shim-template.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import vm from 'node:vm';
-import { statuslineShim, hooksShim } from '../src/claude/shim-template.js';
-
-for (const [name, src] of [['statusline', statuslineShim()], ['hooks', hooksShim()]] as const) {
- test(`${name} shim parses and has package-resolve + local fallback`, () => {
- const body = src.replace(/^#!.*\n/, ''); // strip shebang for vm
- assert.doesNotThrow(() => new vm.Script(body), 'valid JS');
- assert.match(src, /require\.resolve\('@nanonets\/graft\/package\.json', \{ paths: \[dir\] \}\)/);
- assert.match(src, /path\.join\(dir, 'dist', 'claude'/);
- assert.match(src, /\.catch\(\(\) => \{/); // best-effort
- });
-}
-
-test('statusline calls main(); hooks passes the event arg', () => {
- assert.match(statuslineShim(), /m\.main\(\)/);
- assert.match(hooksShim(), /m\.main\(process\.argv\[2\]\)/);
-});
-```
-
-- [ ] **Step 2: Run test — expect FAIL** (`Cannot find module '../src/claude/shim-template.js'`)
-
-Run: `node --import tsx --test test/claude-shim-template.test.ts`
-
-- [ ] **Step 3: Implement `src/claude/shim-template.ts`**
-
-```ts
-function shim(entryFile: string, call: string): string {
- return `#!/usr/bin/env node
-const path = require('path');
-const dir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
-function entry(name) {
- try {
- const pkg = require.resolve('@nanonets/graft/package.json', { paths: [dir] });
- return path.join(path.dirname(pkg), 'dist', 'claude', name);
- } catch {
- return path.join(dir, 'dist', 'claude', name);
- }
-}
-import(entry(${JSON.stringify(entryFile)})).then((m) => ${call}).catch(() => { /* graft unavailable — no-op */ });
-`;
-}
-
-export function statuslineShim(): string { return shim('statusline.js', 'm.main()'); }
-export function hooksShim(): string { return shim('hooks.js', 'm.main(process.argv[2])'); }
-```
-
-- [ ] **Step 4: Run test — expect PASS**
-
-Run: `node --import tsx --test test/claude-shim-template.test.ts`
-
-- [ ] **Step 5: Regenerate Graft's own committed shims to the smart form**
-
-Overwrite `.claude/helpers/graft-statusline.cjs` with the exact output of `statuslineShim()` and `.claude/helpers/graft-hooks.cjs` with `hooksShim()`. Generate them deterministically:
-
-```bash
-node --import tsx -e "import('./src/claude/shim-template.ts').then(m=>{require('fs').writeFileSync('.claude/helpers/graft-statusline.cjs',m.statuslineShim());require('fs').writeFileSync('.claude/helpers/graft-hooks.cjs',m.hooksShim());})"
-chmod +x .claude/helpers/graft-statusline.cjs .claude/helpers/graft-hooks.cjs
-```
-
-- [ ] **Step 6: Add `./package.json` to `exports` in `package.json`**
-
-Change the `exports` block to:
-
-```json
- "exports": {
- ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
- "./package.json": "./package.json"
- },
-```
-
-- [ ] **Step 7: Build + verify the own-repo shim still renders (dogfood fallback path)**
-
-```bash
-npm run build
-echo '{"session_id":"t","cwd":"'"$PWD"'","context_window":{"used_percentage":30}}' | node .claude/helpers/graft-statusline.cjs
-```
-Expected: the graft bar renders (in this repo, `require.resolve('@nanonets/graft/...')` fails → falls back to `./dist/claude/statusline.js`). If `graft/.cache/stats.json` is absent it falls back further to `wiring.json` — still a real bar, not "not built".
-
-- [ ] **Step 8: Commit**
-
-```bash
-git add src/claude/shim-template.ts test/claude-shim-template.test.ts .claude/helpers/graft-statusline.cjs .claude/helpers/graft-hooks.cjs package.json
-git commit -m "feat(claude): smart shim resolution (installed package + local fallback) + package.json export"
-```
-
----
-
-## Task 2: `mergeGraftSettings` — non-clobbering, idempotent settings merge
-
-**Files:**
-- Create: `src/claude/settings-merge.ts`, `test/claude-settings-merge.test.ts`
-
-**Interfaces:**
-- Produces: `mergeGraftSettings(existing: Record<string, any>): { merged: Record<string, any>; warnings: string[] }`
-
-- [ ] **Step 1: Write the failing test**
-
-```ts
-// test/claude-settings-merge.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { mergeGraftSettings } from '../src/claude/settings-merge.js';
-
-const SL = 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-statusline.cjs"';
-
-test('empty settings gets the full Graft blocks', () => {
- const { merged, warnings } = mergeGraftSettings({});
- assert.equal(merged.statusLine.command, SL);
- assert.equal(merged.subagentStatusLine.command, SL);
- assert.ok(Array.isArray(merged.hooks.PostToolUse));
- assert.equal(merged.hooks.PostToolUse[0].matcher, 'Write|Edit|MultiEdit');
- for (const e of ['PostToolUse', 'UserPromptSubmit', 'SessionStart', 'Stop']) {
- assert.ok(merged.hooks[e][0].hooks[0].command.includes('graft-hooks.cjs'), `${e} wired`);
- }
- assert.ok(merged.footerLinksRegexes.includes('graft/[\\w./-]+\\.md'));
- assert.deepEqual(warnings, []);
-});
-
-test('foreign statusLine is preserved with a warning; Graft not forced in', () => {
- const { merged, warnings } = mergeGraftSettings({ statusLine: { type: 'command', command: 'my-bar.sh' } });
- assert.equal(merged.statusLine.command, 'my-bar.sh');
- assert.equal(warnings.length, 1);
- assert.match(warnings[0], /statusLine/);
-});
-
-test('existing foreign hooks are preserved; Graft appended', () => {
- const existing = { hooks: { PostToolUse: [{ matcher: 'Bash', hooks: [{ type: 'command', command: 'mine.sh' }] }] } };
- const { merged } = mergeGraftSettings(existing);
- assert.equal(merged.hooks.PostToolUse.length, 2);
- assert.equal(merged.hooks.PostToolUse[0].hooks[0].command, 'mine.sh');
- assert.ok(merged.hooks.PostToolUse[1].hooks[0].command.includes('graft-hooks.cjs'));
-});
-
-test('re-running is idempotent (no duplicate Graft entries or footer)', () => {
- const once = mergeGraftSettings({}).merged;
- const twice = mergeGraftSettings(once).merged;
- assert.equal(twice.hooks.PostToolUse.length, 1);
- assert.equal(twice.hooks.Stop.length, 1);
- assert.equal(twice.footerLinksRegexes.filter((r: string) => r === 'graft/[\\w./-]+\\.md').length, 1);
-});
-
-test('foreign top-level keys survive', () => {
- const { merged } = mergeGraftSettings({ model: 'claude-sonnet-5', permissions: { allow: ['Bash(ls)'] } });
- assert.equal(merged.model, 'claude-sonnet-5');
- assert.deepEqual(merged.permissions.allow, ['Bash(ls)']);
-});
-```
-
-- [ ] **Step 2: Run test — expect FAIL**
-
-Run: `node --import tsx --test test/claude-settings-merge.test.ts`
-
-- [ ] **Step 3: Implement `src/claude/settings-merge.ts`**
-
-```ts
-type Json = Record<string, any>;
-
-const SL_CMD = 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-statusline.cjs"';
-const FOOTER = 'graft/[\\w./-]+\\.md';
-
-function hookCmd(arg: string): string {
- return `node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-hooks.cjs" ${arg}`;
-}
-function graftBlocks(): Record<string, Json> {
- return {
- PostToolUse: { matcher: 'Write|Edit|MultiEdit', hooks: [{ type: 'command', command: hookCmd('post-edit'), timeout: 10000 }] },
- UserPromptSubmit: { hooks: [{ type: 'command', command: hookCmd('prompt'), timeout: 8000 }] },
- SessionStart: { hooks: [{ type: 'command', command: hookCmd('session-start'), timeout: 8000 }] },
- Stop: { hooks: [{ type: 'command', command: hookCmd('stop'), timeout: 8000 }] },
- };
-}
-function isGraftHookEntry(entry: Json): boolean {
- return JSON.stringify(entry ?? '').includes('graft-hooks.cjs');
-}
-
-export function mergeGraftSettings(existing: Json): { merged: Json; warnings: string[] } {
- const merged: Json = { ...(existing ?? {}) };
- const warnings: string[] = [];
-
- if (!merged.statusLine) merged.statusLine = { type: 'command', command: SL_CMD };
- else if (merged.statusLine.command !== SL_CMD)
- warnings.push('Existing statusLine left untouched (a session allows only one). To use Graft, point it at .claude/helpers/graft-statusline.cjs.');
-
- if (!merged.subagentStatusLine) merged.subagentStatusLine = { type: 'command', command: SL_CMD };
- else if (merged.subagentStatusLine.command !== SL_CMD)
- warnings.push('Existing subagentStatusLine left untouched.');
-
- merged.hooks = { ...(merged.hooks ?? {}) };
- for (const [event, block] of Object.entries(graftBlocks())) {
- const prior = Array.isArray(merged.hooks[event]) ? merged.hooks[event] : [];
- const foreign = prior.filter((e: Json) => !isGraftHookEntry(e)); // drop old Graft entries → idempotent
- merged.hooks[event] = [...foreign, block];
- }
-
- const footer = Array.isArray(merged.footerLinksRegexes) ? [...merged.footerLinksRegexes] : [];
- if (!footer.includes(FOOTER)) footer.push(FOOTER);
- merged.footerLinksRegexes = footer;
-
- return { merged, warnings };
-}
-```
-
-- [ ] **Step 4: Run test — expect PASS (5 tests)**
-
-Run: `node --import tsx --test test/claude-settings-merge.test.ts`
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/claude/settings-merge.ts test/claude-settings-merge.test.ts
-git commit -m "feat(claude): non-clobbering, idempotent settings merge for graft init"
-```
-
----
-
-## Task 3: `runInit` + `graft init` command
-
-**Files:**
-- Create: `src/claude/init.ts`, `test/claude-init.test.ts`
-- Modify: `src/cli.ts`
-
-**Interfaces:**
-- Consumes: `mergeGraftSettings` (Task 2); `statuslineShim`/`hooksShim` (Task 1).
-- Produces: `runInit(dir: string, opts?: { build?: boolean; cliPath?: string }): InitResult` where `interface InitResult { settingsPath: string; shims: string[]; warnings: string[]; built: boolean }`
-
-- [ ] **Step 1: Write the failing test**
-
-```ts
-// test/claude-init.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { mkdtempSync, readFileSync, existsSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { runInit } from '../src/claude/init.js';
-
-function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-init-')); }
-
-test('runInit scaffolds settings + both shims (build skipped)', () => {
- const d = fresh();
- const r = runInit(d, { build: false });
- assert.ok(existsSync(join(d, '.claude', 'settings.json')));
- assert.ok(existsSync(join(d, '.claude', 'helpers', 'graft-statusline.cjs')));
- assert.ok(existsSync(join(d, '.claude', 'helpers', 'graft-hooks.cjs')));
- assert.equal(r.built, false);
- const s = JSON.parse(readFileSync(join(d, '.claude', 'settings.json'), 'utf8'));
- assert.ok(s.statusLine.command.includes('graft-statusline.cjs'));
- assert.ok(s.hooks.Stop[0].hooks[0].command.includes('graft-hooks.cjs'));
-});
-
-test('runInit preserves foreign settings and warns on foreign statusLine', () => {
- const d = fresh();
- const { writeFileSync, mkdirSync } = require('node:fs');
- mkdirSync(join(d, '.claude'), { recursive: true });
- writeFileSync(join(d, '.claude', 'settings.json'), JSON.stringify({ model: 'x', statusLine: { command: 'mine' } }));
- const r = runInit(d, { build: false });
- const s = JSON.parse(readFileSync(join(d, '.claude', 'settings.json'), 'utf8'));
- assert.equal(s.model, 'x');
- assert.equal(s.statusLine.command, 'mine');
- assert.equal(r.warnings.length, 1);
-});
-
-test('runInit is idempotent', () => {
- const d = fresh();
- runInit(d, { build: false });
- runInit(d, { build: false });
- const s = JSON.parse(readFileSync(join(d, '.claude', 'settings.json'), 'utf8'));
- assert.equal(s.hooks.PostToolUse.length, 1);
-});
-```
-
-- [ ] **Step 2: Run test — expect FAIL**
-
-Run: `node --import tsx --test test/claude-init.test.ts`
-
-- [ ] **Step 3: Implement `src/claude/init.ts`**
-
-```ts
-import { mkdirSync, writeFileSync, readFileSync, existsSync, chmodSync } from 'node:fs';
-import { join } from 'node:path';
-import { execFileSync } from 'node:child_process';
-import { mergeGraftSettings } from './settings-merge.js';
-import { statuslineShim, hooksShim } from './shim-template.js';
-
-export interface InitResult {
- settingsPath: string;
- shims: string[];
- warnings: string[];
- built: boolean;
-}
-
-export function runInit(dir: string, opts: { build?: boolean; cliPath?: string } = {}): InitResult {
- const helpersDir = join(dir, '.claude', 'helpers');
- mkdirSync(helpersDir, { recursive: true });
-
- const settingsPath = join(dir, '.claude', 'settings.json');
- let existing: Record<string, any> = {};
- try { existing = JSON.parse(readFileSync(settingsPath, 'utf8')); } catch { /* none/invalid → start fresh */ }
- const { merged, warnings } = mergeGraftSettings(existing);
- writeFileSync(settingsPath, `${JSON.stringify(merged, null, 2)}\n`);
-
- const sl = join(helpersDir, 'graft-statusline.cjs');
- const hk = join(helpersDir, 'graft-hooks.cjs');
- writeFileSync(sl, statuslineShim()); chmodSync(sl, 0o755);
- writeFileSync(hk, hooksShim()); chmodSync(hk, 0o755);
-
- let built = false;
- const wiring = join(dir, 'graft', '.graph', 'wiring.json');
- if (opts.build !== false && opts.cliPath && !existsSync(wiring)) {
- try {
- execFileSync(process.execPath, [opts.cliPath, 'build', '.'], { cwd: dir, stdio: 'inherit', timeout: 300000 });
- built = true;
- } catch { /* build best-effort; user can run `graft build` manually */ }
- }
- return { settingsPath, shims: [sl, hk], warnings, built };
-}
-```
-
-- [ ] **Step 4: Run test — expect PASS (3 tests)**
-
-Run: `node --import tsx --test test/claude-init.test.ts`
-
-- [ ] **Step 5: Add the `init` command to `src/cli.ts`**
-
-Add these imports near the top (match existing import style):
-
-```ts
-import { fileURLToPath } from 'node:url';
-import { resolve } from 'node:path';
-import { runInit } from './claude/init.js';
-```
-
-Add the command (place it alongside the other `.command(...)` blocks, before `program.parseAsync()`):
-
-```ts
-program
- .command('init')
- .description('Set up the Claude Code integration (.claude/ statusline + hooks) in this repo')
- .argument('[dir]', 'target repo directory', '.')
- .option('--no-build', 'skip building the graph (wire files only)')
- .action((dir: string, opts: { build?: boolean }) => {
- const cliPath = fileURLToPath(import.meta.url);
- const res = runInit(resolve(dir), { build: opts.build, cliPath });
- console.error(`✓ wrote ${res.settingsPath}`);
- for (const s of res.shims) console.error(`✓ wrote ${s}`);
- console.error(res.built ? '✓ built the graph (graft build)' : '· skipped graph build');
- for (const w of res.warnings) console.error(`⚠ ${w}`);
- console.error('\nDone. The statusline + hooks activate in Claude Code sessions in this repo.');
- console.error('For LLM summaries: set OPENROUTER_API_KEY and run `graft build --deep`.');
- });
-```
-
-> If `commander`'s `--no-build` mapping is unclear: commander sets `opts.build = false` when `--no-build` is passed and `true` otherwise. `runInit` treats `build !== false` as "build".
-
-- [ ] **Step 6: Build + smoke-test the command in a temp consumer dir**
-
-```bash
-npm run build
-TMP=$(mktemp -d); node dist/cli.js init "$TMP" --no-build; echo "---"; ls -la "$TMP/.claude/helpers"; cat "$TMP/.claude/settings.json" | head -20
-```
-Expected: writes settings + both shims; prints the summary; `--no-build` skips the build.
-
-- [ ] **Step 7: Commit**
-
-```bash
-git add src/claude/init.ts test/claude-init.test.ts src/cli.ts
-git commit -m "feat(cli): graft init — scaffold .claude/ integration into any repo"
-```
-
----
-
-## Task 4: `postinstall` nudge
-
-**Files:**
-- Create: `scripts/postinstall.mjs`
-- Modify: `package.json` (`scripts.postinstall`)
-- Test: `test/claude-init.test.ts` (append a subprocess test)
-
-- [ ] **Step 1: Write the failing test** (append to `test/claude-init.test.ts`)
-
-```ts
-import { execFileSync } from 'node:child_process';
-
-function runPostinstall(env: Record<string, string>): string {
- try {
- return execFileSync(process.execPath, ['scripts/postinstall.mjs'],
- { encoding: 'utf8', env: { ...process.env, ...env } });
- } catch { return ''; }
-}
-
-test('postinstall prints the nudge in a fresh dir', () => {
- const d = fresh();
- const out = runPostinstall({ INIT_CWD: d, CI: '' });
- assert.match(out, /npx graft init/);
-});
-
-test('postinstall is silent when already initialized', () => {
- const d = fresh();
- runInit(d, { build: false });
- const out = runPostinstall({ INIT_CWD: d, CI: '' });
- assert.equal(out.trim(), '');
-});
-
-test('postinstall is silent under CI', () => {
- const out = runPostinstall({ INIT_CWD: fresh(), CI: '1' });
- assert.equal(out.trim(), '');
-});
-```
-
-- [ ] **Step 2: Run test — expect FAIL** (`scripts/postinstall.mjs` missing → catch → '' → nudge assertion fails)
-
-Run: `node --import tsx --test test/claude-init.test.ts`
-
-- [ ] **Step 3: Implement `scripts/postinstall.mjs`**
-
-```js
-// Prints a one-line nudge after install. Never fails the install.
-try {
- if (process.env.CI) process.exit(0);
- const { existsSync } = await import('node:fs');
- const { join } = await import('node:path');
- const dir = process.env.INIT_CWD || process.cwd();
- if (existsSync(join(dir, '.claude', 'helpers', 'graft-statusline.cjs'))) process.exit(0);
- console.log('\n Graft installed. Run `npx graft init` to enable the Claude Code integration (statusline + hooks + auto-sync).\n');
-} catch {
- /* never fail an install */
-}
-```
-
-- [ ] **Step 4: Wire `postinstall` in `package.json`**
-
-Add to `scripts`: `"postinstall": "node scripts/postinstall.mjs"`.
-
-- [ ] **Step 5: Run test — expect PASS (3 new tests)**
-
-Run: `node --import tsx --test test/claude-init.test.ts`
-
-- [ ] **Step 6: Confirm `scripts/` ships in the package**
-
-`package.json` `files` is `["dist", "README.md", "LICENSE"]` — `scripts/` is NOT included, so the published `postinstall` would 404. Add `"scripts"` to `files`:
-
-```json
- "files": ["dist", "scripts", "README.md", "LICENSE"],
-```
-
-Verify: `npm pack --dry-run 2>&1 | grep -E "postinstall|scripts/"` shows `scripts/postinstall.mjs` in the tarball.
-
-- [ ] **Step 7: Commit**
-
-```bash
-git add scripts/postinstall.mjs package.json test/claude-init.test.ts
-git commit -m "feat: postinstall nudge to run graft init (silent in CI / when initialized)"
-```
-
----
-
-## Task 5: Version bump + full verification + consumer smoke
-
-**Files:** Modify `package.json` (version).
-
-- [ ] **Step 1: Full suite green**
-
-Run: `npm test`
-Expected: all `test/*.test.ts` pass (existing `claude-*` + the 3 new files), no regressions.
-
-- [ ] **Step 2: Build clean**
-
-Run: `npm run build`
-Expected: exit 0; `dist/claude/{init,settings-merge,shim-template}.js` present (`ls dist/claude`).
-
-- [ ] **Step 3: Consumer smoke — prove the shim resolves an *installed* package**
-
-Simulate a consumer repo whose `node_modules/@nanonets/graft` points at this build:
-
-```bash
-CONSUMER=$(mktemp -d)
-mkdir -p "$CONSUMER/node_modules/@nanonets"
-ln -s "$PWD" "$CONSUMER/node_modules/@nanonets/graft"
-node dist/cli.js init "$CONSUMER" --no-build
-# drive the written statusline shim as Claude Code would, from the consumer dir:
-CLAUDE_PROJECT_DIR="$CONSUMER" bash -c 'echo "{\"session_id\":\"t\",\"cwd\":\"$CLAUDE_PROJECT_DIR\"}" | node "$CLAUDE_PROJECT_DIR/.claude/helpers/graft-statusline.cjs"'
-```
-Expected: the shim resolves `@nanonets/graft/package.json` from the consumer dir → imports THIS repo's `dist/claude/statusline.js` → renders a graft bar (the consumer has no graph, so it shows `graft · not built · run graft build` — which is the correct, resolved output, proving the package path works). `rm -rf "$CONSUMER"` after.
-
-- [ ] **Step 4: Bump version to 0.3.0**
-
-```bash
-npm version 0.3.0 --no-git-tag-version
-git add package.json package-lock.json 2>/dev/null; git commit -m "chore(release): 0.3.0 — graft init onboarding"
-```
-
-- [ ] **Step 5: Final confirmation for the controller**
-
-Report: full suite green, build clean, consumer smoke resolved the installed-package path, version at 0.3.0. Publishing (security-key 2FA) is a controller/human step, not part of this task.
-
----
-
-## Notes for the implementer
-
-- Never add `--deep` anywhere. `runInit`'s build is plain `graft build`.
-- The consumer shims must resolve the package via `require.resolve('@nanonets/graft/package.json', { paths: [dir] })`, then import the absolute `dist/claude/*.js` — do NOT `import('@nanonets/graft/dist/claude/...')` (blocked by the `exports` map).
-- Keep the merge non-destructive: foreign keys, foreign `statusLine`, and foreign hook entries must survive; Graft entries de-dupe on re-run.
diff --git a/docs/superpowers/plans/2026-07-21-ask-performance.md b/docs/superpowers/plans/2026-07-21-ask-performance.md
deleted file mode 100644
index c95f7c99..00000000
--- a/docs/superpowers/plans/2026-07-21-ask-performance.md
+++ /dev/null
@@ -1,178 +0,0 @@
-# Ask Performance at Scale Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** `graft ask` answers long natural-language queries on a 32k-node graph in well under 2s (today: hangs for minutes), by fixing the PageRank dangling-mass loop and moving per-query corpus tokenization/IDF to build time.
-
-**Architecture:** (1) `personalizedPageRank` gets the standard dangling-mass fix: accumulate escaped mass in a scalar and redistribute once per iteration — identical math, O(nodes+edges+seeds) per iteration instead of O(dangling×seeds). (2) `graft build` emits a sidecar `.graph/index.json` (token bags per node/field + document frequencies + avg body length), and `ask` uses it when present instead of re-tokenizing 32k nodes per query; graphs without a sidecar fall back to the current on-the-fly path. Concept (markdown) docs stay tokenized at query time — there are ~dozens, not 32k.
-
-**Tech Stack:** TypeScript ESM, Node ≥20, node:test + tsx. No new dependencies.
-
-## Global Constraints
-
-- No new npm dependencies; ESM `.js` imports; files under 500 lines.
-- Ranking RESULTS must not change: same scores, same order (the PPR fix is algebraically identical; the sidecar stores exactly what tokenize/counts produce today). Existing ask tests must pass unmodified.
-- Backward compatible: `ask` on a graph without `index.json` works exactly as today (fallback), so old committed graphs keep working.
-- The sidecar is versioned (`{"version": 1, ...}`); an unknown version → fallback path, never a crash.
-- Wall-clock acceptance (measured on the 56MB / 32,377-node graph at `/private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/d3b217f7-4a78-4399-b91a-8bb7db720797/scratchpad/bigrepo-graft`, repo `/Users/shrishdwivedi/Documents/Nanonets/assign`): the query "How does authentication middleware validate incoming API requests in the backend?" with `--source -n 8` completes in < 5s after Task 1, and < 3s after Task 2 (rebuilt graph with sidecar). Record actual numbers in the task reports.
-- No third-party tool names in code/comments/commit messages.
-- Tests: `node --import tsx --test test/<file>.test.ts`.
-
----
-
-## File Structure
-
-- Modify: `src/ask/graphrank.ts` — dangling-mass scalar accumulation.
-- Create: `src/ask/index-file.ts` — sidecar read/write (`writeAskIndex`, `readAskIndex`, types).
-- Modify: `src/graph/build.ts` — call `writeAskIndex` after writing wiring (find where wiring.json is written; the sidecar lands next to it).
-- Modify: `src/ask/ask.ts` — `lexical()` consumes a prebuilt index when available.
-- Tests: `test/graphrank.test.ts` (may exist — extend), `test/ask-index.test.ts`.
-
----
-
-### Task 1: PageRank dangling-mass fix (`src/ask/graphrank.ts`)
-
-**Files:**
-- Modify: `src/ask/graphrank.ts` (lines ~84-101, the power-iteration loop)
-- Test: extend the existing graphrank/ask test file if present, else create `test/graphrank.test.ts`
-
-**Interfaces:** `personalizedPageRank(graph, seeds, opts)` signature and semantics unchanged.
-
-- [ ] **Step 1: Write the failing tests** (create or extend `test/graphrank.test.ts`)
-
-```ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { personalizedPageRank } from '../src/ask/graphrank.js';
-import type { GraphV1 } from '../src/graph/types.js';
-
-function nodeStub(id: string): any {
- return { id, name: id, kind: 'function', path: 'x.ts', span: 'L1-L1', signature: null,
- exported: true, origin: 'ast', body_hash: 'h', summary_state: 'pending', summary: null, crux: null };
-}
-function graphOf(nodeIds: string[], edges: Array<[string, string]>): GraphV1 {
- return {
- version: 1,
- nodes: nodeIds.map(nodeStub),
- edges: edges.map(([source, target]) => ({ source, target, relation: 'calls', confidence: 'extracted' })),
- } as any;
-}
-
-test('results identical to the reference implementation on a small graph', () => {
- // 5 nodes: a-b-c chain, d dangling with seed mass, e isolated non-seed.
- const g = graphOf(['a', 'b', 'c', 'd', 'e'], [['a', 'b'], ['b', 'c']]);
- const seeds = new Map([['a', 2], ['d', 1]]);
- const out = personalizedPageRank(g, seeds);
- // Reference values computed with the pre-fix implementation (identical math):
- // run the OLD code once (git stash the fix) to capture expected values, then
- // hard-code them here with a tolerance:
- // assert.ok(Math.abs(out.get('a')! - EXPECTED_A) < 1e-9) ... for a,b,c,d
- // The top-ranked node must be 'a' (seed + connected) with score 1.
- assert.equal(out.get('a'), 1);
- assert.ok((out.get('b') ?? 0) > 0);
- assert.ok((out.get('d') ?? 0) > 0, 'dangling seed keeps mass');
- assert.equal(out.get('e'), undefined, 'unreached node absent');
-});
-
-test('broad seeds on a large mostly-dangling graph complete fast', () => {
- // 20k dangling nodes (no edges) + 100 connected ones; seed EVERY node —
- // the pathological shape from real 32k-node graphs with common-word queries.
- const ids = Array.from({ length: 20000 }, (_, i) => `n${i}`);
- const edges: Array<[string, string]> = [];
- for (let i = 0; i < 100; i++) edges.push([`n${i}`, `n${i + 1}`]);
- const g = graphOf(ids, edges);
- const seeds = new Map(ids.map((id) => [id, 1]));
- const t0 = Date.now();
- const out = personalizedPageRank(g, seeds);
- const ms = Date.now() - t0;
- assert.ok(out.size > 0);
- assert.ok(ms < 3000, `took ${ms}ms — dangling redistribution must not be O(dangling × seeds)`);
-});
-```
-
-Implementer note for the first test: before applying the fix, run the CURRENT code to capture exact expected scores for nodes a/b/c/d and bake them into the test as high-precision constants. That is what proves the fix is algebraically identical.
-
-- [ ] **Step 2: Run to verify** — the timing test FAILS (takes minutes) against current code; kill after the assertion timeout proves the point (use the 3s assertion, run with a generous test timeout).
-
-- [ ] **Step 3: Implement the fix** — replace the per-dangling-node redistribution in the iteration loop:
-
-```ts
- // Power iteration from the restart distribution.
- let rank = new Map(restart);
- for (let i = 0; i < iters; i++) {
- const next = new Map<string, number>();
- // Teleport: every step, alpha of the mass returns to the seed set.
- for (const [id, r] of restart) next.set(id, alpha * r);
- // Dangling mass (nodes with no walk edges) is pooled and returned to the
- // seed set ONCE per iteration — same math as redistributing per node, but
- // O(nodes + seeds) instead of O(dangling × seeds).
- let dangling = 0;
- for (const [id, mass] of rank) {
- const nbrs = adj.get(id);
- if (!nbrs || nbrs.length === 0) {
- dangling += mass;
- continue;
- }
- const share = ((1 - alpha) * mass) / nbrs.length;
- for (const nb of nbrs) next.set(nb, (next.get(nb) ?? 0) + share);
- }
- if (dangling > 0) {
- const dm = (1 - alpha) * dangling;
- for (const [sid, r] of restart) next.set(sid, (next.get(sid) ?? 0) + dm * r);
- }
- rank = next;
- }
-```
-
-- [ ] **Step 4: Run tests + full suite; then the acceptance measurement** — time the previously-hanging query on the big graph (command in Global Constraints); record the number. Expected: seconds, not minutes.
-
-- [ ] **Step 5: Commit** — `fix(ask): pool dangling PageRank mass — O(dangling×seeds) hang on broad queries`
-
----
-
-### Task 2: Build-time ask index sidecar
-
-**Files:**
-- Create: `src/ask/index-file.ts`
-- Modify: `src/graph/build.ts` (write sidecar after wiring), `src/ask/ask.ts` (consume it)
-- Test: `test/ask-index.test.ts`
-
-**Interfaces:**
-- `interface AskIndexDoc { id: string; name: [string, number][]; path: [string, number][]; body: [string, number][] }` (token→count entries)
-- `interface AskIndex { version: 1; avgBodyLen: number; df: [string, number][]; docCount: number; docs: AskIndexDoc[] }`
-- `writeAskIndex(outDir: string, graph: GraphV1): string` — tokenizes exactly like `ask.ts` does today (import/share the SAME `tokenize`/`counts` — export them from ask.ts or move both into index-file.ts and import back; one source of truth) and writes `<outDir>/.graph/index.json`. Returns the path.
-- `readAskIndex(outDir: string): AskIndex | null` — null on missing/unparseable/unknown-version.
-- In `ask.ts` `lexical()`: when `readAskIndex` returns data covering the current graph (same doc count as `graph.nodes.length` — cheap staleness guard; on mismatch, fall back), build `symbolDocs` maps from the sidecar instead of tokenizing; IDF comes from stored `df` + concept doc bags (concepts still tokenized live and merged into df counts the same way `computeIdf` sees them today — keep the resulting idf values identical; if exact parity with stored-df-plus-live-concepts is not achievable, store df WITHOUT concepts and add concept bags at query time before computing idf, which reproduces today's inputs exactly).
-- `graft build` prints the sidecar in its output (`→ ...` line already prints the dir; no new output needed beyond the report).
-
-- [ ] **Step 1: Write failing tests** covering: (a) `writeAskIndex`+`readAskIndex` round-trip equals live tokenization (build both ways on a small fixture graph and deep-equal the doc maps); (b) `ask` results IDENTICAL with and without the sidecar on a built fixture repo (run `lexical` twice — sidecar present vs renamed away — same hits, same scores); (c) unknown version → fallback (no crash, same results); (d) stale sidecar (docCount mismatch) → fallback.
-
-- [ ] **Step 2: Verify failure, implement, verify pass, full suite green.**
-
-- [ ] **Step 3: Acceptance measurement** — rebuild the big graph (`node dist/cli.js --dir <scratch> build <assign repo>`), then time the long query again; record build-time delta (sidecar write) and ask-time improvement in the report.
-
-- [ ] **Step 4: Commit** — `feat(ask): build-time token/IDF index sidecar — ask stops re-tokenizing the corpus per query`
-
----
-
-### Task 3: Verification + docs
-
-**Files:**
-- Modify: `README.md` (only if numbers/claims need updating — the "What runs where"/ask sections make no latency claims today; add none without measurements).
-- No code.
-
-- [ ] **Step 1:** Full suite + build. Run the three A/B queries from the benchmark session on the big graph, timed, and record: short query, medium query, long query — before/after table in the task report (before-numbers from this plan's context: 1.2-1.5s short/medium, hang on long).
-- [ ] **Step 2:** Run `graft ask` on the graft repo itself (small graph) — confirm no regression (<0.5s).
-- [ ] **Step 3:** Commit any doc touch-ups: `docs: note ask index sidecar in build output docs` (skip commit if no changes).
-
-## Out of scope
-
-- Removing `body_text` from `wiring.json` (moving it fully into the sidecar) — biggest remaining parse win, but it changes the graph schema consumed by other readers; separate plan after this lands.
-- Frontier-capped PageRank — unnecessary once the dangling fix lands (25 iterations over 72k edges is ~ms).
-
-## Self-Review
-
-- The hang's root cause (dangling×seeds) is fixed by Task 1 with an equivalence test against captured reference values. ✓
-- The 45% tokenization tax is removed by Task 2 with result-parity tests both ways. ✓
-- Fallback keeps old graphs working; version field future-proofs. ✓
-- No placeholders: Task 1 has full code; Task 2's types and parity strategy are fully specified with the one open detail (df-with-concepts parity) given an exact resolution path. ✓
diff --git a/docs/superpowers/plans/2026-07-21-graft-mcp.md b/docs/superpowers/plans/2026-07-21-graft-mcp.md
deleted file mode 100644
index fa976e68..00000000
--- a/docs/superpowers/plans/2026-07-21-graft-mcp.md
+++ /dev/null
@@ -1,689 +0,0 @@
-# Graft MCP Server (Phase 2) Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** `graft mcp` — a zero-dependency stdio MCP server exposing `graft_ask`, `graft_check`, `graft_blast_radius` as first-class tools — plus automatic per-host server registration during `graft init`.
-
-**Architecture:** A hand-rolled newline-delimited JSON-RPC 2.0 loop over stdio (`src/mcp/server.ts`) dispatching to three pure tool functions (`src/mcp/tools.ts`) that wrap the existing engine. Host registration lives in `src/hosts/mcp-config.ts`: keyed JSON merges for repo-local configs and an append-if-absent TOML section for the one host that uses TOML globally. `runHostsInit` gains an `mcp` step so `graft init` registers the server for selected hosts; `--no-mcp` opts out.
-
-**Tech Stack:** TypeScript ESM, Node ≥20, `node:test` + tsx. **No new dependencies** — the MCP stdio framing is newline-delimited JSON-RPC, implementable in ~120 lines.
-
-## Global Constraints
-
-- No new npm dependencies. Node ≥20 ESM; imports use `.js` extensions. Files under 500 lines.
-- stdout of the MCP server carries ONLY newline-delimited JSON-RPC messages; all logging goes to stderr.
-- JSON config writes: parse-tolerant of a missing file (treat as `{}`); an unparseable existing file is NEVER overwritten — skip with action `skipped-unparseable`.
-- Idempotent: re-running init converges; a second run reports `unchanged` for every MCP config.
-- Registered server command is exactly: `npx -y @nanonets/graft mcp` (works on every machine without global install).
-- Global (home-dir) writes are gated on the host's config dir actually existing; repo-local writes follow the explicit/detected selection.
-- No third-party tool names in code comments, docs, or commit messages (host ids and file paths are fine).
-- Tests: `node --import tsx --test test/<file>.test.ts`, temp dirs, injectable `home`.
-
----
-
-## File Structure
-
-- Create: `src/mcp/tools.ts` — three tool implementations + their JSON Schemas.
-- Create: `src/mcp/server.ts` — JSON-RPC stdio loop.
-- Create: `src/hosts/mcp-config.ts` — per-host registration writers.
-- Modify: `src/hosts/init.ts` — add `mcp` step to `runHostsInit`.
-- Modify: `src/cli.ts` — new `mcp` command; `init` gains `--no-mcp`.
-- Modify: `README.md` — MCP subsection under "Agent integration".
-- Tests: `test/mcp-tools.test.ts`, `test/mcp-server.test.ts`, `test/hosts-mcp-config.test.ts` (+ extend `test/hosts-init.test.ts`).
-
----
-
-### Task 1: Tool implementations (`src/mcp/tools.ts`)
-
-**Files:**
-- Create: `src/mcp/tools.ts`
-- Test: `test/mcp-tools.test.ts`
-
-**Interfaces:**
-- Consumes (existing code): `Graft` from `../engine.js`; `formatAsk` from `../ask/ask.js`; `formatCheckReport` from `../context/check.js`; `formatGraphCheckReport` from `../graph/check.js`; `formatBlastRadius` from `../claude/format.js`; `readGraph`, `GRAPH_FILE` from `../graph/write.js`; `contextDirFor` from `../context/node-file.js`.
-- Produces:
- - `interface ToolDef { name: string; description: string; inputSchema: object }`
- - `TOOLS: ToolDef[]` — names exactly `graft_ask`, `graft_check`, `graft_blast_radius`.
- - `callTool(root: string, name: string, args: Record<string, unknown>): { text: string; isError: boolean }` — never throws; unknown tool → `isError: true`.
-
-- [ ] **Step 1: Write the failing tests**
-
-```ts
-// test/mcp-tools.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { mkdtempSync, mkdirSync, writeFileSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { execFileSync } from 'node:child_process';
-import { TOOLS, callTool } from '../src/mcp/tools.js';
-
-function builtRepo(): string {
- const d = mkdtempSync(join(tmpdir(), 'graft-mcptools-'));
- mkdirSync(join(d, 'src'), { recursive: true });
- writeFileSync(join(d, 'src', 'math.ts'),
- 'export function add(a: number, b: number): number {\n return a + b;\n}\nexport function sub(a: number, b: number): number {\n return add(a, -b);\n}\n');
- execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'build', d], { stdio: 'pipe' });
- return d;
-}
-
-test('TOOLS lists the three tools with schemas', () => {
- assert.deepEqual(TOOLS.map((t) => t.name), ['graft_ask', 'graft_check', 'graft_blast_radius']);
- for (const t of TOOLS) {
- assert.ok(t.description.length > 0);
- assert.equal((t.inputSchema as { type: string }).type, 'object');
- }
-});
-
-test('graft_ask returns ranked hits for a built repo', () => {
- const d = builtRepo();
- const r = callTool(d, 'graft_ask', { query: 'how do I add numbers' });
- assert.equal(r.isError, false);
- assert.match(r.text, /add/);
- assert.match(r.text, /src\/math\.ts/);
-});
-
-test('graft_check reports the wiring state', () => {
- const d = builtRepo();
- const r = callTool(d, 'graft_check', {});
- assert.equal(r.isError, false);
- assert.match(r.text, /graph check: OK/);
-});
-
-test('graft_blast_radius names dependents of a file', () => {
- const d = builtRepo();
- const r = callTool(d, 'graft_blast_radius', { file: 'src/math.ts' });
- assert.equal(r.isError, false);
- assert.ok(r.text.length > 0);
-});
-
-test('unbuilt repo and unknown tool are soft errors', () => {
- const bare = mkdtempSync(join(tmpdir(), 'graft-mcptools-bare-'));
- const r1 = callTool(bare, 'graft_blast_radius', { file: 'x.ts' });
- assert.equal(r1.isError, true);
- assert.match(r1.text, /graft build/);
- const r2 = callTool(bare, 'nope', {});
- assert.equal(r2.isError, true);
- assert.match(r2.text, /unknown tool/i);
-});
-```
-
-- [ ] **Step 2: Run to verify failure**
-
-Run: `node --import tsx --test test/mcp-tools.test.ts`
-Expected: FAIL — `Cannot find module '../src/mcp/tools.js'`
-
-- [ ] **Step 3: Implement**
-
-```ts
-// src/mcp/tools.ts
-/**
- * The three MCP tools, as pure functions over the existing engine.
- * `callTool` never throws — hosts get soft errors as isError content.
- */
-import { join } from 'node:path';
-import { Graft } from '../engine.js';
-import { formatAsk } from '../ask/ask.js';
-import { formatCheckReport } from '../context/check.js';
-import { formatGraphCheckReport } from '../graph/check.js';
-import { formatBlastRadius } from '../claude/format.js';
-import { readGraph, GRAPH_FILE } from '../graph/write.js';
-import { contextDirFor } from '../context/node-file.js';
-
-export interface ToolDef {
- name: string;
- description: string;
- inputSchema: object;
-}
-
-export const TOOLS: ToolDef[] = [
- {
- name: 'graft_ask',
- description:
- 'Query the repo context graph in plain words. Returns ranked nodes with exact file:line spans and the relevant source inlined — usually the full answer, no file reads needed.',
- inputSchema: {
- type: 'object',
- properties: {
- query: { type: 'string', description: 'what you want to understand, in plain words' },
- limit: { type: 'number', description: 'max results (default 5)' },
- },
- required: ['query'],
- },
- },
- {
- name: 'graft_check',
- description: 'Report whether the committed graph is in sync with the code (drift check).',
- inputSchema: { type: 'object', properties: {} },
- },
- {
- name: 'graft_blast_radius',
- description: 'List what depends on a file — who breaks if it changes.',
- inputSchema: {
- type: 'object',
- properties: { file: { type: 'string', description: 'repo-relative path, e.g. src/cache.ts' } },
- required: ['file'],
- },
- },
-];
-
-export function callTool(
- root: string,
- name: string,
- args: Record<string, unknown>,
-): { text: string; isError: boolean } {
- try {
- switch (name) {
- case 'graft_ask': {
- const query = String(args.query ?? '');
- if (!query) return { text: 'graft_ask requires a query', isError: true };
- const limit = typeof args.limit === 'number' ? args.limit : 5;
- const engine = new Graft();
- const r = engine.ask(root, query, { limit, source: true });
- return { text: formatAsk(r), isError: false };
- }
- case 'graft_check': {
- const engine = new Graft();
- const r = engine.check(root);
- const g = engine.checkGraph(root);
- const parts = [formatCheckReport(r)];
- if (!g.missing) parts.push(formatGraphCheckReport(g));
- return { text: parts.join('\n\n'), isError: false };
- }
- case 'graft_blast_radius': {
- const file = String(args.file ?? '');
- if (!file) return { text: 'graft_blast_radius requires a file', isError: true };
- const w = readGraph(join(contextDirFor(root, undefined), GRAPH_FILE));
- if (!w) return { text: 'no graph found — run `graft build` first', isError: true };
- const br = formatBlastRadius(w, file);
- return { text: br ?? `no known dependents of ${file}`, isError: false };
- }
- default:
- return { text: `unknown tool: ${name}`, isError: true };
- }
- } catch (err) {
- return { text: err instanceof Error ? err.message : String(err), isError: true };
- }
-}
-```
-
-Note for the implementer: check `contextDirFor`'s actual signature in `src/context/node-file.ts` — if the second parameter is optional, call it as `contextDirFor(root)`.
-
-- [ ] **Step 4: Run to verify pass**
-
-Run: `node --import tsx --test test/mcp-tools.test.ts`
-Expected: PASS (5 tests)
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/mcp/tools.ts test/mcp-tools.test.ts
-git commit -m "feat(mcp): graft_ask / graft_check / graft_blast_radius tool implementations"
-```
-
----
-
-### Task 2: Stdio server + CLI command (`src/mcp/server.ts`)
-
-**Files:**
-- Create: `src/mcp/server.ts`
-- Modify: `src/cli.ts` — add the `mcp` command after `viz`.
-- Test: `test/mcp-server.test.ts`
-
-**Interfaces:**
-- Consumes: `TOOLS`, `callTool` (Task 1).
-- Produces: `startMcpServer(root: string): void` — reads newline-delimited JSON-RPC 2.0 from stdin, writes responses to stdout. Methods: `initialize`, `notifications/initialized` (ignored), `ping`, `tools/list`, `tools/call`. Unknown method with an id → error `-32601`; parse failure → error `-32700` (id null). CLI: `graft mcp [dir]`.
-
-- [ ] **Step 1: Write the failing test**
-
-```ts
-// test/mcp-server.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { spawn } from 'node:child_process';
-import { mkdtempSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { once } from 'node:events';
-
-async function rpc(messages: object[], dir: string, expected: number): Promise<any[]> {
- const child = spawn(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'mcp', dir], { stdio: ['pipe', 'pipe', 'pipe'] });
- const responses: any[] = [];
- let buf = '';
- child.stdout.on('data', (d) => {
- buf += d.toString();
- let i;
- while ((i = buf.indexOf('\n')) !== -1) {
- const line = buf.slice(0, i).trim();
- buf = buf.slice(i + 1);
- if (line) responses.push(JSON.parse(line));
- }
- });
- for (const m of messages) child.stdin.write(`${JSON.stringify(m)}\n`);
- const deadline = Date.now() + 15000;
- while (responses.length < expected && Date.now() < deadline) await new Promise((r) => setTimeout(r, 50));
- child.kill();
- await once(child, 'exit').catch(() => {});
- return responses;
-}
-
-test('initialize → tools/list → tools/call round-trip', async () => {
- const dir = mkdtempSync(join(tmpdir(), 'graft-mcpsrv-'));
- const rs = await rpc(
- [
- { jsonrpc: '2.0', id: 1, method: 'initialize', params: { protocolVersion: '2025-03-26', capabilities: {}, clientInfo: { name: 't', version: '0' } } },
- { jsonrpc: '2.0', method: 'notifications/initialized' },
- { jsonrpc: '2.0', id: 2, method: 'tools/list' },
- { jsonrpc: '2.0', id: 3, method: 'tools/call', params: { name: 'graft_blast_radius', arguments: { file: 'x.ts' } } },
- ],
- dir,
- 3,
- );
- assert.equal(rs.length, 3);
- const init = rs.find((r) => r.id === 1);
- assert.equal(init.result.protocolVersion, '2025-03-26');
- assert.ok(init.result.capabilities.tools);
- assert.equal(init.result.serverInfo.name, 'graft');
- const list = rs.find((r) => r.id === 2);
- assert.deepEqual(list.result.tools.map((t: any) => t.name), ['graft_ask', 'graft_check', 'graft_blast_radius']);
- const call = rs.find((r) => r.id === 3);
- assert.equal(call.result.isError, true); // unbuilt repo → soft error content
- assert.match(call.result.content[0].text, /graft build/);
-});
-
-test('unknown method returns -32601', async () => {
- const dir = mkdtempSync(join(tmpdir(), 'graft-mcpsrv2-'));
- const rs = await rpc([{ jsonrpc: '2.0', id: 9, method: 'resources/list' }], dir, 1);
- assert.equal(rs[0].error.code, -32601);
-});
-```
-
-- [ ] **Step 2: Run to verify failure**
-
-Run: `node --import tsx --test test/mcp-server.test.ts`
-Expected: FAIL — the CLI has no `mcp` command yet (commander error on stderr, no responses → assertion failure).
-
-- [ ] **Step 3: Implement the server**
-
-```ts
-// src/mcp/server.ts
-/**
- * Minimal MCP stdio server: newline-delimited JSON-RPC 2.0.
- * stdout carries protocol messages ONLY; diagnostics go to stderr.
- */
-import { createInterface } from 'node:readline';
-import { TOOLS, callTool } from './tools.js';
-
-function send(msg: object): void {
- process.stdout.write(`${JSON.stringify(msg)}\n`);
-}
-
-function reply(id: unknown, result: object): void {
- send({ jsonrpc: '2.0', id, result });
-}
-
-function replyError(id: unknown, code: number, message: string): void {
- send({ jsonrpc: '2.0', id, error: { code, message } });
-}
-
-export function startMcpServer(root: string): void {
- const rl = createInterface({ input: process.stdin, crlfDelay: Infinity });
- rl.on('line', (line) => {
- const text = line.trim();
- if (!text) return;
- let msg: { id?: unknown; method?: string; params?: Record<string, any> };
- try {
- msg = JSON.parse(text);
- } catch {
- replyError(null, -32700, 'parse error');
- return;
- }
- const { id, method, params } = msg;
- const isNotification = id === undefined;
- switch (method) {
- case 'initialize':
- reply(id, {
- protocolVersion: params?.protocolVersion ?? '2024-11-05',
- capabilities: { tools: {} },
- serverInfo: { name: 'graft', version: '0' },
- });
- return;
- case 'notifications/initialized':
- case 'notifications/cancelled':
- return; // notifications get no response
- case 'ping':
- if (!isNotification) reply(id, {});
- return;
- case 'tools/list':
- if (!isNotification) {
- reply(id, { tools: TOOLS.map((t) => ({ name: t.name, description: t.description, inputSchema: t.inputSchema })) });
- }
- return;
- case 'tools/call': {
- if (isNotification) return;
- const name = String(params?.name ?? '');
- const args = (params?.arguments ?? {}) as Record<string, unknown>;
- const r = callTool(root, name, args);
- reply(id, { content: [{ type: 'text', text: r.text }], isError: r.isError });
- return;
- }
- default:
- if (!isNotification) replyError(id, -32601, `method not found: ${method}`);
- }
- });
- process.stdin.on('end', () => process.exit(0));
-}
-```
-
-- [ ] **Step 4: Wire the CLI command** (in `src/cli.ts`, after the `viz` command)
-
-```ts
-program
- .command("mcp")
- .description("Serve the graph over MCP (stdio) — exposes graft_ask / graft_check / graft_blast_radius as tools")
- .argument("[dir]", "repository root", ".")
- .action(async (dir: string) => {
- const { resolve } = await import("node:path");
- const { startMcpServer } = await import("./mcp/server.js");
- startMcpServer(resolve(dir));
- });
-```
-
-- [ ] **Step 5: Run the new test, then the full suite**
-
-Run: `node --import tsx --test test/mcp-server.test.ts` → PASS (2 tests)
-Run: `node --import tsx --test test/*.test.ts` → all green.
-
-- [ ] **Step 6: Commit**
-
-```bash
-git add src/mcp/server.ts src/cli.ts test/mcp-server.test.ts
-git commit -m "feat(mcp): stdio JSON-RPC server + graft mcp CLI command"
-```
-
----
-
-### Task 3: Host registration writers (`src/hosts/mcp-config.ts`)
-
-**Files:**
-- Create: `src/hosts/mcp-config.ts`
-- Test: `test/hosts-mcp-config.test.ts`
-
-**Interfaces:**
-- Produces:
- - `interface McpWrite { id: string; path: string; action: 'created' | 'updated' | 'unchanged' | 'skipped-unparseable' }`
- - `registerMcpConfigs(repo: string, ids: string[], opts?: { home?: string }): McpWrite[]`
- - Mapping (id → write): `cursor` → `<repo>/.cursor/mcp.json` under `mcpServers.graft`; `gemini` → `<repo>/.gemini/settings.json` under `mcpServers.graft`; `kiro` → `<repo>/.kiro/settings/mcp.json` under `mcpServers.graft`; `agents` → two gated writes: `<repo>/opencode.json` under `mcp.graft` as `{ type: 'local', command: ['npx','-y','@nanonets/graft','mcp'], enabled: true }` ONLY if `<home>/.config/opencode` exists, and `<home>/.codex/config.toml` appended `[mcp_servers.graft]` section ONLY if `<home>/.codex` exists. Ids without a mapping (`copilot`, `windsurf`, `claude`) produce no writes.
- - JSON entry value for `mcpServers.graft`: `{ command: 'npx', args: ['-y', '@nanonets/graft', 'mcp'] }`.
-
-- [ ] **Step 1: Write the failing tests**
-
-```ts
-// test/hosts-mcp-config.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { mkdtempSync, mkdirSync, readFileSync, writeFileSync, existsSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { registerMcpConfigs } from '../src/hosts/mcp-config.js';
-
-function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-mcpcfg-')); }
-
-test('cursor/gemini/kiro get repo-local JSON entries', () => {
- const repo = fresh(); const home = fresh();
- const w = registerMcpConfigs(repo, ['cursor', 'gemini', 'kiro'], { home });
- assert.deepEqual(w.map((x) => x.action), ['created', 'created', 'created']);
- const cursor = JSON.parse(readFileSync(join(repo, '.cursor', 'mcp.json'), 'utf8'));
- assert.deepEqual(cursor.mcpServers.graft, { command: 'npx', args: ['-y', '@nanonets/graft', 'mcp'] });
- assert.ok(existsSync(join(repo, '.gemini', 'settings.json')));
- assert.ok(existsSync(join(repo, '.kiro', 'settings', 'mcp.json')));
-});
-
-test('existing config keys are preserved; re-run is unchanged', () => {
- const repo = fresh(); const home = fresh();
- mkdirSync(join(repo, '.cursor'), { recursive: true });
- writeFileSync(join(repo, '.cursor', 'mcp.json'), JSON.stringify({ mcpServers: { other: { command: 'x' } } }));
- registerMcpConfigs(repo, ['cursor'], { home });
- const cfg = JSON.parse(readFileSync(join(repo, '.cursor', 'mcp.json'), 'utf8'));
- assert.ok(cfg.mcpServers.other, 'foreign server preserved');
- assert.ok(cfg.mcpServers.graft);
- const again = registerMcpConfigs(repo, ['cursor'], { home });
- assert.deepEqual(again.map((x) => x.action), ['unchanged']);
-});
-
-test('unparseable JSON is never clobbered', () => {
- const repo = fresh(); const home = fresh();
- mkdirSync(join(repo, '.cursor'), { recursive: true });
- writeFileSync(join(repo, '.cursor', 'mcp.json'), '{ not json');
- const w = registerMcpConfigs(repo, ['cursor'], { home });
- assert.deepEqual(w.map((x) => x.action), ['skipped-unparseable']);
- assert.equal(readFileSync(join(repo, '.cursor', 'mcp.json'), 'utf8'), '{ not json');
-});
-
-test('agents id: codex TOML + opencode JSON, gated on home dirs', () => {
- const repo = fresh(); const home = fresh();
- assert.deepEqual(registerMcpConfigs(repo, ['agents'], { home }), [], 'nothing without home dirs');
- mkdirSync(join(home, '.codex'), { recursive: true });
- mkdirSync(join(home, '.config', 'opencode'), { recursive: true });
- const w = registerMcpConfigs(repo, ['agents'], { home });
- assert.equal(w.length, 2);
- const toml = readFileSync(join(home, '.codex', 'config.toml'), 'utf8');
- assert.match(toml, /^\[mcp_servers\.graft\]$/m);
- assert.match(toml, /"@nanonets\/graft"/);
- const oc = JSON.parse(readFileSync(join(repo, 'opencode.json'), 'utf8'));
- assert.equal(oc.mcp.graft.type, 'local');
- const again = registerMcpConfigs(repo, ['agents'], { home });
- assert.deepEqual(again.map((x) => x.action).sort(), ['unchanged', 'unchanged']);
-});
-
-test('codex TOML append preserves existing content', () => {
- const repo = fresh(); const home = fresh();
- mkdirSync(join(home, '.codex'), { recursive: true });
- writeFileSync(join(home, '.codex', 'config.toml'), 'model = "o3"\n\n[mcp_servers.other]\ncommand = "x"\n');
- registerMcpConfigs(repo, ['agents'], { home });
- const toml = readFileSync(join(home, '.codex', 'config.toml'), 'utf8');
- assert.match(toml, /model = "o3"/);
- assert.match(toml, /\[mcp_servers\.other\]/);
- assert.match(toml, /\[mcp_servers\.graft\]/);
-});
-```
-
-- [ ] **Step 2: Run to verify failure**
-
-Run: `node --import tsx --test test/hosts-mcp-config.test.ts`
-Expected: FAIL — module not found.
-
-- [ ] **Step 3: Implement**
-
-```ts
-// src/hosts/mcp-config.ts
-/**
- * Register the graft MCP server in each host's config.
- * JSON hosts get a keyed merge (other servers preserved; unparseable files
- * are never rewritten). The TOML host gets an append-if-absent section.
- */
-import { readFileSync, writeFileSync, mkdirSync, existsSync, statSync } from 'node:fs';
-import { dirname, join } from 'node:path';
-import { homedir } from 'node:os';
-
-export interface McpWrite {
- id: string;
- path: string;
- action: 'created' | 'updated' | 'unchanged' | 'skipped-unparseable';
-}
-
-const SERVER_ENTRY = { command: 'npx', args: ['-y', '@nanonets/graft', 'mcp'] };
-const OPENCODE_ENTRY = { type: 'local', command: ['npx', '-y', '@nanonets/graft', 'mcp'], enabled: true };
-
-function dirExists(p: string): boolean {
- try { return statSync(p).isDirectory(); } catch { return false; }
-}
-
-function mergeJsonKey(id: string, path: string, topKey: string, entry: object): McpWrite {
- let root: Record<string, any> = {};
- const existed = existsSync(path);
- if (existed) {
- try {
- root = JSON.parse(readFileSync(path, 'utf8'));
- } catch {
- return { id, path, action: 'skipped-unparseable' };
- }
- }
- const bucket = (root[topKey] ??= {});
- if (JSON.stringify(bucket.graft) === JSON.stringify(entry)) return { id, path, action: 'unchanged' };
- const action = bucket.graft === undefined && !existed ? 'created' : existed ? 'updated' : 'created';
- bucket.graft = entry;
- mkdirSync(dirname(path), { recursive: true });
- writeFileSync(path, `${JSON.stringify(root, null, 2)}\n`);
- return { id, path, action };
-}
-
-function upsertCodexToml(id: string, path: string): McpWrite {
- const existed = existsSync(path);
- const text = existed ? readFileSync(path, 'utf8') : '';
- if (/^\[mcp_servers\.graft\]$/m.test(text)) return { id, path, action: 'unchanged' };
- const section = `[mcp_servers.graft]\ncommand = "npx"\nargs = ["-y", "@nanonets/graft", "mcp"]\n`;
- const sep = text.length === 0 ? '' : text.endsWith('\n') ? '\n' : '\n\n';
- mkdirSync(dirname(path), { recursive: true });
- writeFileSync(path, `${text}${sep}${section}`);
- return { id, path, action: existed ? 'updated' : 'created' };
-}
-
-export function registerMcpConfigs(
- repo: string,
- ids: string[],
- opts: { home?: string } = {},
-): McpWrite[] {
- const home = opts.home ?? homedir();
- const out: McpWrite[] = [];
- for (const id of ids) {
- switch (id) {
- case 'cursor':
- out.push(mergeJsonKey(id, join(repo, '.cursor', 'mcp.json'), 'mcpServers', SERVER_ENTRY));
- break;
- case 'gemini':
- out.push(mergeJsonKey(id, join(repo, '.gemini', 'settings.json'), 'mcpServers', SERVER_ENTRY));
- break;
- case 'kiro':
- out.push(mergeJsonKey(id, join(repo, '.kiro', 'settings', 'mcp.json'), 'mcpServers', SERVER_ENTRY));
- break;
- case 'agents':
- if (dirExists(join(home, '.codex'))) {
- out.push(upsertCodexToml('codex', join(home, '.codex', 'config.toml')));
- }
- if (dirExists(join(home, '.config', 'opencode'))) {
- out.push(mergeJsonKey('opencode', join(repo, 'opencode.json'), 'mcp', OPENCODE_ENTRY));
- }
- break;
- default:
- break; // copilot / windsurf / claude: no MCP target in this phase
- }
- }
- return out;
-}
-```
-
-- [ ] **Step 4: Run to verify pass**
-
-Run: `node --import tsx --test test/hosts-mcp-config.test.ts` → PASS (5 tests)
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/hosts/mcp-config.ts test/hosts-mcp-config.test.ts
-git commit -m "feat(hosts): MCP server registration writers (JSON keyed merge + TOML append)"
-```
-
----
-
-### Task 4: Init integration + README
-
-**Files:**
-- Modify: `src/hosts/init.ts` — add `mcp` option (default on) and results.
-- Modify: `src/cli.ts` — `init` gains `--no-mcp`; prints MCP writes.
-- Modify: `README.md` — MCP subsection.
-- Test: extend `test/hosts-init.test.ts`.
-
-**Interfaces:**
-- Consumes: `registerMcpConfigs`, `McpWrite` (Task 3).
-- Produces: `runHostsInit(repo, { agents?, all?, home?, mcp?: boolean })` → result gains `mcp: McpWrite[]` (empty when `mcp: false`). MCP registration runs for the SAME selected host ids as the instruction files.
-
-- [ ] **Step 1: Write the failing tests** (append to `test/hosts-init.test.ts`)
-
-```ts
-test('runHostsInit registers MCP configs for selected hosts', () => {
- const home = fresh(); const repo = fresh();
- const r = runHostsInit(repo, { home, agents: ['cursor'] });
- assert.equal(r.mcp.length, 1);
- assert.match(r.mcp[0].path, /\.cursor\/mcp\.json$/);
- const cfg = JSON.parse(readFileSync(join(repo, '.cursor', 'mcp.json'), 'utf8'));
- assert.equal(cfg.mcpServers.graft.command, 'npx');
-});
-
-test('mcp: false skips MCP registration', () => {
- const home = fresh(); const repo = fresh();
- const r = runHostsInit(repo, { home, agents: ['cursor'], mcp: false });
- assert.deepEqual(r.mcp, []);
- assert.ok(!existsSync(join(repo, '.cursor', 'mcp.json')));
-});
-
-test('CLI: --no-mcp writes the rule file but no MCP config', () => {
- const repo = fresh();
- execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'init', repo, '--no-build', '--agents', 'cursor', '--no-mcp'], { encoding: 'utf8' });
- assert.ok(existsSync(join(repo, '.cursor', 'rules', 'graft.mdc')));
- assert.ok(!existsSync(join(repo, '.cursor', 'mcp.json')));
-});
-```
-
-- [ ] **Step 2: Run to verify failure**
-
-Run: `node --import tsx --test test/hosts-init.test.ts`
-Expected: FAIL — `r.mcp` undefined / unknown option `--no-mcp`.
-
-- [ ] **Step 3: Implement**
-
-In `src/hosts/init.ts`: import `registerMcpConfigs`, `McpWrite` from `./mcp-config.js`; add `mcp: McpWrite[]` to `HostsInitResult`; extend opts with `mcp?: boolean`; after the instruction-file loop:
-
-```ts
-const mcp = opts.mcp === false ? [] : registerMcpConfigs(repo, selected.map((h) => h.id), { home });
-return { written, skipped, unknown, mcp };
-```
-
-In `src/cli.ts` init command: add `.option("--no-mcp", "skip MCP server registration for other agents")`, pass `mcp: opts.mcp` into `runHostsInit`, and after the instruction-file lines print:
-
-```ts
-for (const m of r.mcp) console.error(`✓ mcp ${m.id}: ${m.path} (${m.action})`);
-```
-
-In `README.md`, add under "## Agent integration" (before the Claude subsection):
-
-```markdown
-### MCP server
-
-`graft init` also registers Graft's MCP server with agents that support it, so
-`graft_ask`, `graft_check`, and `graft_blast_radius` appear as native tools —
-no shell required. Skip with `--no-mcp`. Run it manually with `graft mcp [dir]`,
-or register it by hand:
-
- { "mcpServers": { "graft": { "command": "npx", "args": ["-y", "@nanonets/graft", "mcp"] } } }
-```
-
-- [ ] **Step 4: Full suite + manual verification**
-
-Run: `node --import tsx --test test/*.test.ts` → all green.
-Manual: `cd $(mktemp -d) && node --import tsx <repo>/src/cli.ts init . --no-build --agents cursor` → both `.cursor/rules/graft.mdc` and `.cursor/mcp.json` exist; re-run prints `(unchanged)` twice.
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/hosts/init.ts src/cli.ts test/hosts-init.test.ts README.md
-git commit -m "feat(init): register the MCP server for selected agents (--no-mcp to skip)"
-```
-
----
-
-## Self-Review
-
-- Coverage: server (T2), tools (T1), registration (T3), init/CLI/docs (T4). ✓
-- Placeholders: none; complete code everywhere. ✓
-- Type consistency: `callTool → {text, isError}` consumed by server's `tools/call`; `McpWrite` consumed by init/CLI; `runHostsInit` opts extended additively (existing tests keep passing since `mcp` results are additive). ✓
-- Risk noted for implementer: `contextDirFor` signature check (T1 note); MCP protocol version echo (T2 handles both 2024-11-05 and 2025-03-26 clients by echoing).
diff --git a/docs/superpowers/plans/2026-07-21-host-hooks.md b/docs/superpowers/plans/2026-07-21-host-hooks.md
deleted file mode 100644
index de26470f..00000000
--- a/docs/superpowers/plans/2026-07-21-host-hooks.md
+++ /dev/null
@@ -1,343 +0,0 @@
-# Host Hooks (Phase 3) Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** Bring Graft's active layer — post-edit blast radius + automatic $0 graph re-sync — to Codex-style CLI agents via their user-level `hooks.json`, reusing the existing hook runtime.
-
-**Architecture:** The existing hook runtime (`src/claude/hooks.ts`) already does everything; it reads the same stdin JSON shape these CLIs emit. We (1) refactor its `post-edit` and `stop` handlers into callable helpers and add a combined `post-edit-sync` event (these hosts have no session-end event, so sync piggybacks on post-edit), (2) add an installer that writes the existing shim to `<home>/.codex/hooks/graft/` and merges one `PostToolUse` entry into `<home>/.codex/hooks.json`, (3) wire it into `runHostsInit` behind the `agents` id, gated on `<home>/.codex` existing, with `--no-hooks` to opt out.
-
-**Tech Stack:** TypeScript ESM, Node ≥20, `node:test` + tsx. No new dependencies.
-
-## Global Constraints
-
-- No new npm dependencies. ESM `.js` imports. Files under 500 lines.
-- Existing Claude Code hook behavior must not change (same events, same outputs; refactor is behavior-preserving — the full existing suite must stay green).
-- `hooks.json` merge: parse-tolerant of missing file; unparseable file NEVER rewritten (`skipped-unparseable`); foreign hook entries preserved; graft entries filtered-then-appended so re-runs converge (`unchanged` when nothing changes).
-- Shim file is wholly graft-owned: overwrite when content differs, report `created`/`updated`/`unchanged`.
-- Global writes gated on `<home>/.codex` existing. Injectable `home` everywhere; tests never touch real `$HOME`.
-- No third-party tool names in code comments, docs, or commit messages.
-- Tests: `node --import tsx --test test/<file>.test.ts`; use the `GRAFT_TEST_STDIN` env seam for hook-runtime tests (see `test/claude-hooks.test.ts` for the established pattern).
-
----
-
-## File Structure
-
-- Modify: `src/claude/hooks.ts` — extract `handlePostEdit`/`handleStop`, add `post-edit-sync`.
-- Create: `src/hosts/codex-hooks.ts` — `installCodexHooks(home)`.
-- Modify: `src/hosts/init.ts` — `hooks` option (default on), result gains `hooks: HookWrite[]`.
-- Modify: `src/cli.ts` — `--no-hooks` flag + output lines.
-- Modify: `README.md` — one paragraph under "## Agent integration".
-- Tests: extend `test/claude-hooks.test.ts`; create `test/hosts-codex-hooks.test.ts`; extend `test/hosts-init.test.ts`.
-
----
-
-### Task 1: `post-edit-sync` event in the hook runtime
-
-**Files:**
-- Modify: `src/claude/hooks.ts`
-- Test: extend `test/claude-hooks.test.ts`
-
-**Interfaces:**
-- Consumes: existing internals of `src/claude/hooks.ts` (`patchStats`, `readStats`, `acquireLock`, `readWiring`, `formatBlastRadius`, `claudeScriptPath`).
-- Produces: `main('post-edit-sync')` — runs the post-edit logic (dirty marking + blast radius emit) and then the stop logic (spawn detached sync when dirty + lock acquired) in one invocation. `main('post-edit')` and `main('stop')` behave exactly as before.
-
-- [ ] **Step 1: Read the existing test file** (`test/claude-hooks.test.ts`) to mirror its fixture setup (temp repo, `GRAFT_TEST_STDIN`, stats/wiring fixtures). Then write the failing test, following the file's existing conventions:
-
-```ts
-test('post-edit-sync marks dirty and kicks off the background sync', async () => {
- // Arrange exactly like the existing post-edit test fixture (temp dir with
- // graft/.graph/wiring.json + graft/.cache), with stdin naming an edited file.
- // Act: await main('post-edit-sync') with GRAFT_TEST_STDIN set.
- // Assert BOTH effects:
- // 1. stats.dirty === true (or lastFile set) — the post-edit half ran;
- // 2. stats.syncing === true AND the sync lock file exists
- // (graft/.cache/.sync.lock) — the stop half ran.
-});
-```
-
-Write it as real code against the actual fixture helpers in the file — the intent above is normative, the helper names come from the existing tests. Also add: `post-edit-sync on a file under graft/ does not mark dirty` (mirrors the existing under-graft guard test) — note the sync half may still run if stats were already dirty; assert only that `dirty` was not newly set by this call.
-
-- [ ] **Step 2: Run to verify the new tests fail**
-
-Run: `node --import tsx --test test/claude-hooks.test.ts`
-Expected: new tests FAIL (unknown event is a silent no-op → assertions on stats fail); existing tests PASS.
-
-- [ ] **Step 3: Refactor + implement** in `src/claude/hooks.ts` — extract the bodies of the two existing branches verbatim into helpers, then dispatch:
-
-```ts
-async function handlePostEdit(input: any, dir: string): Promise<void> {
- const file: string | undefined = input?.tool_input?.file_path;
- if (!file || underGraft(dir, file)) return;
- patchStats(dir, { dirty: true, staleCount: checkStaleCount(dir), lastFile: basename(file) });
- const w = readWiring(dir);
- if (w) { const br = formatBlastRadius(w, file); if (br) emit('PostToolUse', br); }
-}
-
-function handleStop(dir: string): void {
- const syncRun = claudeScriptPath('sync-run.js');
- if (!existsSync(syncRun)) return;
- const stats = readStats(dir);
- if (stats?.dirty && acquireLock(dir)) {
- patchStats(dir, { syncing: true });
- const child = spawn(process.execPath, [syncRun, dir], { detached: true, stdio: 'ignore' });
- child.unref();
- }
-}
-```
-
-And in `main`, replace the two branches and add the combined event:
-
-```ts
- if (event === 'post-edit') { await handlePostEdit(input, dir); return; }
- if (event === 'stop') { handleStop(dir); return; }
- if (event === 'post-edit-sync') { await handlePostEdit(input, dir); handleStop(dir); return; }
-```
-
-The extracted helper bodies must be byte-identical to the current branch bodies (pure move). Keep the existing comments with the moved code.
-
-- [ ] **Step 4: Run the hook tests, then the full suite**
-
-Run: `node --import tsx --test test/claude-hooks.test.ts` → all pass (old + new).
-Run: `node --import tsx --test test/*.test.ts` → all green.
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/claude/hooks.ts test/claude-hooks.test.ts
-git commit -m "feat(hooks): post-edit-sync event — post-edit + background sync in one call"
-```
-
----
-
-### Task 2: Codex-family hooks installer (`src/hosts/codex-hooks.ts`)
-
-**Files:**
-- Create: `src/hosts/codex-hooks.ts`
-- Test: `test/hosts-codex-hooks.test.ts`
-
-**Interfaces:**
-- Consumes: `hooksShim()` from `../claude/shim-template.js` (verify the export name in that file before importing).
-- Produces:
- - `interface HookWrite { id: string; path: string; action: 'created' | 'updated' | 'unchanged' | 'skipped-unparseable' }`
- - `installCodexHooks(home: string): HookWrite[]` — no-op (`[]`) unless `<home>/.codex` exists. Otherwise two writes:
- 1. Shim: `<home>/.codex/hooks/graft/graft-hooks.cjs` (mode 0o755), content `hooksShim()` — owned file, content-compare for `unchanged`.
- 2. Config: `<home>/.codex/hooks.json` — ensure `hooks.PostToolUse` is an array; drop any entries whose JSON contains `graft-hooks.cjs`; append:
- ```json
- { "matcher": "Write|Edit|MultiEdit", "hooks": [{ "type": "command", "command": "node \"<abs shim path>\" post-edit-sync", "timeout": 10000 }] }
- ```
- Action `unchanged` when the resulting JSON equals the existing file's parsed JSON.
-
-- [ ] **Step 1: Write the failing tests**
-
-```ts
-// test/hosts-codex-hooks.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { mkdtempSync, mkdirSync, readFileSync, writeFileSync, existsSync, statSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { installCodexHooks } from '../src/hosts/codex-hooks.js';
-
-function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-cxhooks-')); }
-
-test('no-op when the CLI home dir is absent', () => {
- assert.deepEqual(installCodexHooks(fresh()), []);
-});
-
-test('writes shim + hooks.json entry, idempotent on re-run', () => {
- const home = fresh();
- mkdirSync(join(home, '.codex'), { recursive: true });
- const w = installCodexHooks(home);
- assert.equal(w.length, 2);
- const shim = join(home, '.codex', 'hooks', 'graft', 'graft-hooks.cjs');
- assert.ok(existsSync(shim));
- assert.ok(statSync(shim).mode & 0o111, 'shim is executable');
- const cfg = JSON.parse(readFileSync(join(home, '.codex', 'hooks.json'), 'utf8'));
- const entries = cfg.hooks.PostToolUse;
- assert.equal(entries.length, 1);
- assert.equal(entries[0].matcher, 'Write|Edit|MultiEdit');
- assert.match(entries[0].hooks[0].command, /post-edit-sync/);
- const again = installCodexHooks(home);
- assert.deepEqual(again.map((x) => x.action), ['unchanged', 'unchanged']);
- assert.equal(JSON.parse(readFileSync(join(home, '.codex', 'hooks.json'), 'utf8')).hooks.PostToolUse.length, 1);
-});
-
-test('foreign hook entries are preserved; stale graft entries replaced', () => {
- const home = fresh();
- mkdirSync(join(home, '.codex'), { recursive: true });
- writeFileSync(join(home, '.codex', 'hooks.json'), JSON.stringify({
- hooks: { PostToolUse: [
- { matcher: 'Bash', hooks: [{ type: 'command', command: 'other-tool' }] },
- { matcher: 'Write', hooks: [{ type: 'command', command: 'node /old/graft-hooks.cjs post-edit' }] },
- ] },
- }));
- installCodexHooks(home);
- const entries = JSON.parse(readFileSync(join(home, '.codex', 'hooks.json'), 'utf8')).hooks.PostToolUse;
- assert.equal(entries.length, 2, 'foreign kept, stale graft replaced by fresh');
- assert.ok(entries.some((e: any) => e.hooks[0].command === 'other-tool'));
- assert.ok(entries.some((e: any) => /post-edit-sync/.test(JSON.stringify(e))));
- assert.ok(!JSON.stringify(entries).includes('/old/'));
-});
-
-test('unparseable hooks.json is never rewritten', () => {
- const home = fresh();
- mkdirSync(join(home, '.codex'), { recursive: true });
- writeFileSync(join(home, '.codex', 'hooks.json'), '{ nope');
- const w = installCodexHooks(home);
- assert.ok(w.some((x) => x.action === 'skipped-unparseable'));
- assert.equal(readFileSync(join(home, '.codex', 'hooks.json'), 'utf8'), '{ nope');
-});
-```
-
-- [ ] **Step 2: Run to verify failure** — module not found.
-
-- [ ] **Step 3: Implement**
-
-```ts
-// src/hosts/codex-hooks.ts
-/**
- * Active-layer install for CLI agents that read user-level hooks.json with
- * PostToolUse semantics. Writes the shared hook shim and one PostToolUse
- * entry that runs post-edit + background sync after every file edit.
- */
-import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync, statSync } from 'node:fs';
-import { dirname, join } from 'node:path';
-import { hooksShim } from '../claude/shim-template.js';
-
-export interface HookWrite {
- id: string;
- path: string;
- action: 'created' | 'updated' | 'unchanged' | 'skipped-unparseable';
-}
-
-function dirExists(p: string): boolean {
- try { return statSync(p).isDirectory(); } catch { return false; }
-}
-
-function writeOwned(id: string, path: string, content: string, mode?: number): HookWrite {
- const existed = existsSync(path);
- if (existed && readFileSync(path, 'utf8') === content) return { id, path, action: 'unchanged' };
- mkdirSync(dirname(path), { recursive: true });
- writeFileSync(path, content);
- if (mode !== undefined) chmodSync(path, mode);
- return { id, path, action: existed ? 'updated' : 'created' };
-}
-
-function isGraftEntry(entry: unknown): boolean {
- return JSON.stringify(entry).includes('graft-hooks.cjs');
-}
-
-export function installCodexHooks(home: string): HookWrite[] {
- const base = join(home, '.codex');
- if (!dirExists(base)) return [];
-
- const shimPath = join(base, 'hooks', 'graft', 'graft-hooks.cjs');
- const shimWrite = writeOwned('codex-hook-shim', shimPath, hooksShim(), 0o755);
-
- const cfgPath = join(base, 'hooks.json');
- let root: Record<string, any> = {};
- const existed = existsSync(cfgPath);
- if (existed) {
- try { root = JSON.parse(readFileSync(cfgPath, 'utf8')); } catch {
- return [shimWrite, { id: 'codex-hooks', path: cfgPath, action: 'skipped-unparseable' }];
- }
- }
- if (typeof root !== 'object' || root === null || Array.isArray(root)) {
- return [shimWrite, { id: 'codex-hooks', path: cfgPath, action: 'skipped-unparseable' }];
- }
- const before = JSON.stringify(root);
- const hooks = (root.hooks ??= {});
- const prior: unknown[] = Array.isArray(hooks.PostToolUse) ? hooks.PostToolUse : [];
- hooks.PostToolUse = [
- ...prior.filter((e) => !isGraftEntry(e)),
- {
- matcher: 'Write|Edit|MultiEdit',
- hooks: [{ type: 'command', command: `node "${shimPath}" post-edit-sync`, timeout: 10000 }],
- },
- ];
- if (JSON.stringify(root) === before) return [shimWrite, { id: 'codex-hooks', path: cfgPath, action: 'unchanged' }];
- writeFileSync(cfgPath, `${JSON.stringify(root, null, 2)}\n`);
- return [shimWrite, { id: 'codex-hooks', path: cfgPath, action: existed ? 'updated' : 'created' }];
-}
-```
-
-Note: if `root.hooks` exists but is not an object, treat as `skipped-unparseable` too (add the same shape guard as for `root`).
-
-- [ ] **Step 4: Run to verify pass** — `node --import tsx --test test/hosts-codex-hooks.test.ts` (4 tests).
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/hosts/codex-hooks.ts test/hosts-codex-hooks.test.ts
-git commit -m "feat(hosts): hooks.json installer — post-edit blast radius + auto-sync for CLI agents"
-```
-
----
-
-### Task 3: Init wiring + README
-
-**Files:**
-- Modify: `src/hosts/init.ts`, `src/cli.ts`, `README.md`
-- Test: extend `test/hosts-init.test.ts`
-
-**Interfaces:**
-- Consumes: `installCodexHooks`, `HookWrite` (Task 2).
-- Produces: `runHostsInit(repo, { agents?, all?, home?, mcp?, hooks?: boolean })` → result gains `hooks: HookWrite[]`. Hooks install runs only when the selection includes the `agents` id (same gating philosophy as MCP: the installer itself further gates on `<home>/.codex`). CLI: `--no-hooks`.
-
-- [ ] **Step 1: Failing tests** (append to `test/hosts-init.test.ts`)
-
-```ts
-test('runHostsInit installs hooks for the agents id when the CLI home exists', () => {
- const home = fresh(); const repo = fresh();
- mkdirSync(join(home, '.codex'), { recursive: true });
- const r = runHostsInit(repo, { home, agents: ['agents'] });
- assert.equal(r.hooks.length, 2);
- assert.ok(existsSync(join(home, '.codex', 'hooks', 'graft', 'graft-hooks.cjs')));
-});
-
-test('hooks: false skips hook installation', () => {
- const home = fresh(); const repo = fresh();
- mkdirSync(join(home, '.codex'), { recursive: true });
- const r = runHostsInit(repo, { home, agents: ['agents'], hooks: false });
- assert.deepEqual(r.hooks, []);
- assert.ok(!existsSync(join(home, '.codex', 'hooks.json')));
-});
-```
-
-- [ ] **Step 2: Verify failure** — `r.hooks` undefined.
-
-- [ ] **Step 3: Implement.** In `src/hosts/init.ts`: import `installCodexHooks`, `HookWrite`; add `hooks: HookWrite[]` to the result; after the mcp step:
-
-```ts
-const hooks =
- opts.hooks === false || !selected.some((h) => h.id === 'agents')
- ? []
- : installCodexHooks(home);
-return { written, skipped, unknown, mcp, hooks };
-```
-
-In `src/cli.ts`: `.option("--no-hooks", "skip hook installation for other agents")`, pass `hooks: opts.hooks`, print `for (const h of r.hooks) console.error(\`✓ hook ${h.id}: ${h.path} (${h.action})\`);`.
-
-In `README.md`, add one sentence to the "## Agent integration" intro paragraph (after the MCP subsection reference): "Where a CLI agent supports user-level `hooks.json`, `init` also installs Graft's post-edit hook — blast-radius warnings and automatic `$0` graph re-sync after edits (skip with `--no-hooks`)."
-
-- [ ] **Step 4: Full suite** — `node --import tsx --test test/*.test.ts` all green.
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/hosts/init.ts src/cli.ts test/hosts-init.test.ts README.md
-git commit -m "feat(init): install post-edit hooks for CLI agents (--no-hooks to skip)"
-```
-
----
-
-## Out of scope
-
-- Hooks for hosts whose event/config schema we could not verify from at least two independent sources. They keep the instruction-file + MCP layers.
-- Prompt-time retrieval injection outside Claude Code (no equivalent event exists in the verified hooks.json schema).
-
-## Self-Review
-
-- Coverage: runtime event (T1), installer (T2), wiring/docs (T3). ✓
-- Placeholders: T1 Step 1 delegates fixture specifics to the existing test file by design (the plan cannot know private helper names); its assertions are fully specified. Everything else is complete code. ✓
-- Type consistency: `HookWrite` defined T2, consumed T3; `runHostsInit` extension additive. ✓
diff --git a/docs/superpowers/plans/2026-07-21-multi-host-init.md b/docs/superpowers/plans/2026-07-21-multi-host-init.md
deleted file mode 100644
index 347c8376..00000000
--- a/docs/superpowers/plans/2026-07-21-multi-host-init.md
+++ /dev/null
@@ -1,811 +0,0 @@
-# Multi-Host Init (Phase 1: Instruction Files) Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** `graft init` wires Graft into every AI coding agent present on the machine — not just Claude Code — by writing each host's native instruction file with a marker-fenced Graft section.
-
-**Architecture:** A new `src/hosts/` module holds (1) a marker-fenced section upsert utility, (2) one canonical instruction body rendered into three formats (markdown `##` section, Cursor `.mdc` rule, Kiro steering file), and (3) a host registry mapping host id → detection probe → target file → renderer. `graft init` keeps the existing Claude Code path (`src/claude/init.ts`, untouched) and additionally runs the registry for every detected host. Claude Code remains the premium experience (hooks + statusline + skill); other hosts get the passive instruction layer in this phase. MCP server (Phase 2) and per-host hooks (Phase 3) are separate plans.
-
-**Tech Stack:** TypeScript ESM (Node ≥20), `node:test` + tsx test runner, commander CLI. No new dependencies.
-
-## Global Constraints
-
-- No new npm dependencies.
-- Node ≥ 20, `"type": "module"`, imports use `.js` extensions (compiled ESM).
-- Files under 500 lines.
-- All writes idempotent: re-running `graft init` must converge (replace own section, never duplicate, never clobber user content outside the markers).
-- Never overwrite a user file wholesale when it exists — only upsert the fenced section (exception: files wholly owned by graft, i.e. `.cursor/rules/graft.mdc`, `.kiro/steering/graft.md`, `.windsurf/rules/graft.md`).
-- Marker fence: `<!-- graft:start -->` / `<!-- graft:end -->`, each alone on its line.
-- Do not reference third-party tools by name anywhere in code, comments, docs, or commit messages — describe mechanisms generically.
-- Detection probes must accept an injectable home directory so tests never depend on the real `$HOME`.
-- Tests: `node --import tsx --test test/<file>.test.ts`, temp dirs via `mkdtempSync(join(tmpdir(), ...))`, style matching `test/claude-init.test.ts`.
-
----
-
-## File Structure
-
-- Create: `src/hosts/sections.ts` — marker-fenced upsert (pure string + fs helpers).
-- Create: `src/hosts/instructions.ts` — canonical body + per-format renderers.
-- Create: `src/hosts/registry.ts` — host definitions + detection.
-- Create: `src/hosts/init.ts` — orchestrator `runHostsInit(dir, opts)`.
-- Modify: `src/cli.ts` (init command, lines ~187-203) — add `--agents`, `--all-agents`, `--no-agents`, `--list-agents`; call orchestrator.
-- Create: `test/hosts-sections.test.ts`, `test/hosts-instructions.test.ts`, `test/hosts-registry.test.ts`, `test/hosts-init.test.ts`.
-- Modify: `README.md` — "Claude Code integration" section becomes "Agent integration".
-
----
-
-### Task 1: Marker-fenced section upsert (`src/hosts/sections.ts`)
-
-**Files:**
-- Create: `src/hosts/sections.ts`
-- Test: `test/hosts-sections.test.ts`
-
-**Interfaces:**
-- Produces: `upsertSection(filePath: string, body: string): { action: 'created' | 'appended' | 'replaced' | 'unchanged' }` — ensures `filePath` contains exactly one `<!-- graft:start -->\n<body>\n<!-- graft:end -->` block; creates the file (with trailing newline) if missing, appends the block (separated by one blank line) if the file exists without markers, replaces only the fenced region if markers exist, and reports `unchanged` when the fenced body already matches.
-- Produces: `fencedBlock(body: string): string` — the exact block string, exported for tests and renderers.
-
-- [ ] **Step 1: Write the failing tests**
-
-```ts
-// test/hosts-sections.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { upsertSection, fencedBlock } from '../src/hosts/sections.js';
-
-function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-sections-')); }
-
-test('creates the file with a fenced block when missing', () => {
- const f = join(fresh(), 'AGENTS.md');
- const r = upsertSection(f, '## Graft\nuse graft ask');
- assert.equal(r.action, 'created');
- const text = readFileSync(f, 'utf8');
- assert.ok(text.includes('<!-- graft:start -->'));
- assert.ok(text.includes('use graft ask'));
- assert.ok(text.endsWith('\n'));
-});
-
-test('appends after existing content, separated by a blank line', () => {
- const f = join(fresh(), 'AGENTS.md');
- writeFileSync(f, '# My rules\n\nBe nice.\n');
- const r = upsertSection(f, 'graft body');
- assert.equal(r.action, 'appended');
- const text = readFileSync(f, 'utf8');
- assert.ok(text.startsWith('# My rules\n\nBe nice.\n'));
- assert.match(text, /Be nice\.\n\n<!-- graft:start -->/);
-});
-
-test('replaces only the fenced region on re-run with new body', () => {
- const f = join(fresh(), 'AGENTS.md');
- writeFileSync(f, `above\n\n${fencedBlock('old body')}\nbelow\n`);
- const r = upsertSection(f, 'new body');
- assert.equal(r.action, 'replaced');
- const text = readFileSync(f, 'utf8');
- assert.ok(text.includes('above'));
- assert.ok(text.includes('below'));
- assert.ok(text.includes('new body'));
- assert.ok(!text.includes('old body'));
- assert.equal(text.match(/graft:start/g)!.length, 1, 'exactly one block');
-});
-
-test('reports unchanged when the fenced body already matches', () => {
- const f = join(fresh(), 'AGENTS.md');
- upsertSection(f, 'same body');
- const r = upsertSection(f, 'same body');
- assert.equal(r.action, 'unchanged');
-});
-
-test('ignores inline marker mentions (marker must be alone on its line)', () => {
- const f = join(fresh(), 'AGENTS.md');
- writeFileSync(f, 'talking about `<!-- graft:start -->` in prose\n');
- const r = upsertSection(f, 'body');
- assert.equal(r.action, 'appended');
- assert.equal(readFileSync(f, 'utf8').match(/^<!-- graft:start -->$/gm)!.length, 1);
-});
-```
-
-- [ ] **Step 2: Run tests to verify they fail**
-
-Run: `node --import tsx --test test/hosts-sections.test.ts`
-Expected: FAIL — `Cannot find module '../src/hosts/sections.js'`
-
-- [ ] **Step 3: Implement**
-
-```ts
-// src/hosts/sections.ts
-/**
- * Marker-fenced section upsert. Graft owns exactly the region between the
- * markers; everything else in the file belongs to the user and is preserved.
- */
-import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
-import { dirname } from 'node:path';
-
-export const START = '<!-- graft:start -->';
-export const END = '<!-- graft:end -->';
-
-export type UpsertAction = 'created' | 'appended' | 'replaced' | 'unchanged';
-
-export function fencedBlock(body: string): string {
- return `${START}\n${body.replace(/\s+$/, '')}\n${END}`;
-}
-
-/** Index of a marker that sits alone on its own line, or -1. */
-function markerLineIndex(lines: string[], marker: string, from = 0): number {
- for (let i = from; i < lines.length; i++) {
- if (lines[i].trim() === marker) return i;
- }
- return -1;
-}
-
-export function upsertSection(filePath: string, body: string): { action: UpsertAction } {
- const block = fencedBlock(body);
- if (!existsSync(filePath)) {
- mkdirSync(dirname(filePath), { recursive: true });
- writeFileSync(filePath, `${block}\n`);
- return { action: 'created' };
- }
- const text = readFileSync(filePath, 'utf8');
- const lines = text.split('\n');
- const s = markerLineIndex(lines, START);
- const e = s === -1 ? -1 : markerLineIndex(lines, END, s + 1);
- if (s !== -1 && e !== -1) {
- const current = lines.slice(s, e + 1).join('\n');
- if (current === block) return { action: 'unchanged' };
- const next = [...lines.slice(0, s), ...block.split('\n'), ...lines.slice(e + 1)];
- writeFileSync(filePath, next.join('\n'));
- return { action: 'replaced' };
- }
- const sep = text.endsWith('\n\n') ? '' : text.endsWith('\n') ? '\n' : '\n\n';
- writeFileSync(filePath, `${text}${sep}${block}\n`);
- return { action: 'appended' };
-}
-```
-
-- [ ] **Step 4: Run tests to verify they pass**
-
-Run: `node --import tsx --test test/hosts-sections.test.ts`
-Expected: PASS (5 tests)
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/hosts/sections.ts test/hosts-sections.test.ts
-git commit -m "feat(hosts): marker-fenced section upsert for agent instruction files"
-```
-
----
-
-### Task 2: Canonical instruction body + renderers (`src/hosts/instructions.ts`)
-
-**Files:**
-- Create: `src/hosts/instructions.ts`
-- Test: `test/hosts-instructions.test.ts`
-
-**Interfaces:**
-- Consumes: nothing from other tasks (pure strings).
-- Produces:
- - `instructionBody(): string` — the canonical markdown body (starts with `## Graft — repo context graph`).
- - `cursorRule(): string` — full `.mdc` file content: YAML frontmatter (`description`, `alwaysApply: true`) + body.
- - `kiroSteering(): string` — full steering file: frontmatter (`inclusion: always`) + body.
- - `windsurfRule(): string` — full rules file (plain markdown, no frontmatter) + body.
-
-- [ ] **Step 1: Write the failing tests**
-
-```ts
-// test/hosts-instructions.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { instructionBody, cursorRule, kiroSteering, windsurfRule } from '../src/hosts/instructions.js';
-
-test('canonical body names the three essentials', () => {
- const b = instructionBody();
- assert.match(b, /^## Graft — repo context graph/m);
- assert.match(b, /graft ask "/);
- assert.match(b, /graft\/INDEX\.md/);
- assert.match(b, /graft build/);
- assert.ok(!/\bhook|statusline\b/i.test(b), 'no host-specific machinery in the shared body');
-});
-
-test('cursor rule has alwaysApply frontmatter and the body', () => {
- const r = cursorRule();
- assert.match(r, /^---\ndescription: .+\nalwaysApply: true\n---\n/);
- assert.ok(r.includes(instructionBody()));
-});
-
-test('kiro steering has inclusion: always frontmatter and the body', () => {
- const r = kiroSteering();
- assert.match(r, /^---\ninclusion: always\n---\n/);
- assert.ok(r.includes(instructionBody()));
-});
-
-test('windsurf rule is the plain body', () => {
- assert.ok(windsurfRule().includes(instructionBody()));
-});
-```
-
-- [ ] **Step 2: Run tests to verify they fail**
-
-Run: `node --import tsx --test test/hosts-instructions.test.ts`
-Expected: FAIL — `Cannot find module '../src/hosts/instructions.js'`
-
-- [ ] **Step 3: Implement**
-
-```ts
-// src/hosts/instructions.ts
-/**
- * The one canonical Graft instruction block, rendered into each host's
- * native format. Content changes happen HERE only; renderers just wrap it.
- */
-
-export function instructionBody(): string {
- return `## Graft — repo context graph
-
-This repo is indexed in \`graft/\`: small linked markdown nodes that explain each
-system and carry exact file:line spans, kept in sync with the code through git.
-
-For ANY task here — understanding how something works, finding where code lives,
-or scoping a change — get context from the graph before grepping or opening
-source files:
-
-- Run \`graft ask "<your question>" --source\` → ranked nodes with the relevant
- code spans inlined. The node usually IS the answer; stop there.
-- Or browse: \`graft/INDEX.md\` lists every node; follow the links.
-
-Only open source files when a node genuinely lacks a needed detail, and then at
-the exact file:line the node points to — never re-read whole files.
-
-After big code changes, refresh the graph with \`graft build\` (deterministic,
-no API key, $0).`;
-}
-
-export function cursorRule(): string {
- return `---
-description: Use the Graft context graph in graft/ before exploring source
-alwaysApply: true
----
-${instructionBody()}
-`;
-}
-
-export function kiroSteering(): string {
- return `---
-inclusion: always
----
-${instructionBody()}
-`;
-}
-
-export function windsurfRule(): string {
- return `${instructionBody()}
-`;
-}
-```
-
-- [ ] **Step 4: Run tests to verify they pass**
-
-Run: `node --import tsx --test test/hosts-instructions.test.ts`
-Expected: PASS (4 tests)
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/hosts/instructions.ts test/hosts-instructions.test.ts
-git commit -m "feat(hosts): canonical instruction body with per-host renderers"
-```
-
----
-
-### Task 3: Host registry + detection (`src/hosts/registry.ts`)
-
-**Files:**
-- Create: `src/hosts/registry.ts`
-- Test: `test/hosts-registry.test.ts`
-
-**Interfaces:**
-- Consumes: `instructionBody`, `cursorRule`, `kiroSteering`, `windsurfRule` from Task 2; `upsertSection` semantics from Task 1 (via the `kind` field consumed in Task 4).
-- Produces:
- - `interface HostTarget { id: string; name: string; kind: 'section' | 'owned'; relPath: string; content(): string; detect(probe: DetectProbe): boolean }` — `kind: 'section'` upserts the fenced block into a shared file; `kind: 'owned'` writes the whole file (graft owns it).
- - `interface DetectProbe { home: string; repo: string; dirExists(p: string): boolean }`
- - `HOSTS: HostTarget[]` — ids: `agents`, `cursor`, `gemini`, `copilot`, `kiro`, `windsurf`.
- - `detectHosts(probe: DetectProbe): HostTarget[]` — hosts whose `detect` returns true.
- - `hostIds(): string[]` — all valid ids (for CLI validation/help).
-
-- [ ] **Step 1: Write the failing tests**
-
-```ts
-// test/hosts-registry.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { mkdtempSync, mkdirSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { HOSTS, detectHosts, hostIds, type DetectProbe } from '../src/hosts/registry.js';
-import { existsSync, statSync } from 'node:fs';
-
-function probeFor(home: string, repo: string): DetectProbe {
- return {
- home, repo,
- dirExists: (p) => { try { return statSync(p).isDirectory(); } catch { return false; } },
- };
-}
-function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-registry-')); }
-
-test('registry exposes the six phase-1 hosts', () => {
- assert.deepEqual(hostIds().sort(), ['agents', 'copilot', 'cursor', 'gemini', 'kiro', 'windsurf']);
- for (const h of HOSTS) {
- assert.ok(h.relPath.length > 0);
- assert.ok(h.content().length > 0);
- }
-});
-
-test('nothing detected on a bare machine and bare repo', () => {
- assert.deepEqual(detectHosts(probeFor(fresh(), fresh())), []);
-});
-
-test('home config dirs light up their hosts', () => {
- const home = fresh(); const repo = fresh();
- mkdirSync(join(home, '.cursor'));
- mkdirSync(join(home, '.gemini'));
- mkdirSync(join(home, '.codex'));
- const ids = detectHosts(probeFor(home, repo)).map((h) => h.id).sort();
- assert.deepEqual(ids, ['agents', 'cursor', 'gemini']);
-});
-
-test('repo-local markers also light up hosts', () => {
- const home = fresh(); const repo = fresh();
- mkdirSync(join(repo, '.github'));
- mkdirSync(join(repo, '.kiro'));
- const ids = detectHosts(probeFor(home, repo)).map((h) => h.id).sort();
- assert.deepEqual(ids, ['copilot', 'kiro']);
-});
-```
-
-- [ ] **Step 2: Run tests to verify they fail**
-
-Run: `node --import tsx --test test/hosts-registry.test.ts`
-Expected: FAIL — `Cannot find module '../src/hosts/registry.js'`
-
-- [ ] **Step 3: Implement**
-
-```ts
-// src/hosts/registry.ts
-/**
- * Registry of AI coding hosts Graft can write instructions for.
- * Adding a host = adding one entry here (plus a renderer if it needs
- * a new file format).
- *
- * kind: 'section' → upsert the fenced block into a shared file the user owns.
- * kind: 'owned' → graft owns the whole file; overwrite it each run.
- */
-import { join } from 'node:path';
-import { instructionBody, cursorRule, kiroSteering, windsurfRule } from './instructions.js';
-
-export interface DetectProbe {
- home: string;
- repo: string;
- dirExists(path: string): boolean;
-}
-
-export interface HostTarget {
- id: string;
- name: string;
- kind: 'section' | 'owned';
- /** Target file, relative to the repo root. */
- relPath: string;
- content(): string;
- detect(probe: DetectProbe): boolean;
-}
-
-export const HOSTS: HostTarget[] = [
- {
- id: 'agents',
- name: 'AGENTS.md hosts (Codex-style CLIs, editors that read AGENTS.md)',
- kind: 'section',
- relPath: 'AGENTS.md',
- content: instructionBody,
- detect: (p) =>
- p.dirExists(join(p.home, '.codex')) ||
- p.dirExists(join(p.home, '.config', 'opencode')) ||
- p.dirExists(join(p.home, '.config', 'agents')),
- },
- {
- id: 'cursor',
- name: 'Cursor',
- kind: 'owned',
- relPath: join('.cursor', 'rules', 'graft.mdc'),
- content: cursorRule,
- detect: (p) => p.dirExists(join(p.home, '.cursor')) || p.dirExists(join(p.repo, '.cursor')),
- },
- {
- id: 'gemini',
- name: 'Gemini CLI',
- kind: 'section',
- relPath: 'GEMINI.md',
- content: instructionBody,
- detect: (p) => p.dirExists(join(p.home, '.gemini')),
- },
- {
- id: 'copilot',
- name: 'GitHub Copilot',
- kind: 'section',
- relPath: join('.github', 'copilot-instructions.md'),
- content: instructionBody,
- detect: (p) => p.dirExists(join(p.repo, '.github')),
- },
- {
- id: 'kiro',
- name: 'Kiro',
- kind: 'owned',
- relPath: join('.kiro', 'steering', 'graft.md'),
- content: kiroSteering,
- detect: (p) => p.dirExists(join(p.home, '.kiro')) || p.dirExists(join(p.repo, '.kiro')),
- },
- {
- id: 'windsurf',
- name: 'Windsurf',
- kind: 'owned',
- relPath: join('.windsurf', 'rules', 'graft.md'),
- content: windsurfRule,
- detect: (p) => p.dirExists(join(p.home, '.codeium', 'windsurf')) || p.dirExists(join(p.repo, '.windsurf')),
- },
-];
-
-export function hostIds(): string[] {
- return HOSTS.map((h) => h.id);
-}
-
-export function detectHosts(probe: DetectProbe): HostTarget[] {
- return HOSTS.filter((h) => h.detect(probe));
-}
-```
-
-- [ ] **Step 4: Run tests to verify they pass**
-
-Run: `node --import tsx --test test/hosts-registry.test.ts`
-Expected: PASS (4 tests)
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/hosts/registry.ts test/hosts-registry.test.ts
-git commit -m "feat(hosts): host registry with home/repo detection probes"
-```
-
----
-
-### Task 4: Orchestrator (`src/hosts/init.ts`)
-
-**Files:**
-- Create: `src/hosts/init.ts`
-- Test: `test/hosts-init.test.ts`
-
-**Interfaces:**
-- Consumes: `HOSTS`, `detectHosts`, `hostIds`, `HostTarget`, `DetectProbe` (Task 3); `upsertSection` (Task 1).
-- Produces: `runHostsInit(repo: string, opts?: { agents?: string[]; all?: boolean; home?: string }): { written: { id: string; path: string; action: string }[]; skipped: string[]; unknown: string[] }`
- - `opts.agents` — explicit host ids (skips detection); `opts.all` — every registry host; default — detected hosts only.
- - `unknown` — requested ids not in the registry (caller reports and exits non-zero).
- - `home` defaults to `os.homedir()`; injectable for tests.
-
-- [ ] **Step 1: Write the failing tests**
-
-```ts
-// test/hosts-init.test.ts
-import { test } from 'node:test';
-import assert from 'node:assert/strict';
-import { mkdtempSync, mkdirSync, readFileSync, existsSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { runHostsInit } from '../src/hosts/init.js';
-
-function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-hostsinit-')); }
-
-test('writes only detected hosts by default', () => {
- const home = fresh(); const repo = fresh();
- mkdirSync(join(home, '.cursor'));
- const r = runHostsInit(repo, { home });
- assert.deepEqual(r.written.map((w) => w.id), ['cursor']);
- const mdc = readFileSync(join(repo, '.cursor', 'rules', 'graft.mdc'), 'utf8');
- assert.match(mdc, /alwaysApply: true/);
- assert.ok(!existsSync(join(repo, 'AGENTS.md')));
-});
-
-test('explicit agents list overrides detection and flags unknown ids', () => {
- const home = fresh(); const repo = fresh();
- const r = runHostsInit(repo, { home, agents: ['gemini', 'nope'] });
- assert.deepEqual(r.written.map((w) => w.id), ['gemini']);
- assert.deepEqual(r.unknown, ['nope']);
- assert.ok(readFileSync(join(repo, 'GEMINI.md'), 'utf8').includes('graft ask'));
-});
-
-test('all writes every host and re-run converges (idempotent)', () => {
- const home = fresh(); const repo = fresh();
- const first = runHostsInit(repo, { home, all: true });
- assert.equal(first.written.length, 6);
- const second = runHostsInit(repo, { home, all: true });
- assert.ok(second.written.every((w) => w.action === 'unchanged'));
- const agents = readFileSync(join(repo, 'AGENTS.md'), 'utf8');
- assert.equal(agents.match(/graft:start/g)!.length, 1);
-});
-
-test('preserves user content around the fenced section', () => {
- const home = fresh(); const repo = fresh();
- mkdirSync(join(repo, '.github'));
- const target = join(repo, '.github', 'copilot-instructions.md');
- mkdirSync(join(repo, '.github'), { recursive: true });
- require('node:fs').writeFileSync(target, '# House rules\n');
- const r = runHostsInit(repo, { home });
- assert.deepEqual(r.written.map((w) => w.id), ['copilot']);
- const text = readFileSync(target, 'utf8');
- assert.ok(text.startsWith('# House rules'));
- assert.ok(text.includes('graft ask'));
-});
-```
-
-Note: replace the `require('node:fs')` line with a top-level `writeFileSync` import — shown here inline for clarity of what the step does; the committed test imports it at the top.
-
-- [ ] **Step 2: Run tests to verify they fail**
-
-Run: `node --import tsx --test test/hosts-init.test.ts`
-Expected: FAIL — `Cannot find module '../src/hosts/init.js'`
-
-- [ ] **Step 3: Implement**
-
-```ts
-// src/hosts/init.ts
-/**
- * Multi-host init: write each selected host's instruction file.
- * Selection = explicit ids > all > detected. Claude Code is handled
- * separately by src/claude/init.ts (hooks + statusline + skill).
- */
-import { statSync, writeFileSync, readFileSync, mkdirSync, existsSync } from 'node:fs';
-import { dirname, join } from 'node:path';
-import { homedir } from 'node:os';
-import { HOSTS, detectHosts, type DetectProbe, type HostTarget } from './registry.js';
-import { upsertSection } from './sections.js';
-
-export interface HostsInitResult {
- written: { id: string; path: string; action: string }[];
- skipped: string[];
- unknown: string[];
-}
-
-function probeFor(home: string, repo: string): DetectProbe {
- return {
- home, repo,
- dirExists: (p) => { try { return statSync(p).isDirectory(); } catch { return false; } },
- };
-}
-
-function writeOwned(path: string, content: string): string {
- if (existsSync(path) && readFileSync(path, 'utf8') === content) return 'unchanged';
- mkdirSync(dirname(path), { recursive: true });
- const existed = existsSync(path);
- writeFileSync(path, content);
- return existed ? 'replaced' : 'created';
-}
-
-export function runHostsInit(
- repo: string,
- opts: { agents?: string[]; all?: boolean; home?: string } = {},
-): HostsInitResult {
- const home = opts.home ?? homedir();
- const probe = probeFor(home, repo);
-
- let selected: HostTarget[];
- let unknown: string[] = [];
- if (opts.agents?.length) {
- const byId = new Map(HOSTS.map((h) => [h.id, h]));
- selected = opts.agents.flatMap((id) => byId.get(id) ?? []);
- unknown = opts.agents.filter((id) => !byId.has(id));
- } else if (opts.all) {
- selected = HOSTS;
- } else {
- selected = detectHosts(probe);
- }
-
- const written: HostsInitResult['written'] = [];
- for (const host of selected) {
- const path = join(repo, host.relPath);
- const action =
- host.kind === 'owned'
- ? writeOwned(path, host.content())
- : upsertSection(path, host.content()).action;
- written.push({ id: host.id, path, action });
- }
- const skipped = HOSTS.filter((h) => !selected.includes(h)).map((h) => h.id);
- return { written, skipped, unknown };
-}
-```
-
-- [ ] **Step 4: Run tests to verify they pass**
-
-Run: `node --import tsx --test test/hosts-init.test.ts`
-Expected: PASS (4 tests)
-
-- [ ] **Step 5: Commit**
-
-```bash
-git add src/hosts/init.ts test/hosts-init.test.ts
-git commit -m "feat(hosts): multi-host init orchestrator (detect/explicit/all selection)"
-```
-
----
-
-### Task 5: CLI wiring (`src/cli.ts`)
-
-**Files:**
-- Modify: `src/cli.ts` — the `init` command block (currently lines ~187-203).
-- Test: extend `test/hosts-init.test.ts` with one CLI smoke test.
-
-**Interfaces:**
-- Consumes: `runHostsInit`, `HostsInitResult` (Task 4); `hostIds` (Task 3); existing `runInit` from `./claude/init.js` (unchanged).
-- Produces: `graft init [dir] [--no-build] [--agents <ids...>] [--all-agents] [--no-agents] [--list-agents]`.
-
-- [ ] **Step 1: Write the failing CLI smoke test** (append to `test/hosts-init.test.ts`)
-
-```ts
-import { execFileSync } from 'node:child_process';
-
-test('CLI: graft init --agents gemini writes GEMINI.md and exits 0', () => {
- const repo = fresh();
- execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'init', repo, '--no-build', '--agents', 'gemini'], {
- encoding: 'utf8',
- });
- assert.ok(readFileSync(join(repo, 'GEMINI.md'), 'utf8').includes('graft ask'));
-});
-
-test('CLI: unknown agent id exits non-zero', () => {
- const repo = fresh();
- assert.throws(() =>
- execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'init', repo, '--no-build', '--agents', 'nope'], {
- encoding: 'utf8', stdio: 'pipe',
- }),
- );
-});
-```
-
-- [ ] **Step 2: Run to verify failure**
-
-Run: `node --import tsx --test test/hosts-init.test.ts`
-Expected: FAIL — commander rejects the unknown `--agents` option.
-
-- [ ] **Step 3: Rewrite the init command in `src/cli.ts`**
-
-Replace the existing `program.command("init")…` block with:
-
-```ts
-program
- .command("init")
- .description("Wire Graft into the AI coding agents used with this repo (instruction files; full hooks + statusline for Claude Code)")
- .argument("[dir]", "target repo directory", ".")
- .option("--no-build", "skip building the graph (wire files only)")
- .option("--agents <ids...>", `only these agents (${hostIds().join(", ")}, claude)`)
- .option("--all-agents", "write instruction files for every known agent, detected or not")
- .option("--no-agents", "Claude Code wiring only; skip other agents")
- .option("--list-agents", "list known agent ids and exit")
- .action((dir: string, opts: { build?: boolean; agents?: string[]; allAgents?: boolean; listAgents?: boolean }) => {
- if (opts.listAgents) {
- for (const id of [...hostIds(), "claude"]) console.log(id);
- return;
- }
- const repo = resolve(dir);
- const explicit = Array.isArray(opts.agents) ? opts.agents : undefined;
- const wantClaude = !explicit || explicit.includes("claude");
-
- if (wantClaude) {
- const cliPath = fileURLToPath(import.meta.url);
- const res = runInit(repo, { build: opts.build, cliPath });
- console.error(`✓ wrote ${res.settingsPath}`);
- for (const s of res.shims) console.error(`✓ wrote ${s}`);
- console.error(`✓ wrote ${res.skill}`);
- console.error(res.built ? "✓ built the graph (graft build)" : "· skipped graph build");
- for (const w of res.warnings) console.error(`⚠ ${w}`);
- }
-
- if (opts.agents !== undefined || explicit || opts.allAgents !== undefined) {
- // fallthrough — selection handled below; commander sets opts.agents=false for --no-agents
- }
- const skipOthers = (opts as { agents?: unknown }).agents === false;
- if (!skipOthers) {
- const r = runHostsInit(repo, {
- agents: explicit?.filter((id) => id !== "claude"),
- all: opts.allAgents,
- });
- for (const w of r.written) console.error(`✓ ${w.id}: ${w.path} (${w.action})`);
- if (!explicit && !opts.allAgents && r.written.length === 0)
- console.error("· no other agents detected (see --list-agents / --all-agents)");
- if (r.unknown.length) {
- console.error(`✗ unknown agent id(s): ${r.unknown.join(", ")} — valid: ${[...hostIds(), "claude"].join(", ")}`);
- process.exit(1);
- }
- }
- console.error("\nDone. Claude Code gets live hooks + statusline; other agents read their instruction files.");
- console.error("For LLM summaries: set OPENROUTER_API_KEY and run `graft build --deep`.");
- });
-```
-
-And add the imports at the top of `src/cli.ts` next to the existing `runInit` import:
-
-```ts
-import { runHostsInit } from "./hosts/init.js";
-import { hostIds } from "./hosts/registry.js";
-```
-
-Note on `--no-agents`: commander maps it to `opts.agents === false`; the explicit-list variant sets an array. The `skipOthers` check above handles both without a separate flag name.
-
-- [ ] **Step 4: Run the full suite**
-
-Run: `node --import tsx --test test/*.test.ts`
-Expected: all tests PASS (existing claude-init tests unchanged and green).
-
-- [ ] **Step 5: Manual verification**
-
-```bash
-cd "$(mktemp -d)" && git init -q . && echo 'export const x = 1;' > a.ts
-node --import tsx "/Users/shrishdwivedi/Documents/Context graphs/context-graph-engine/src/cli.ts" init . --no-build --all-agents
-cat AGENTS.md GEMINI.md .cursor/rules/graft.mdc | head -30
-```
-Expected: all files exist, each carries the Graft block exactly once; re-running prints `(unchanged)` for every host.
-
-- [ ] **Step 6: Commit**
-
-```bash
-git add src/cli.ts test/hosts-init.test.ts
-git commit -m "feat(cli): graft init wires all detected agents, not just Claude Code"
-```
-
----
-
-### Task 6: README update
-
-**Files:**
-- Modify: `README.md` — retitle the "Claude Code integration" section to "Agent integration" and document the new flags.
-
-- [ ] **Step 1: Update the section**
-
-Keep the existing Claude Code description (statusline, auto-sync, context on tap) as a subsection, and above it add:
-
-```markdown
-## Agent integration
-
-One command wires Graft into the coding agents you use:
-
-```bash
-npx @nanonets/graft init
-# detects your agents and writes each one's native instruction file;
-# Claude Code additionally gets the live statusline + hooks below
-```
-
-`init` auto-detects which agents are present (via their config directories) and
-writes a marker-fenced Graft section into each one's instruction file —
-`AGENTS.md`, `GEMINI.md`, `.cursor/rules/`, `.github/copilot-instructions.md`,
-`.kiro/steering/`, `.windsurf/rules/`. Re-running updates only the fenced
-section and never touches your own content. Flags: `--agents <ids...>` to pick,
-`--all-agents` for everything, `--no-agents` for Claude Code only,
-`--list-agents` to see ids.
-```
-
-- [ ] **Step 2: Verify the markdown renders** (view the diff; no code to run)
-
-- [ ] **Step 3: Commit**
-
-```bash
-git add README.md
-git commit -m "docs: graft init now integrates all detected coding agents"
-```
-
----
-
-## Out of scope (follow-up plans)
-
-- **Phase 2 — `graft mcp`:** stdio MCP server exposing `ask` / blast-radius / `check`, plus per-host server registration (JSON/TOML config merges, host CLI registration where available).
-- **Phase 3 — active hooks for non-Claude hosts:** pre-tool-use guards and post-edit sync for hosts whose hook systems support it.
-- Interactive host picker (needs a prompt dependency — revisit with Phase 2).
-
-## Self-Review
-
-- Spec coverage: registry (T3), instruction files for the six host families (T2/T4), detection (T3), CLI flags incl. escape hatches (T5), idempotency (T1/T4 tests), docs (T6). Claude Code path untouched — verified by running the existing suite in T5 Step 4. ✓
-- Placeholders: none — every step has complete code or an exact command. ✓
-- Type consistency: `HostTarget`/`DetectProbe` defined in T3 and consumed with identical shapes in T4; `upsertSection` return `{action}` used consistently. ✓
diff --git a/docs/superpowers/plans/2026-07-22-ask-warm-load.md b/docs/superpowers/plans/2026-07-22-ask-warm-load.md
deleted file mode 100644
index 31bd10e2..00000000
--- a/docs/superpowers/plans/2026-07-22-ask-warm-load.md
+++ /dev/null
@@ -1,88 +0,0 @@
-# Ask Warm Load & Slim Wiring Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** Cut the redundant per-call load cost that dominates `ask` latency at scale: the MCP server stops re-parsing the graph on every tool call (warm ~0.3s queries), and `wiring.json` sheds its `body_text` payload (56MB → ~20MB on a 32k-node graph), cutting cold load for every consumer and shrinking the committed artifact ~3×.
-
-**Architecture:** (1) A tiny mtime-keyed loader cache (`src/graph/load.ts`) wraps `readGraph` + `readAskIndex`; the MCP tools use it so a long-lived `graft mcp` process parses once per graph version. (2) `writeGraph` stops serializing `body_text` (the ask sidecar already carries those tokens); `ask`'s fallback path (no sidecar) keeps working via name/path/signature/summary and, for OLD graphs that still carry `body_text`, uses it as before. No schema version bump — the field was always optional.
-
-**Tech Stack:** TypeScript ESM, Node ≥20, node:test + tsx. No new dependencies.
-
-## Global Constraints
-
-- No new npm dependencies; ESM `.js` imports; files <500 lines.
-- Ranking parity: on a graph WITH a sidecar, ask results must be byte-identical before/after slimming (the sidecar already provides body tokens). On a NEW slim graph WITHOUT a sidecar, ask must degrade gracefully (name/path/signature/summary matching), never crash.
-- Old graphs (with body_text, with or without sidecar) keep working unchanged.
-- Cache correctness beats speed: the loader must re-parse when the file's (mtime, size) changes; a stale cache serving old graph data is a bug.
-- CLI one-shot behavior unchanged (cache is per-process; one-shot processes see no difference).
-- No third-party tool names anywhere.
-- Acceptance (measure and record in reports, big graph = 32,377 nodes at /private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/d3b217f7-4a78-4399-b91a-8bb7db720797/scratchpad/bigrepo-graft, repo /Users/shrishdwivedi/Documents/Nanonets/assign):
- - MCP `tools/call` graft_ask twice in one server session: 2nd call ≥3× faster than 1st.
- - After rebuild with slim wiring: wiring.json ≤ 25MB; cold `ask` ≤ 0.7s; 6-way concurrent asks ≤ 3s each.
-
----
-
-## File Structure
-
-- Create: `src/graph/load.ts` — `loadGraphCached(outDir)`, `loadAskIndexCached(outDir)` with (path, mtimeMs, size)-keyed memoization.
-- Modify: `src/mcp/tools.ts` — use the cached loaders (ask needs the engine… see Task 1 notes: graft_blast_radius uses loadGraphCached; graft_ask flows through engine.ask which reads internally — Task 1 threads a preloaded graph/index through `ask()` opts, or exposes cache at the read layer; decide per the note).
-- Modify: `src/graph/write.ts` — `writeGraph` drops `body_text` from serialized nodes.
-- Modify: `src/ask/ask.ts` — fallback path tolerates absent body_text.
-- Tests: `test/graph-load.test.ts`, extend `test/ask-index.test.ts` / `test/mcp-tools.test.ts`.
-
----
-
-### Task 1: mtime-keyed loader cache + MCP warm path
-
-**Files:**
-- Create: `src/graph/load.ts`
-- Modify: `src/mcp/tools.ts`, and the minimal seam in `src/ask/ask.ts` (see note)
-- Test: `test/graph-load.test.ts`
-
-**Interfaces:**
-- `loadGraphCached(outDir: string): GraphV1 | null` — returns the parsed wiring graph; re-reads only when `(mtimeMs, size)` of the wiring file changed; returns null when missing (same semantics as `readGraph`).
-- `loadAskIndexCached(outDir: string): AskIndex | null` — same for the sidecar (wraps `readAskIndex`).
-- IMPLEMENTATION NOTE (resolve before coding): `engine.ask()` → `src/ask/ask.ts` currently reads wiring+index internally per call. Give `ask()` (and `Graft.ask`) an optional escape: read through the new cached loaders instead of direct `readGraph`/`readAskIndex` calls — i.e., replace ask.ts's internal read call sites with the cached loaders. That single change warms BOTH the CLI-in-one-process case and the MCP server, with zero API change. `callTool`'s `graft_blast_radius` likewise switches to `loadGraphCached`. The cache module must be dependency-free (fs + the two readers) to avoid cycles: load.ts imports from graph/write.js and ask/index-file.js only.
-- Cache invalidation test is mandatory: build fixture graph → load (parse #1) → touch/rewrite wiring with a changed node → load again → new content visible. Track parse counts via an internal counter exported for tests (`__parseCount` or an injectable hook).
-
-- [ ] **Step 1: Failing tests** (`test/graph-load.test.ts`): (a) two loads, same file → same object identity (or parseCount 1); (b) rewrite file (different content → different size/mtime; use `utimesSync` to force distinct mtime if needed) → reload picks up new content, parseCount 2; (c) missing file → null, and a later-created file is picked up; (d) MCP-level: spawn is overkill — instead unit-test that `callTool` twice on the same dir doesn't reparse (parseCount stable after first call), using the counter.
-- [ ] **Step 2: Verify failure. Step 3: Implement. Step 4: Full suite green** (`node --import tsx --test test/*.test.ts`) — existing ask/mcp tests must pass unchanged (parity: cached loaders return identical data).
-- [ ] **Step 5: Acceptance** — script an MCP session against the big graph: initialize → tools/call graft_ask → tools/call graft_ask again; record both wall times from the client side (expect 2nd ≥3× faster). Include numbers in the report.
-- [ ] **Step 6: Commit** — `perf(ask): mtime-keyed graph/index cache — warm queries in long-lived processes`
-
----
-
-### Task 2: Slim wiring.json (body_text moves out)
-
-**Files:**
-- Modify: `src/graph/write.ts` (strip `body_text` in `writeGraph` serialization — keep the in-memory type field optional/intact since build uses it to produce the sidecar BEFORE writing), `src/graph/build.ts` (ensure ordering: sidecar written from the in-memory graph that still has body_text; wiring written slim), `src/ask/ask.ts` (fallback tolerates absent body_text).
-- Test: extend `test/ask-index.test.ts` + `test/graph-write` coverage wherever wiring round-trips are asserted.
-
-**Interfaces:** unchanged public API. Behavior contract:
-- New builds: wiring.json contains NO `body_text` on any node; sidecar carries the tokens (already true).
-- `ask` WITH sidecar: results identical to pre-slim (assert by building a fixture pre-slim vs post-slim… simplest: assert post-slim ask results equal the sidecar-driven results from Task-set 2026-07-21, i.e. run lexical() with sidecar on slim graph vs with sidecar on fat graph — same hits/scores).
-- `ask` WITHOUT sidecar on a SLIM graph: no crash; body field contributions are simply absent (signature+summary still tokenized); add an explicit test.
-- `ask` on an OLD fat graph without sidecar: unchanged behavior (body_text used) — regression-guard with a fixture that injects body_text manually.
-- `check`/`viz`/`cards` unaffected (verify by suite).
-
-- [ ] **Step 1: Failing tests** for the four contract lines above. **Step 2-4: implement, full suite green.**
-- [ ] **Step 5: Acceptance** — rebuild the big graph; record: wiring.json size (expect ~≤25MB from 56MB), cold `ask` wall time (expect ≤0.7s), and the 6-way concurrent run (expect ≤3s each; command pattern: six backgrounded `graft --dir <graph> ask "<q i>" <repo>` + wait, timed).
-- [ ] **Step 6: Commit** — `perf(graph): slim wiring.json — body_text lives only in the ask index sidecar`
-
----
-
-### Task 3: Verification & docs touch
-
-- [ ] Full suite + build. Re-run acceptance trio (warm MCP, cold ask, concurrency) and tabulate before/after in the task report.
-- [ ] README: if any wiring-size or latency claims exist, update; otherwise no doc change. Ledger updated.
-- [ ] Commit only if files changed.
-
-## Out of scope
-- A standalone daemon (the MCP server IS the warm process; hooks stay one-shot with the now-halved cold cost).
-- Sidecar format compaction (separate, lower-value).
-- Convergence signals / ranking hygiene (0.5.0 milestone).
-
-## Self-Review
-- Cache staleness covered by mandatory invalidation test; identity of results guaranteed by routing through existing readers. ✓
-- Slim-graph compat matrix has all four cells tested (sidecar × body_text presence). ✓
-- Build-order hazard (sidecar must be generated from in-memory nodes BEFORE body_text is dropped at serialization — not from a re-read of slim wiring) explicitly called out in Task 2 files list. ✓
diff --git a/docs/superpowers/plans/2026-07-22-graph-commands.md b/docs/superpowers/plans/2026-07-22-graph-commands.md
deleted file mode 100644
index 6be0d0be..00000000
--- a/docs/superpowers/plans/2026-07-22-graph-commands.md
+++ /dev/null
@@ -1,66 +0,0 @@
-# Graph Commands (callers / callees / impact) Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** Make graph traversal a first-class precise mode: `graft callers <symbol>`, `graft callees <symbol>`, `graft impact <symbol>` on the CLI and as MCP tools — the coupling-discovery capability benchmarks showed is the product's durable accuracy edge — and fix the silent/broken structural path inside `ask` using the same resolver.
-
-**Architecture:** One new pure module `src/graph/traverse.ts` owns symbol resolution (qualified/dotted names, multi-match disambiguation) and edge walking over the loaded wiring graph (via the warm `loadGraphCached`). The CLI adds three commands with human + `--json` output. The MCP server gains `graft_callers`/`graft_callees` and upgrades `graft_blast_radius`→ depth-aware impact. `ask`'s structural intent path delegates subject resolution to the same resolver and reports empty results loudly ("no indexed callers — fall back to grep"), never as a silent stub.
-
-**Tech Stack:** TypeScript ESM, Node ≥20, node:test + tsx. No new dependencies.
-
-## Global Constraints
-
-- No new npm dependencies; ESM `.js` imports; files <500 lines.
-- Symbol resolution contract (all commands share it): match against node `name` (case-insensitive) AND against id suffixes so qualified names work (`Cache.get` matches id `src/cache.ts#Cache.get`; `hashstructure.Hash` resolves by its last segment when the full form misses). Multiple matches are NOT an error: list every match with its `path:span` and traverse ALL of them, grouping output per match. An optional `--in <path-substring>` filter narrows candidates.
-- Traversal edges: `calls`, `references`, `imports`, `implements`, `extends` (same set as graphrank's WALK_RELATIONS). `contains` is excluded.
-- Empty results must be loud and actionable: state that the graph has no indexed edges for the symbol and suggest the fallback (`grep -rn "<name>"`), on stderr for CLI / in the text content for MCP. Never print a bare empty list.
-- Reuse `loadGraphCached` (never readGraph directly) so MCP calls stay warm.
-- Existing tests stay green; no behavior change to lexical ask.
-- No third-party tool names anywhere.
-
----
-
-## File Structure
-
-- Create: `src/graph/traverse.ts` — `resolveSymbol`, `callersOf`, `calleesOf`, `impactOf` + types.
-- Modify: `src/cli.ts` — three new commands.
-- Modify: `src/mcp/tools.ts` — new/updated tools.
-- Modify: `src/ask/ask.ts` — `structural()` uses `resolveSymbol`; loud empty handling (`note` field set; formatter prints it).
-- Tests: `test/graph-traverse.test.ts`, extend `test/mcp-tools.test.ts`, extend `test/ask.test.ts` (structural cases only).
-
----
-
-### Task 1: Traversal core (`src/graph/traverse.ts`)
-
-**Interfaces:**
-- `interface SymbolMatch { node: NodeV1 }`
-- `resolveSymbol(graph: GraphV1, query: string, opts?: { in?: string }): NodeV1[]` — resolution contract from Global Constraints; excludes `kind: 'file'` nodes unless nothing else matches AND the query looks like a filename (contains `.` + no `#`).
-- `interface EdgeHit { node: NodeV1 | null; id: string; relation: Relation; depth: number }` (`node` null for unresolved targets, e.g. external import strings — keep them, labeled by raw id)
-- `callersOf(graph, symbol: NodeV1): EdgeHit[]` — nodes with an edge (walk relations) whose target is the symbol (depth 1).
-- `calleesOf(graph, symbol: NodeV1): EdgeHit[]` — edges out of the symbol (depth 1).
-- `impactOf(graph, symbol: NodeV1, maxDepth = 2): EdgeHit[]` — BFS over INCOMING walk edges up to maxDepth (who breaks if this changes), deduped by node id, each hit carrying the depth at first reach.
-
-- [ ] **Step 1: failing tests** (`test/graph-traverse.test.ts`) with a hand-built fixture graph (nodeStub/graphOf helpers like test/graphrank.test.ts): resolution by bare name, case-insensitive; qualified `Class.method` via id suffix; last-segment fallback for `pkg.Fn`; `--in` filter; multi-match returns all; callers/callees correctness incl. unresolved import target (edge target id not in nodes → EdgeHit with node null); impact BFS depth 2 with dedup (diamond shape counted once, min depth), depth cap respected; empty results → [].
-- [ ] **Step 2-4:** verify fail → implement → traverse tests + full suite green.
-- [ ] **Step 5: Commit** — `feat(graph): traversal core — symbol resolution + callers/callees/impact`
-
-### Task 2: CLI commands
-
-- `graft callers <symbol> [dir] [--in <path>] [--json]`, `graft callees ...` (same shape), `graft impact <symbol> [dir] [-d <depth>] [--in <path>] [--json]`.
-- Human output, per resolved match: header `<name> · <kind> · <path>:<span>` then one line per hit: `<relation> ← <name> (<path>:<span>)` for callers/impact (with `[depth N]` for impact), `→` direction for callees. Unresolved targets print the raw id with `(unresolved import)`.
-- No matches for the symbol → stderr `✗ no symbol "<q>" in the graph — check spelling or run graft build` exit 1. Matches but zero edges → stdout header plus the loud empty note (`no indexed callers — the graph has no incoming call/reference edges for this symbol; try grep -rn "<name>"`), exit 0.
-- `--json`: `{ query, matches: [{ symbol: {id,name,kind,path,span}, hits: [...] }] }`.
-- [ ] Steps: failing CLI tests (execFileSync pattern from test/hosts-init.test.ts, on a built fixture repo — reuse the builtRepo helper pattern from test/mcp-tools.test.ts) covering: happy path callers, --json shape, unknown symbol exit 1, zero-edge loud note; implement; full suite; commit `feat(cli): graft callers / callees / impact commands`.
-
-### Task 3: MCP tools + ask structural fix
-
-- MCP: add `graft_callers` and `graft_callees` tools ({symbol, in?}); upgrade `graft_blast_radius` description + impl to `impactOf` with optional `depth` (default 2) while keeping the tool name (hosts already have it registered). All via `loadGraphCached`. Zero-edge results return the loud note text with `isError: false` (a true empty is an answer, but it must say what it means and suggest grep).
-- `ask` structural path (`src/ask/ask.ts` `structural()`): replace `findSubject` with `resolveSymbol`; when intent matches (INCOMING/OUTGOING regexes) but subjects resolve to zero nodes OR zero edges, return an AskResult whose `note` says the structural index found nothing for the subject and the lexical results follow (then fall through to lexical instead of returning a bare empty structural result). `formatAsk` must surface the note prominently.
-- [ ] Steps: failing tests (MCP: callers tool round-trip on fixture, blast_radius depth param; ask: "who calls <qualified.name>" resolves via suffix — the previously-broken case — and empty-structural falls through to lexical with the note); implement; FULL suite; commit `feat(mcp,ask): graph tools + loud structural fallback`.
-
-## Out of scope
-- Path-between-symbols, Go interface-satisfaction edges (future).
-- README/skill updates — land with 0.4.4's guidance ship.
-
-## Self-Review
-- Resolution contract centralized once, consumed by 3 surfaces. ✓ Fixture-graph tests cover the dotted-name bug class directly. ✓ Loud-empty is specified for all 3 surfaces with distinct wording. ✓ No placeholder steps: interfaces fully typed above; test lists enumerate concrete cases. ✓
diff --git a/docs/superpowers/plans/2026-07-22-typed-calls-grep-map.md b/docs/superpowers/plans/2026-07-22-typed-calls-grep-map.md
deleted file mode 100644
index aa0faa14..00000000
--- a/docs/superpowers/plans/2026-07-22-typed-calls-grep-map.md
+++ /dev/null
@@ -1,430 +0,0 @@
-# Typed Method Calls + Symbol-Grouped Grep + Repo Map Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** Close graft's biggest correctness gap (instance-method call edges dropped as ambiguous: 1 vs ~37 callers of `include_router` on fastapi) via a lightweight receiver-type binding pass for Python/TypeScript/TSX/Go; add `graft grep` (search grouped by enclosing symbol with in-degree); add `graft map` (compact deterministic repo orientation) — each on CLI + MCP — plus fix the `graft mcp --dir` override bug.
-
-**Architecture:** (1) A per-file binding pass (`src/graph/bindings.ts`) collects variable→type bindings from constructor calls, annotations, and receiver declarations during extraction; `extract.ts` attaches the resolved receiver type to member-call raw edges (`recvType`); `resolve.ts` gains an owner-qualified method index (`Class.method`) plus a bounded `extends`-chain walk, so typed member calls resolve to the right class's method instead of being dropped as name-ambiguous. Untyped receivers keep today's drop-don't-guess behavior. (2) `graft grep` runs a regex over the graph's indexed files and groups hits by innermost enclosing symbol, ranked by incoming-edge count. (3) `graft map` renders a token-budgeted orientation (directory clusters, hubs, hotspots) from the wiring graph alone.
-
-**Tech Stack:** TypeScript ESM, Node ≥20, tree-sitter (existing grammars only), node:test + tsx. No new dependencies.
-
-## Global Constraints
-
-- No new npm dependencies; ESM `.js` import specifiers; keep every file under 500 lines.
-- Supported languages are exactly `typescript | tsx | python | go` (`languageOf` in src/graph/extract.ts). The binding pass must cover **all four** (tsx shares the TS shapes).
-- Edge philosophy is inviolable: **never wire an edge to the wrong symbol**. Typed resolution may only ADD edges it is confident about (unique owner-qualified match, or same-file match); ambiguity at any step → drop, exactly like today. Untyped member calls keep current behavior bit-for-bit.
-- Empty results stay loud and actionable (existing traverse-cli wording); `graft grep` and `graft map` must never print a bare empty list — say what was searched and suggest the fallback.
-- All graph consumers read through `loadGraphCached` (src/graph/load.ts), never `readGraph` directly.
-- No competitor/third-party tool names anywhere in code, comments, docs, or commit messages — describe patterns generically.
-- Full suite green after every task: `node --import tsx --test test/*.test.ts` (216 tests pass at plan time). `npm run build` clean before each commit.
-- Commit messages: NO Co-Authored-By trailer (project rule).
-- Wiring schema: `EdgeV1 { source, target, relation, confidence: "extracted" | "inferred" }` — unchanged. `RawEdge` (extract-internal, never serialized) gains one optional field.
-- MCP tool count assertions: test/mcp-tools.test.ts and the Gate-A style checks expect the tool list; update the expected list to exactly 7 tools when adding `graft_grep` and `graft_map`.
-
----
-
-## File Structure
-
-- Create: `src/graph/bindings.ts` — per-file receiver-type binding collection (pass 1 of extraction).
-- Modify: `src/graph/extract.ts` — capture receiver text on member calls; look up `recvType` via bindings; track enclosing class.
-- Modify: `src/graph/resolve.ts` — owner-qualified method index + `extends`-chain typed resolution.
-- Create: `src/graph/relations.ts` — the shared `WALK_RELATIONS` set (currently duplicated in traverse.ts and graphrank.ts).
-- Create: `src/search/grep.ts` — pure grep-and-group core; `src/search/grep-cli.ts` — CLI formatter + runner.
-- Create: `src/graph/map.ts` — pure repo-map builder + formatter.
-- Modify: `src/cli.ts` — register `grep` and `map` commands (file is 347 lines; the two registrations add ~30 — stays under 500).
-- Modify: `src/mcp/tools.ts` — `--dir` bug fix; register `graft_grep` + `graft_map` (170 lines now; if additions push it past ~480, move the two new tool handlers into `src/mcp/tools-search.ts` and re-export).
-- Modify: `src/claude/skill-template.ts`, `src/hosts/instructions.ts` — guidance: sweeps route to `graft grep`, first contact to `graft map`.
-- Modify: `README.md` — command table + short sections.
-- Tests: create `test/graph-bindings.test.ts`, `test/graph-resolve-typed.test.ts`, `test/search-grep.test.ts`, `test/graph-map.test.ts`; extend `test/mcp-tools.test.ts`, `test/claude-skill-template.test.ts`, `test/hosts-instructions.test.ts`.
-
-Task order: 1 (bug fix) → 2 (bindings) → 3 (typed resolve + acceptance) → 4 (grep) → 5 (map) → 6 (guidance + README + final acceptance). Tasks 4 and 5 don't depend on 2–3 but come after so the acceptance in 6 measures everything together.
-
----
-
-### Task 1: Fix `graft mcp` ignoring the global `--dir` override
-
-Head-to-head testing found `graft mcp --dir <graphdir>` silently uses the default `graft/` dir: `src/mcp/tools.ts` calls `contextDirFor(root)` with no override (lines 130 and 154), while the CLI's other commands pass `globalOpts.dir` (see src/cli.ts:209, 332).
-
-**Files:**
-- Modify: `src/mcp/tools.ts` (the two `contextDirFor(root)` call sites + the exported factory signature)
-- Modify: `src/cli.ts` (the `mcp` command action — find it with `grep -n "mcp" src/cli.ts` — must read `program.opts().dir` and pass it through)
-- Test: extend `test/mcp-tools.test.ts`
-
-**Interfaces:**
-- Consumes: existing `contextDirFor(root: string, override?: string)` from src/context/node-file.ts (verify its signature first; cli.ts:209 shows it takes the override as 2nd arg).
-- Produces: whatever function `src/mcp/tools.ts` exports to build the tool handlers (read the file top; likely a `createTools(root)` or similar) gains an optional `dirOverride?: string` parameter, threaded to every `contextDirFor` call.
-
-- [ ] **Step 1: Write the failing test** — in test/mcp-tools.test.ts, using the existing builtRepo fixture pattern from that file: build a fixture repo whose graph lives in a NON-default dir (build with the CLI: `node --import tsx src/cli.ts build <repo> --dir <repo>/customgraph` — check `graft build --help` for the exact flag spelling used by the global option), then call the tools factory with the override and assert `graft_check`/`graft_callers` finds the graph; call it without the override and assert it reports no graph.
-- [ ] **Step 2: Run it** — `node --import tsx --test test/mcp-tools.test.ts` → the override case FAILS (tools can't find the graph).
-- [ ] **Step 3: Implement** — thread `dirOverride` through the tools factory into both `contextDirFor(root, dirOverride)` call sites; in src/cli.ts's mcp action, pass the program-level `--dir` value.
-- [ ] **Step 4: Full suite green.**
-- [ ] **Step 5: Commit** — `fix(mcp): honor the global --dir override for the graph location`
-
----
-
-### Task 2: Receiver-type bindings (`src/graph/bindings.ts`) + extraction capture
-
-The binding pass answers one question at each member call site: *what type is the receiver?* Sources of truth, all verified against the vendored grammars:
-
-| Lang | Clue | Tree shape (verified) |
-|---|---|---|
-| py | `app = FastAPI()` | `assignment(left: identifier, right: call(function: identifier))` |
-| py | `r: APIRouter = ...` / class field `q: Queue` | `assignment` with `type` field → `type(identifier)` |
-| py | `def go(self, x: Item)` | `typed_parameter(identifier, type(identifier))` |
-| py | `self.w = Worker()` in a method | `assignment(left: attribute(self, w), right: call(identifier))` — bind key `self.w` at class scope |
-| py | `from fastapi import FastAPI as F` | `import_from_statement > aliased_import(dotted_name, identifier)` — alias map F→FastAPI |
-| ts/tsx | `const app = new FastAPI()` | `variable_declarator(name: identifier, value: new_expression(constructor: identifier))` |
-| ts/tsx | `let r: Router` / param `x: Item` / field `q: Queue` | `type_annotation > type_identifier` under `variable_declarator` / `required_parameter` / `public_field_definition` |
-| ts/tsx | `q: Queue = new Queue()` class field | `public_field_definition(property_identifier, type_annotation, new_expression)` — bind key `this.q` at class scope |
-| ts/tsx | `import { Router as R } from './r'` | `import_specifier(identifier name, identifier alias)` |
-| go | `u := User{}` / `u := &User{}` | `short_var_declaration(expression_list(identifier), expression_list(composite_literal(type: type_identifier)))` (unary `&` wraps the composite_literal) |
-| go | `var d *DB` | `var_spec(name: identifier, type: pointer_type(type_identifier) \| type_identifier)` |
-| go | `s := NewServer()` | `short_var_declaration(..., call_expression(function: identifier))` — Go convention: `NewX(...)` binds to `X` (confidence handled in Task 3: this binding is convention-derived, still resolved unique-or-drop) |
-| all | `self` / `this` / Go receiver var | NOT a binding-map entry — extract.ts maps it from the enclosing class / the method_declaration's receiver (existing `goReceiverType`) |
-
-**Scope model:** bindings are collected in a single pre-order walk that mirrors extract.ts's scope stack. Store entries in a `Map<string, string>` keyed `` `${scopePath}|${name}` `` where `scopePath` is `scope.join(".")` (`""` at module level). Lookup walks the scope chain innermost→outermost (pop one segment at a time, ending at `""`). A later binding in the same scope overwrites an earlier one (last write wins — good enough; reassignment to a different type is rare and the failure mode is a dropped edge in Task 3, never a wrong one... note: it CAN produce a wrong-type lookup if a variable is reassigned mid-function and called in between; accepted as negligible for real code and bounded by unique-or-drop matching). `self.attr`/`this.attr` entries are stored with name `self.attr`/`this.attr` at the CLASS scope path.
-
-**Files:**
-- Create: `src/graph/bindings.ts` (~180 lines)
-- Modify: `src/graph/extract.ts` — see integration below
-- Test: create `test/graph-bindings.test.ts`
-
-**Interfaces (produced — Task 3 and extract.ts rely on these exactly):**
-```ts
-// src/graph/bindings.ts
-import type Parser from "tree-sitter";
-import type { Language } from "./extract.js";
-
-export class FileBindings {
- /** map: `${scopePath}|${name}` -> bare type name (aliases already resolved) */
- private map = new Map<string, string>();
- set(scopePath: string, name: string, type: string): void;
- /** innermost-first: tries `a.b|x`, `a|x`, `|x` for scope ["a","b"], name "x" */
- lookup(scope: string[], name: string): string | null;
-}
-
-/** Pass 1 over a parsed file: collect variable->type bindings. Pure. */
-export function collectBindings(root: Parser.SyntaxNode, lang: Language): FileBindings;
-```
-
-```ts
-// src/graph/extract.ts — RawEdge gains:
-export interface RawEdge {
- // ...existing fields unchanged...
- /** calls with viaMember: the receiver's resolved type name (from bindings /
- * self / this / Go receiver), when a confident local clue exists. */
- recvType?: string;
-}
-```
-
-**extract.ts integration (exact changes):**
-1. `extractFile`: after `parseSource`, call `const bindings = collectBindings(root, lang)`; add `bindings` and `enclosingClass: string | null` to `WalkCtx` (enclosingClass set to `desc.name` when descending into a `kind === "class"` definition, and for Go methods set from the existing `goReceiverType(node)` result when descending into a `method_declaration`; inherited through `childCtx` otherwise).
-2. `calleeName` gains receiver extraction — return type becomes `{ name: string; viaMember: boolean; receiver?: string }`:
- - py `attribute`: object field — `identifier` → its text; `identifier self/cls` handled by caller; `attribute(self, x)` (i.e. object is `attribute` whose own object is `self`) → `"self.x"`; anything else → no receiver.
- - ts/tsx `member_expression`: object `identifier` → text; `this` → `"this"`; `member_expression(this, prop)` → `"this.prop"`; else none.
- - go `selector_expression`: operand `identifier` → text; else none.
-3. In `walk`'s call branch, compute `recvType`:
- ```ts
- let recvType: string | undefined;
- const r = callee.receiver;
- if (r === "self" || r === "cls" || r === "this") recvType = ctx.enclosingClass ?? undefined;
- else if (r?.startsWith("self.") || r?.startsWith("this.")) {
- // class-scope attr binding: normalize both prefixes to how bindings stored them
- recvType = ctx.bindings.lookup(ctx.scope, r) ?? ctx.bindings.lookup(ctx.scope, r.replace(/^this\./, "self.")) ?? undefined;
- } else if (r) {
- // Go: an identifier receiver that IS the method's receiver var binds to the receiver type
- recvType = (ctx.lang === "go" && r === ctx.goReceiverVar ? ctx.enclosingClass : undefined)
- ?? ctx.bindings.lookup(ctx.scope, r) ?? undefined;
- }
- if (recvType) edges.push({ ...callEdge, recvType }); else edges.push(callEdge);
- ```
- (`goReceiverVar`: capture the receiver parameter's variable name alongside `goReceiverType` when describing a Go method — extend `describeGo`/`WalkCtx` accordingly. Store `self.attr` bindings with the `self.` prefix only; the lookup normalizes `this.` → `self.` so one storage convention serves py and ts.)
-4. `collectBindings` walk maintains its own scope stack using the SAME definition-recognition rules — to avoid duplicating `describe()`, export a tiny helper from extract.ts: `export function defName(node: Parser.SyntaxNode, lang: Language): string | null` returning the name for def-node types (class/function/method/type_spec/variable_declarator-with-function — reuse the existing describe logic's name reads; refactor `describe` to call it). bindings.ts imports `defName` (no cycle: extract imports bindings for `collectBindings`, bindings imports only the type + `defName` — put `defName` in bindings.ts instead if that creates a cycle: bindings.ts must NOT import extract.ts values, only `import type`. Decision: implement `defName` inside bindings.ts, duplicating only the small name-field reads (`childForFieldName("name")`, TS variable_declarator, Go type_spec) with a comment pointing at describe(); ~25 lines, acceptable duplication to keep imports acyclic.)
-
-- [ ] **Step 1: failing tests** (`test/graph-bindings.test.ts`) — parse snippets with the real grammars via `extractFile` and assert on the returned `rawEdges` (this tests collection + capture end-to-end):
-
-```ts
-import { test } from "node:test";
-import assert from "node:assert/strict";
-import { extractFile } from "../src/graph/extract.js";
-
-function callEdges(src: string, lang: "python" | "typescript" | "go", file = `x.${lang === "python" ? "py" : lang === "go" ? "go" : "ts"}`) {
- return extractFile(file, src, lang).rawEdges.filter((e) => e.relation === "calls");
-}
-
-test("py: constructor assignment binds receiver type", () => {
- const edges = callEdges("class A:\n def m(self): pass\napp = A()\ndef f():\n app.m()\n", "python");
- const call = edges.find((e) => e.name === "m" && e.viaMember);
- assert.equal(call?.recvType, "A");
-});
-
-test("py: parameter annotation binds", () => {
- const edges = callEdges("def f(app: FastAPI):\n app.include_router()\n", "python");
- assert.equal(edges.find((e) => e.name === "include_router")?.recvType, "FastAPI");
-});
-
-test("py: self binds to enclosing class; self.attr via __init__ assignment", () => {
- const src = "class S:\n def __init__(self):\n self.q = Queue()\n def go(self):\n self.helper()\n self.q.put(1)\n";
- const edges = callEdges(src, "python");
- assert.equal(edges.find((e) => e.name === "helper")?.recvType, "S");
- assert.equal(edges.find((e) => e.name === "put")?.recvType, "Queue");
-});
-
-test("py: import alias resolves to original name", () => {
- const edges = callEdges("from fastapi import FastAPI as F\napp = F()\napp.get()\n", "python");
- assert.equal(edges.find((e) => e.name === "get")?.recvType, "FastAPI");
-});
-
-test("py: unknown receiver leaves recvType unset (chained call)", () => {
- const edges = callEdges("def f():\n factory().run()\n", "python");
- assert.equal(edges.find((e) => e.name === "run")?.recvType, undefined);
-});
-
-test("ts: new-expression + type annotation + this", () => {
- const src = "class S {\n q: Queue = new Queue();\n go() { this.helper(); this.q.put(1); }\n helper() {}\n}\nconst app = new FastAPI();\nfunction f(r: Router) { app.mount(); r.use(); }\n";
- const edges = callEdges(src, "typescript");
- assert.equal(edges.find((e) => e.name === "helper")?.recvType, "S");
- assert.equal(edges.find((e) => e.name === "put")?.recvType, "Queue");
- assert.equal(edges.find((e) => e.name === "mount")?.recvType, "FastAPI");
- assert.equal(edges.find((e) => e.name === "use")?.recvType, "Router");
-});
-
-test("go: composite literal, var decl, NewX convention, receiver var", () => {
- const src = "package m\nfunc f() {\n u := User{}\n var d *DB\n s := NewServer()\n u.Save()\n d.Query()\n s.Start()\n}\nfunc (w *Worker) run() { w.stop() }\n";
- const edges = callEdges(src, "go", "x.go");
- assert.equal(edges.find((e) => e.name === "Save")?.recvType, "User");
- assert.equal(edges.find((e) => e.name === "Query")?.recvType, "DB");
- assert.equal(edges.find((e) => e.name === "Start")?.recvType, "Server");
- assert.equal(edges.find((e) => e.name === "stop")?.recvType, "Worker");
-});
-
-test("scope shadowing: inner binding wins", () => {
- const src = "app = A()\ndef f():\n app = B()\n app.m()\n";
- const edges = callEdges(src, "python");
- assert.equal(edges.find((e) => e.name === "m")?.recvType, "B");
-});
-```
-
-- [ ] **Step 2: run** `node --import tsx --test test/graph-bindings.test.ts` → all FAIL (`recvType` undefined everywhere / collectBindings not found).
-- [ ] **Step 3: implement** bindings.ts + the extract.ts integration exactly as specified above.
-- [ ] **Step 4: bindings tests + FULL suite green** (existing extract tests in test/graph-go.test.ts etc. must pass unchanged — recvType is additive).
-- [ ] **Step 5: Commit** — `feat(graph): receiver-type binding pass — member calls carry their receiver's type`
-
----
-
-### Task 3: Typed member-call resolution in `resolve.ts` + fastapi acceptance
-
-**Files:**
-- Modify: `src/graph/resolve.ts`
-- Test: create `test/graph-resolve-typed.test.ts` (resolveEdges is pure — fixtures are plain arrays)
-
-**Interfaces:**
-- Consumes: `RawEdge.recvType` (Task 2), existing `resolveEdges(nodes, rawEdges, opts)`.
-- Produces: no signature change; behavior addition only.
-
-**Resolution algorithm (replaces the `calls` branch when `e.viaMember && e.recvType`):**
-1. Build once per resolveEdges call: `ownerMethod: Map<string, NodeV1[]>` keyed `` `${ownerName}.${methodName}` `` where for every `kind === "method"` node, `ownerName` is the second-to-last dot-segment of the id's post-`#` part (`a.py#Class.method` → `Class`; `f.go#Recv.m` → `Recv`; a method id with no dot-qualifier is skipped). Also `classParents: Map<string, string[]>` from raw `extends` edges: source id's last post-`#` segment → [e.name] (accumulate).
-2. Try the ownership chain `[recvType, ...ancestors]` where ancestors come from following `classParents` breadth-first, max depth 3, cycle-guarded:
- - candidates = `ownerMethod.get(`${type}.${e.name}`)` — if exactly one → add edge (confidence: `extracted` if `candidate.path === e.file`, else `inferred`); if a same-file candidate exists among several → that one, `extracted`; if several and none same-file → **drop and stop** (do not continue up the chain past an ambiguous owner level); if zero → continue to the next ancestor.
-3. Chain exhausted with no candidate → fall back to the existing untyped path (unique bare-name method), unchanged.
-4. `e.viaMember && !e.recvType` → existing behavior, untouched.
-
-- [ ] **Step 1: failing tests** (`test/graph-resolve-typed.test.ts`):
-
-```ts
-import { test } from "node:test";
-import assert from "node:assert/strict";
-import { resolveEdges } from "../src/graph/resolve.js";
-import type { NodeV1 } from "../src/graph/types.js";
-
-function n(id: string, kind: NodeV1["kind"]): NodeV1 {
- const name = id.includes("#") ? id.split("#")[1].split(".").pop()! : id;
- return { id, name, kind, path: id.split("#")[0], span: "L1-L1", signature: null,
- exported: true, origin: "ast", body_hash: "h", summary_state: "pending", summary: null, crux: null } as NodeV1;
-}
-
-const NODES = [
- n("app.py", "file"), n("app.py#FastAPI", "class"), n("app.py#FastAPI.include_router", "method"),
- n("routing.py", "file"), n("routing.py#APIRouter", "class"), n("routing.py#APIRouter.include_router", "method"),
- n("t.py", "file"), n("t.py#test_x", "function"),
-];
-
-test("typed member call resolves despite global name ambiguity", () => {
- const edges = resolveEdges(NODES, [
- { source: "t.py#test_x", relation: "calls", name: "include_router", viaMember: true, recvType: "FastAPI", file: "t.py" },
- ]);
- const call = edges.find((e) => e.relation === "calls");
- assert.equal(call?.target, "app.py#FastAPI.include_router");
- assert.equal(call?.confidence, "inferred");
-});
-
-test("untyped ambiguous member call still drops (regression guard)", () => {
- const edges = resolveEdges(NODES, [
- { source: "t.py#test_x", relation: "calls", name: "include_router", viaMember: true, file: "t.py" },
- ]);
- assert.equal(edges.filter((e) => e.relation === "calls").length, 0);
-});
-
-test("extends chain: method inherited from parent resolves", () => {
- const nodes = [...NODES, n("sub.py", "file"), n("sub.py#MyApp", "class"), n("u.py", "file"), n("u.py#use", "function")];
- const edges = resolveEdges(nodes, [
- { source: "sub.py#MyApp", relation: "extends", name: "FastAPI", file: "sub.py" },
- { source: "u.py#use", relation: "calls", name: "include_router", viaMember: true, recvType: "MyApp", file: "u.py" },
- ]);
- const call = edges.find((e) => e.relation === "calls");
- assert.equal(call?.target, "app.py#FastAPI.include_router");
-});
-
-test("ambiguous owner level drops instead of guessing", () => {
- const nodes = [...NODES, n("v2.py", "file"), n("v2.py#FastAPI", "class"), n("v2.py#FastAPI.include_router", "method")];
- const edges = resolveEdges(nodes, [
- { source: "t.py#test_x", relation: "calls", name: "include_router", viaMember: true, recvType: "FastAPI", file: "t.py" },
- ]);
- assert.equal(edges.filter((e) => e.relation === "calls").length, 0);
-});
-
-test("same-file owner wins among duplicates, confidence extracted", () => {
- const nodes = [...NODES, n("t.py#FastAPI", "class"), n("t.py#FastAPI.include_router", "method")];
- const edges = resolveEdges(nodes, [
- { source: "t.py#test_x", relation: "calls", name: "include_router", viaMember: true, recvType: "FastAPI", file: "t.py" },
- ]);
- const call = edges.find((e) => e.relation === "calls");
- assert.equal(call?.target, "t.py#FastAPI.include_router");
- assert.equal(call?.confidence, "extracted");
-});
-
-test("unknown recvType falls back to unique bare-name path", () => {
- const nodes = [n("a.py", "file"), n("a.py#Only", "class"), n("a.py#Only.solo", "method"), n("b.py", "file"), n("b.py#f", "function")];
- const edges = resolveEdges(nodes, [
- { source: "b.py#f", relation: "calls", name: "solo", viaMember: true, recvType: "Ghost", file: "b.py" },
- ]);
- assert.equal(edges.find((e) => e.relation === "calls")?.target, "a.py#Only.solo");
-});
-```
-
-- [ ] **Step 2: run** → FAIL (typed calls currently dropped/ignored). **Step 3: implement** per the algorithm. **Step 4: typed tests + FULL suite green.**
-- [ ] **Step 5: Acceptance on fastapi (the 1→37 check).** `git clone --depth 1 https://github.com/fastapi/fastapi /private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/d3b217f7-4a78-4399-b91a-8bb7db720797/scratchpad/fastapi-accept` (reuse if present), `npm run build`, then `node dist/cli.js build <that dir>` and `node dist/cli.js callers include_router <that dir>`. Record the caller count in the task report. **Gate: ≥ 25 distinct callers** (reference tool found 37; we accept ≥25 given our stricter drop rules). Also run `node dist/cli.js callers include_router` on a pre-Task-2 build (git stash or the 0.4.5 dist) to record the before number (expected: 1). Sanity: `node dist/cli.js impact solve_dependencies -d 2 <dir>` still returns the Task-time results (no regression), and total edge count grows < 2× (print both counts).
-- [ ] **Step 6: Commit** — `feat(graph): typed member-call resolution — receiver bindings resolve ambiguous methods`
-
----
-
-### Task 4: `graft grep` — search grouped by enclosing symbol (CLI + MCP)
-
-**Files:**
-- Create: `src/graph/relations.ts` (shared WALK_RELATIONS — traverse.ts:32 and graphrank.ts:25 both import it; delete their local copies)
-- Create: `src/search/grep.ts` (pure core), `src/search/grep-cli.ts` (formatter + CLI runner)
-- Modify: `src/cli.ts` (command), `src/mcp/tools.ts` (tool `graft_grep`)
-- Test: create `test/search-grep.test.ts`; extend `test/mcp-tools.test.ts` (tool list + one round-trip)
-
-**Interfaces (produced):**
-```ts
-// src/graph/relations.ts
-import type { Relation } from "./types.js";
-/** Relations that carry dependency meaning for traversal/ranking (contains excluded). */
-export const WALK_RELATIONS: ReadonlySet<Relation> = new Set(["calls", "references", "imports", "implements", "extends"]);
-```
-```ts
-// src/search/grep.ts
-export interface GrepHit { line: number; text: string } // text trimmed, ≤160 chars
-export interface GrepGroup {
- symbol: { id: string; name: string; kind: string; path: string; span: string } | null; // null → file-level (outside any symbol)
- path: string;
- inDegree: number; // incoming WALK_RELATIONS edges to the symbol (0 for file-level)
- hits: GrepHit[];
-}
-export interface GrepResult {
- pattern: string; filesSearched: number; totalHits: number;
- groups: GrepGroup[]; // sorted: inDegree desc, then path asc
- truncated: { files: number; hits: number }; // dropped counts — never silent
-}
-export function grepGraph(
- graph: GraphV1, repoRoot: string, pattern: string,
- opts?: { ignoreCase?: boolean; fixed?: boolean; in?: string; maxHits?: number /* default 300 */ },
-): GrepResult;
-```
-Core behavior: iterate the graph's `kind === "file"` nodes (filtered by `opts.in` path-substring); read each file from `repoRoot` (skip unreadable — count into `truncated.files`); regex per line (`fixed` → escape); for each hit find the innermost enclosing symbol: per file, pre-sort that file's symbol nodes by span start; innermost = the containing span with the greatest start line (spans parse via the existing `/^L(\d+)-L(\d+)$/`). Group hits per symbol (or per file when uncovered); attach in-degree computed once per call (single pass over `graph.edges` filtered by WALK_RELATIONS, counting by target id). Stop collecting at `maxHits` and record the remainder in `truncated.hits`.
-
-CLI: `graft grep <pattern> [dir]` with `-i, --ignore-case`, `--fixed`, `--in <path>`, `--json`, honoring global `--dir`. Human output (grep-cli.ts):
-```
-"include_router" — 41 hits in 9 symbols across 6 files (searched 1213 indexed files)
-
-FastAPI.include_router · method · fastapi/applications.py:L1108-L1122 · 12 in-edges
- L1110: def include_router(self, router: APIRouter, *, prefix: str = "",
-tests/test_router.py (module level) · 0 in-edges
- L14: app.include_router(router)
-```
-Zero hits → exit 0, stderr: `no hits for "<pattern>" in 1213 indexed files — unindexed files (docs, configs, new files) aren't searched; try grep -rn "<pattern>" for those`. Zero indexed files (no graph) → exit 1, `✗ no graph — run graft build first`.
-MCP tool `graft_grep`: `{ pattern: string, in?: string, ignore_case?: boolean, fixed?: boolean }`, root+dirOverride from the server factory (Task 1), returns the human rendering (like existing tools), truncation note included.
-
-- [ ] **Step 1: failing tests** (`test/search-grep.test.ts`) — build a small fixture repo on disk (the builtRepo helper pattern from test/mcp-tools.test.ts): two TS files where `parse` appears (a) inside a heavily-called function, (b) inside a rarely-called one, (c) at module level. Assert: group order by inDegree; innermost-symbol attribution (a hit inside a method of a class maps to the method, not the class); `in` filter; `fixed` escaping (`a.b` doesn't match `axb`); maxHits truncation surfaces in `truncated.hits`; zero-hit result shape. Plus one WALK_RELATIONS import equivalence test: traverse and graphrank behave identically after the refactor (existing suites cover this — just run them).
-- [ ] **Step 2: verify fail. Step 3: implement (relations.ts refactor first — full suite must stay green after just that refactor — then grep core, CLI, MCP).**
-- [ ] **Step 4: full suite green** (mcp-tools list assertion updated: 6 tools at this point).
-- [ ] **Step 5: Commit** — `feat(search): graft grep — matches grouped by enclosing symbol, ranked by coupling`
-
----
-
-### Task 5: `graft map` — compact repo orientation (CLI + MCP)
-
-**Files:**
-- Create: `src/graph/map.ts`
-- Modify: `src/cli.ts`, `src/mcp/tools.ts` (tool `graft_map`)
-- Test: create `test/graph-map.test.ts`; extend `test/mcp-tools.test.ts` (7-tool list + round-trip)
-
-**Interfaces (produced):**
-```ts
-// src/graph/map.ts
-export interface Hub { name: string; kind: string; path: string; span: string; inDegree: number }
-export interface DirEntry { path: string; files: number; symbols: number; languages: string[]; hubs: Hub[] }
-export interface RepoMap {
- totals: { files: number; symbols: number; edges: number; languages: string[] };
- dirs: DirEntry[]; // sorted by symbol count desc, capped, remainder noted
- hotspots: Hub[]; // global top by inDegree
- dropped: number; // dirs beyond the cap
-}
-export function buildRepoMap(graph: GraphV1, opts?: { maxDirs?: number /* 16 */, hubsPerDir?: number /* 3 */, hotspots?: number /* 12 */ }): RepoMap;
-export function formatRepoMap(map: RepoMap): string; // deterministic, target ≤ 6000 chars
-```
-Grouping: by first path segment; if one segment holds > 60% of all file nodes, split THAT segment one level deeper (single refinement pass — e.g. everything under `src/` becomes `src/ask`, `src/graph`, …). Languages via `languageOf` on file paths. Hubs/hotspots by in-degree over `WALK_RELATIONS` (import from Task 4's relations.ts), ties broken by name asc for determinism. Human rendering:
-```
-repo map — 1213 files · 6707 symbols · 10912 edges · python
-
-fastapi/ 312 files · 2841 symbols hubs: APIRouter (routing.py, 84←), FastAPI (applications.py, 61←), Depends (param_functions.py, 57←)
-tests/ 761 files · 3312 symbols hubs: ...
-
-hotspots: APIRouter · class · fastapi/routing.py:L562-L1470 · 84← ...
-```
-No graph → exit 1 with the standard `run graft build first` line. CLI: `graft map [dir] [--json]`, honors global `--dir`. MCP `graft_map`: `{}` input, returns the rendering.
-
-- [ ] **Step 1: failing tests** (`test/graph-map.test.ts`) — pure fixtures (hand-built GraphV1, nodeStub pattern from test/graphrank.test.ts): totals correct; >60% dir splits one level; hub ordering by inDegree with deterministic ties; formatRepoMap under 6000 chars on a 60-node fixture and contains the hub names; dropped-dirs note appears when maxDirs exceeded.
-- [ ] **Step 2-4: verify fail → implement → full suite green (mcp tool list now exactly: graft_ask, graft_check, graft_blast_radius, graft_callers, graft_callees, graft_grep, graft_map).**
-- [ ] **Step 5: Commit** — `feat(graph): graft map — token-budgeted repo orientation from the wiring graph`
-
----
-
-### Task 6: Guidance, README, and end-to-end acceptance
-
-**Files:**
-- Modify: `src/claude/skill-template.ts` — in the task-shape guidance: the sweep bullet now routes to `graft grep "<literal>"` (grouped by symbol, exhaustive over indexed files, notes what it can't see) with raw `grep -rn` as the fallback for unindexed files; add a first-contact bullet: `graft map` before exploring an unfamiliar repo. Keep the existing validated phrasing style — additive edits, don't rewrite the file.
-- Modify: `src/hosts/instructions.ts` — same two additions in `instructionBody()`, condensed.
-- Modify: `README.md` — command table rows for `grep`/`map`; extend the graph-commands section with one example each (reuse the exact human-output blocks from Tasks 4–5); one line under the callers/impact docs noting method calls resolve through receiver types (constructors/annotations) so qualified coupling queries work on method-heavy code.
-- Tests: extend `test/claude-skill-template.test.ts` + `test/hosts-instructions.test.ts` — assert the new phrases (`graft grep`, `graft map`) appear; existing phrase assertions must keep passing (additive).
-
-- [ ] **Step 1: failing tests** (phrase assertions), **Step 2: verify fail**, **Step 3: implement template/instruction/README edits**, **Step 4: full suite + `npm run build`.**
-- [ ] **Step 5: End-to-end acceptance sweep** (record all numbers in the task report):
- 1. fastapi (from Task 3's checkout): `node dist/cli.js callers include_router` ≥ 25 callers; `node dist/cli.js grep "regex: Annotated" --in param_functions` groups = exactly the 7 param functions (Path/Query/Header/Cookie/Body/Form/File); `node dist/cli.js map` renders < 6000 chars and names APIRouter or FastAPI among hotspots.
- 2. Own repo: `node dist/cli.js init . --no-build && node dist/cli.js build . && node dist/cli.js grep "WALK_RELATIONS"` attributes hits to relations.ts + importers; `graft map` sane.
- 3. MCP: one stdio session listing 7 tools; `graft_grep` + `graft_map` round-trip.
-- [ ] **Step 6: Commit** — `docs(guidance): sweeps via graft grep, orientation via graft map`
-
-## Out of scope
-
-- Chained-call receivers (`factory().run()`), cross-file function-return inference, generics/unions — the treadmill we're deliberately not on. Unknown receivers keep drop-don't-guess.
-- Ranking hygiene (test/generated de-ranking) — separate 0.5.0 item.
-- Release/publish — separate step after review.
-
-## Self-Review
-
-- Spec coverage: #1 → Tasks 2–3 (all four supported languages, tsx via TS shapes); #2 → Task 4; #4 → Task 5; bug found in testing → Task 1; guidance so agents actually use the new surface → Task 6. ✓
-- No placeholders: every step carries code, exact node types verified against the vendored grammars (dumped 2026-07-22), exact commands. ✓
-- Type consistency: `RawEdge.recvType` (Tasks 2→3), `WALK_RELATIONS` from relations.ts (Tasks 4→5), `GrepResult`/`RepoMap` shapes used in CLI/MCP/tests match their definitions. ✓
-- Philosophy guard: regression tests pin untyped behavior (Task 3 test 2) and ambiguous-owner drops (test 4). ✓
diff --git a/docs/superpowers/plans/2026-07-23-scope-aware-ranking.md b/docs/superpowers/plans/2026-07-23-scope-aware-ranking.md
deleted file mode 100644
index 671889b3..00000000
--- a/docs/superpowers/plans/2026-07-23-scope-aware-ranking.md
+++ /dev/null
@@ -1,258 +0,0 @@
-# Scope-Aware Ranking (Multi-Root Workspaces) Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** Fix the confirmed biggest-repo-drowns-everything bug (9/10 cross-repo queries return a 100% single-repo top-10) by making graft scope-aware — git boundaries decide where graphs live, project markers decide ranking partitions, per-scope statistics + reciprocal-rank fusion decide the merged ranking — with a hard guarantee that single-repo behavior, output, and latency are unchanged, and that existing graphs upgrade transparently on their next build.
-
-**Architecture:** Two-level model. (1) A new `discoverScopes()` (generalizing build.ts's `readGoModules` walk) finds ranking scopes inside one graph via marker files (`package.json`, `go.mod`, `pyproject.toml`, workspace globs), with over-split guards; scopes persist as path prefixes in `GraphV1.meta.scopes` (node→scope = nearest-prefix lookup, no per-node field, old graphs = one scope = today's behavior). (2) `ask` partitions scoring by scope: per-scope IDF and per-scope PageRank (on the scope's subgraph), fused by reciprocal rank (RRF) with soft federation (only scopes that meaningfully match participate) and root-labeled output; when the graph has ≤1 scope the code takes the EXACT current path — byte-identical output. (3) A parent folder containing multiple git repos builds one graph per child (committable in each child) plus a workspace manifest at the parent; `ask`/`map`/`grep`/`check` at the parent federate over the child graphs with the same fusion machinery. Old mega-graphs at such parents are auto-split on the next build with a loud explanation.
-
-**Tech Stack:** TypeScript ESM, Node ≥20, node:test + tsx. No new dependencies.
-
-## Global Constraints
-
-- No new npm dependencies; ESM `.js` import specifiers; every file under 500 lines.
-- **Zero single-repo regression (hard gate):** on a graph with ≤1 scope, `ask`/`map`/`grep`/`callers`/`impact`/MCP output must be BYTE-IDENTICAL to 0.5.0 (Task 7 automates this diff). The single-scope fast path must be an early branch, not "fusion with N=1".
-- **Latency budgets (hard gates, Task 7):** single-repo warm `ask` within +10% of 0.5.0 on the same fixture; 3-repo colocated workspace `ask` ≤ 1.5× the largest member's solo ask; MCP warm-query behavior unchanged; `graft build` within +15% (discovery walk is one extra pass).
-- **Upgrade transparency:** a 0.5.0 `wiring.json` (no `meta.scopes`) must load and behave exactly as today everywhere (loader treats missing scopes as `[{ prefix: "" }]`); the next `graft build` adds scopes with no user action; never require a manual migration command.
-- **Philosophy:** wrong scope attribution is a wrong answer — every file belongs to exactly ONE scope, its nearest marker ancestor. Ambiguity in fusion drops toward current behavior, never invents ranking.
-- Scope labels in output use the scope's directory path relative to the graph root (`frontend/`, `backend/`, or the repo dir name for workspace children); root scope (prefix `""`) is unlabeled — so single-repo output carries zero new text.
-- Empty results stay loud; scope-related errors/notes enumerate available scopes (`--in frontend/ · backend/`).
-- No third-party tool names anywhere in code/comments/docs/commits. NO Co-Authored-By trailers.
-- Full suite green (`node --import tsx --test test/*.test.ts`, 278 at plan time) + `npm run build` before every commit.
-- RRF constant K=60; soft-federation rule (exact, so tests are deterministic): a scope participates in fusion iff its best lexical score ≥ 0.25 × the global best lexical score AND it has ≥1 scoring doc. Non-participating scopes with ≥1 scoring doc are named in the "also matched" footer.
-
----
-
-## File Structure
-
-- Create: `src/graph/scopes.ts` — scope discovery (`discoverScopes`), scope assignment (`scopeOf`), workspace-child detection (`discoverWorkspaceChildren`), over-split guards. Pure functions + one fs walker.
-- Modify: `src/graph/types.ts` — `meta.scopes?: ScopeV1[]` (additive); `src/graph/build.ts` — call discovery, populate meta, workspace-parent branch; `src/graph/write.ts` — nothing (spread already serializes meta).
-- Create: `src/ask/fuse.ts` — pure rank fusion: partition docs by scope, RRF merge, soft-federation gate, `also matched` metadata.
-- Modify: `src/ask/ask.ts` — the partition/fusion branch at the L439→L442 seam + `--in` pre-scoring filter + scope labels in hits/formatAsk; `src/ask/graphrank.ts` — accept an optional node-subset so per-scope walks run on subgraphs.
-- Create: `src/graph/workspace.ts` — workspace manifest read/write (`graft/workspace.json` at the parent), federated multi-graph loading (via loadGraphCached per child).
-- Modify: `src/cli.ts` (`ask --in`, workspace-aware command routing), `src/mcp/tools.ts` (`in` param on graft_ask; workspace federation), `src/graph/map.ts` (group by scope first), `src/claude/hooks.ts` (scope hint from lastFile), `src/claude/skill-template.ts` + `src/hosts/instructions.ts` (scope guidance), `README.md`.
-- Tests: create `test/graph-scopes.test.ts`, `test/ask-fusion.test.ts`, `test/workspace.test.ts`, `test/regression-single-repo.test.ts`; extend `test/ask.test.ts`, `test/graph-map.test.ts`, `test/mcp-tools.test.ts`, `test/claude-skill-template.test.ts`, `test/hosts-instructions.test.ts`.
-
-Task order: 1 (discovery+schema) → 2 (graphrank subset) → 3 (fusion in ask) → 4 (--in + UX) → 5 (workspace federation + migration) → 6 (surfaces: map/hooks/guidance/README) → 7 (regression + perf + skew acceptance harness).
-
----
-
-### Task 1: Scope discovery + schema (`src/graph/scopes.ts`, `types.ts`, `build.ts`)
-
-**Interfaces (produced — everything later consumes these exactly):**
-```ts
-// src/graph/types.ts — GraphV1.meta gains (additive, version stays 1):
-meta: {
- version: 1; nodeCount: number; edgeCount: number; languages: string[];
- /** Ranking scopes: posix path prefixes relative to the graph root, "" = root scope.
- * Absent (old graphs) ≡ [{ prefix: "", label: "" }]. Sorted by prefix length desc. */
- scopes?: ScopeV1[];
-};
-// src/graph/types.ts
-export interface ScopeV1 { prefix: string; label: string; markers: string[] }
-```
-```ts
-// src/graph/scopes.ts
-/** Walk the tree (reusing walkDir's skip rules) and find project-marker dirs. */
-export function discoverScopes(root: string): ScopeV1[];
-/** Nearest-prefix owner. scopes MUST be sorted prefix-length desc; "" matches all. */
-export function scopeOf(path: string, scopes: ScopeV1[]): ScopeV1;
-/** Immediate subdirs of root that are themselves git repos (have .git). Used by Task 5. */
-export function discoverWorkspaceChildren(root: string): string[];
-```
-
-**Discovery rules (exact):**
-1. Markers, checked per directory: `package.json`, `go.mod`, `pyproject.toml`, `setup.py`, `Cargo.toml`. A dir with ≥1 marker is a scope candidate; its prefix is the dir path posix-rel to root (`""` for root itself).
-2. **Workspace-config-as-intent (over-split guard 1):** if the root has `pnpm-workspace.yaml`, or root `package.json` has a `workspaces` field, resolve those globs — the matched dirs are the ONLY sub-scopes considered from the JS family (individual `packages/*/package.json` deeper than the globs are ignored). Simple glob support: `dir/*` and `dir/**` forms only (implement with readdir, no dependency).
-3. **Depth guard (over-split guard 2):** candidates deeper than 2 path segments below root are ignored unless matched by a workspace glob (rule 2).
-4. **Nesting collapse:** a candidate whose prefix is inside another candidate's prefix is dropped (keep the shallower one) — except workspace-glob matches, which win over their parent.
-5. **Minimum-substance guard (over-split guard 3):** after building the graph, a scope with < 5 non-file nodes is merged into the root scope (this runs in build.ts, since node counts aren't known at walk time).
-6. If, after guards, exactly one scope remains (just root, or one marker dir == the whole repo), emit `scopes: [{ prefix: "", label: "", markers: [...] }]` — the canonical single-scope form.
-7. `label` = prefix without trailing slash, or `""` for root. Deterministic ordering: prefix-length desc, then lexicographic.
-
-**build.ts integration:** after `listSourceFiles` (L54-56 area), call `discoverScopes(root)`; apply guard 5 after node assembly; write to `meta.scopes` at the GraphV1 assembly (L128-137). `readGoModules` stays as-is (it feeds edge resolution, a different concern).
-
-- [ ] **Step 1: failing tests** (`test/graph-scopes.test.ts`) — pure fs fixtures via mkdtemp:
-
-```ts
-import { test } from "node:test";
-import assert from "node:assert/strict";
-import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from "node:fs";
-import { tmpdir } from "node:os";
-import { join } from "node:path";
-import { discoverScopes, scopeOf, discoverWorkspaceChildren } from "../src/graph/scopes.js";
-
-function fx(layout: Record<string, string>): string {
- const dir = mkdtempSync(join(tmpdir(), "scopes-"));
- for (const [p, content] of Object.entries(layout)) {
- mkdirSync(join(dir, p, ".."), { recursive: true });
- writeFileSync(join(dir, p), content);
- }
- return dir;
-}
-
-test("frontend/backend markers under one git root -> two scopes", () => {
- const d = fx({
- "frontend/package.json": "{}", "frontend/src/app.ts": "export const a = 1;",
- "backend/go.mod": "module m", "backend/main.go": "package main",
- });
- const scopes = discoverScopes(d);
- assert.deepEqual(scopes.map((s) => s.prefix).sort(), ["backend", "frontend"]);
- assert.equal(scopeOf("frontend/src/app.ts", scopes).label, "frontend");
- assert.equal(scopeOf("README.md", scopes).prefix, ""); // root scope always exists as fallback
- rmSync(d, { recursive: true, force: true });
-});
-
-test("workspace globs are intent: packages/* honored, deeper ignored", () => {
- const d = fx({
- "package.json": JSON.stringify({ workspaces: ["packages/*"] }),
- "packages/core/package.json": "{}", "packages/core/i.ts": "1",
- "packages/cli/package.json": "{}", "packages/cli/i.ts": "1",
- "packages/cli/nested/package.json": "{}", // deeper than glob -> ignored
- });
- const prefixes = discoverScopes(d).map((s) => s.prefix).sort();
- assert.deepEqual(prefixes, ["packages/cli", "packages/core"]);
- rmSync(d, { recursive: true, force: true });
-});
-
-test("root-only marker -> canonical single scope", () => {
- const d = fx({ "package.json": "{}", "src/a.ts": "1" });
- const scopes = discoverScopes(d);
- assert.deepEqual(scopes, [{ prefix: "", label: "", markers: ["package.json"] }]);
- rmSync(d, { recursive: true, force: true });
-});
-
-test("depth guard: markers 3 levels down ignored without workspace glob", () => {
- const d = fx({ "a/b/c/package.json": "{}", "src/x.ts": "1" });
- assert.equal(discoverScopes(d).length, 1); // root only
- rmSync(d, { recursive: true, force: true });
-});
-
-test("nesting collapse keeps shallower candidate", () => {
- const d = fx({ "svc/package.json": "{}", "svc/sub/package.json": "{}", "svc/i.ts": "1" });
- assert.deepEqual(discoverScopes(d).filter((s) => s.prefix).map((s) => s.prefix), ["svc"]);
- rmSync(d, { recursive: true, force: true });
-});
-
-test("discoverWorkspaceChildren finds immediate git children only", () => {
- const d = fx({ "repoA/x.ts": "1", "repoB/y.py": "1", "plain/z.go": "1" });
- mkdirSync(join(d, "repoA/.git"), { recursive: true });
- mkdirSync(join(d, "repoB/.git"), { recursive: true });
- mkdirSync(join(d, "repoB/vendored/.git"), { recursive: true }); // nested: not a child of d
- assert.deepEqual(discoverWorkspaceChildren(d).sort(), ["repoA", "repoB"]);
- rmSync(d, { recursive: true, force: true });
-});
-```
-
-- [ ] **Step 2: verify fail. Step 3: implement scopes.ts** (walk with the same skip rules as `src/ingest/fs.ts` — import/reuse `SKIP_DIRS`; do not re-descend into dot-dirs) **+ types.ts meta field + build.ts wiring (incl. guard 5: merge scopes with <5 non-file nodes into root; a merged-away scope disappears from meta.scopes).**
-- [ ] **Step 4: build-level test** (extend graph-scopes.test.ts): fixture with frontend(ts, 6 symbols)/backend(py, 6 symbols) under one dir → `buildGraph` → wiring.json meta.scopes has both prefixes; tiny scope (1 symbol) gets merged into root. Old-graph tolerance: hand-write a wiring.json WITHOUT meta.scopes, `loadGraphCached` + `scopeOf` fallback path returns root scope for everything (add a tiny `scopesOfGraph(graph): ScopeV1[]` helper in scopes.ts that defaults absent → `[{prefix:"",label:"",markers:[]}]` — everything downstream calls this, never touches meta directly).
-- [ ] **Step 5: full suite green. Step 6: Commit** — `feat(graph): scope discovery — project markers become ranking scopes in graph meta`
-
----
-
-### Task 2: Subgraph-capable PageRank (`src/ask/graphrank.ts`)
-
-**Interfaces:** `personalizedPageRank(graph, seeds, opts?)` gains `opts.nodeFilter?: (id: string) => boolean`. When present: adjacency (L54-59) built only over edges whose BOTH endpoints pass the filter; rank vector and normalization (L95-100) restricted to passing ids. No filter → exact current behavior (regression: existing graphrank tests byte-stable).
-
-- [ ] **Step 1: failing tests** (extend `test/graphrank.test.ts` with the existing nodeStub/graphOf helpers): (a) filter restricting to component A of a two-component fixture yields identical ranks to running on a graph containing only component A (build both, compare maps); (b) no filter → identical output to before (snapshot two-three known values from an existing test); (c) seeds outside the filter are ignored without error.
-- [ ] **Step 2-4: verify fail → implement → full suite.**
-- [ ] **Step 5: Commit** — `feat(ask): graphrank accepts a node filter for subgraph walks`
-
----
-
-### Task 3: Per-scope ranking + RRF fusion in ask (`src/ask/fuse.ts`, `ask.ts`)
-
-**Interfaces:**
-```ts
-// src/ask/fuse.ts — pure, no fs
-export interface ScopedDoc { id: string; scope: string /* prefix */; score: number }
-export interface FusionResult {
- /** fused order, best first; carries per-doc scope label + fused score in [0,1] */
- ranked: { id: string; scope: string; score: number }[];
- /** scopes that participated in fusion */
- federated: string[];
- /** scopes that matched weakly (≥1 scoring doc but below the participation gate) with their best doc */
- alsoMatched: { scope: string; bestId: string }[];
-}
-export const RRF_K = 60;
-export const PARTICIPATION_RATIO = 0.25;
-/** Partition by scope, rank within scope (input scores are already per-scope-normalized),
- * gate by soft federation, fuse by RRF: fused(id) = Σ 1/(K + rank_in_scope(id)). */
-export function fuseScopes(docs: ScopedDoc[]): FusionResult;
-```
-
-**ask.ts integration (the seam at L439→L442, per recon):**
-1. `const scopes = scopesOfGraph(graph)`; **if `scopes.length <= 1` → the ENTIRE existing code path runs untouched (early branch around everything below). This is the regression guarantee.**
-2. Multi-scope: partition symbol docs by `scopeOf(node.path, scopes)`. Compute IDF **per scope** (same `computeIdf`/`computeIdfFromIndex` functions, fed only the scope's docs — extract the current calls into a helper taking a doc subset). Score lexically per scope (existing scoring functions, unchanged math). Run `personalizedPageRank` per participating scope with `nodeFilter = id -> scopeOf(nodeById(id).path) === scope`, seeds = that scope's lex map; blend per scope exactly as today (lexN + 0.5·pr, both already per-scope-normalized).
-3. Feed per-scope blended lists to `fuseScopes`; take `ranked` as the symbol ordering. Concept docs (not path-partitionable the same way) keep their current scoring and merge as today by score — they're few and repo-level.
-4. Hits carry `scope` label; `formatAsk` prefixes multi-scope hits with `[frontend/] ` and appends the footer: `matched in: frontend/ (6) · backend/ (3)` plus, when `alsoMatched` is nonempty, `also matched: docs/ — narrow with --in docs/`. Zero new output when single-scope.
-
-- [ ] **Step 1: failing tests** — `test/ask-fusion.test.ts` (pure fuseScopes: two scopes 10-vs-2 docs → top-6 of fused contains both scopes' best; rank-1 tiny == rank-1 huge by construction (equal fused score); participation gate excludes a scope whose best is < 0.25 × global best but reports it in alsoMatched; single-scope input returns docs unchanged in order; determinism under input shuffle) + extend `test/ask.test.ts` with an end-to-end fixture: one tmp repo, `frontend/` (ts, contains `handleError` symbols) + `backend/` (py, contains `handle_error` symbols), backend 5× bigger; `ask "how are errors handled"` → top-10 contains ≥1 hit from each scope, hits labeled, footer present. And the regression pin: a single-scope fixture's `ask` output (full formatted string) equals the output captured with fusion code paths disabled (assert via the early-branch: run ask on a graph whose meta.scopes was hand-set to the canonical single form vs meta.scopes deleted — byte-equal).
-- [ ] **Step 2-4: verify fail → implement → full suite green (existing ask tests must pass UNCHANGED — they're all single-scope).**
-- [ ] **Step 5: Commit** — `feat(ask): per-scope ranking with reciprocal-rank fusion — big repos stop drowning small ones`
-
----
-
-### Task 4: `ask --in` + scope-aware errors/empties
-
-- `graft ask "<q>" [dir] --in <path-prefix>` filters docs BEFORE scoring (per-scope IDF/PR come free since the filter usually selects one scope; a mid-scope prefix like `--in backend/api` just filters docs). CLI flag copies the `--in` pattern from grep (cli.ts L270). MCP `graft_ask` gains `in?: string`.
-- Unknown/no-match `--in` → exit 1: `✗ nothing indexed under "wrong/" — scopes here: frontend/ · backend/ (or any path prefix)`.
-- Zero-hit ask on a multi-scope graph appends scope enumeration to the existing empty message.
-- [ ] Steps: failing tests (extend test/ask.test.ts: --in filters to scope, per-scope idf actually differs from global (assert a term's rank changes vs unfiltered), unknown --in error wording + exit; MCP arg round-trip in test/mcp-tools.test.ts) → implement → full suite → commit `feat(ask): --in scope filter + scope-enumerating errors`.
-
----
-
-### Task 5: Workspace federation (multi-git parents) + migration (`src/graph/workspace.ts`)
-
-**Model:** parent dir P with ≥2 immediate git children and no own `.git` = a WORKSPACE. `graft build P`: builds each child's graph INTO THE CHILD (`<child>/graft/`, committable there, byte-identical to a standalone build), then writes `P/graft/workspace.json`:
-```ts
-export interface WorkspaceV1 { version: 1; children: string[] /* dir names, sorted */ }
-```
-No nodes/edges at the parent. `readWorkspace(dir): WorkspaceV1 | null`; `loadWorkspaceGraphs(dir)` → `{ child, graph }[]` via loadGraphCached on each child's graft (skip children without a built graph — count them and surface: `2 of 3 workspace repos have graphs; run graft build to cover repoC`).
-
-**Federated commands at a workspace parent:** `ask` — run the full per-scope pipeline per child graph (each child is one-or-more scopes; scope label = `<child>/<scopePrefix>` or just `<child>/`), fuse ALL scope lists with the same fuseScopes; `map` — render one section per child (child graphs' own map data, budget split evenly); `grep` — search each child's indexed files, merge groups (in-degree from each child's own graph); `check` — per-child status lines, exit 1 if any present-and-stale; `callers`/`callees`/`impact` — resolve the symbol across children; if found in several, group output per child (traverse-cli already groups per match). MCP: the server rooted at a workspace federates identically.
-
-**Migration (exact behavior):**
-- A parent that HAS an old mega-graph (P/graft/.graph/wiring.json exists AND ≥2 git children detected): `graft build P` prints `⚠ this folder contains 2 separate git repos — splitting: each repo now gets its own committable graft/ (repoA/graft/, repoB/graft/); the combined graph here is replaced by a workspace index. Queries from here now search all repos, fairly.` — then builds children, writes workspace.json, and REPLACES P/graft/.graph + P/graft/.cache with the manifest (the mega graph is regenerable; child cards land in the children).
-- A single git repo built with 0.5.0 (no meta.scopes): everything works as today via the `scopesOfGraph` fallback; next `graft build` adds scopes silently. NO forced rebuild: `ask` must never error on a scope-less graph.
-- `graft check` at a stale-mega-graph parent (user hasn't rebuilt): works as today (it's still a valid graph) — migration only happens through build.
-
-- [ ] **Step 1: failing tests** (`test/workspace.test.ts`): tmp parent with two tiny git children (mkdir .git) → build at parent → each child has graft/.graph/wiring.json identical (byte) to building that child standalone; workspace.json lists both; ask at parent returns hits from both children labeled `repoA/`/`repoB/`; ask inside a child = standalone behavior; mega-graph migration: pre-seed parent with a hand-built combined wiring.json → build → children built, parent .graph gone, workspace.json present, note text asserted; check federation exit codes; one-child-unbuilt surfacing.
-- [ ] **Step 2-4: implement → full suite. Step 5: Commit** — `feat(workspace): multi-repo parents federate per-child graphs — auto-split replaces mega-graphs`
-
----
-
-### Task 6: Surfaces — map by scope, hooks scope hint, guidance, README
-
-- `map.ts`: when multi-scope, group by scope FIRST (scope label as the top-level group key via a scope-aware `dirKey`), dirs within scope second; workspace parents render per-child sections (from Task 5). Single-scope: unchanged output (regression).
-- `hooks.ts`: the prompt hook passes `--in <scope>` when session state's `lastFile` (already captured at hooks.ts L54) resolves to a scope AND the graph is multi-scope — the "you're working in backend/, weight backend/" hint. Cheap, reversible, and only fires multi-scope.
-- `skill-template.ts` + `instructions.ts` (ADDITIVE, existing phrasing untouched): one bullet — multi-repo folders and monorepos rank fairly across sub-projects; hits carry `[scope/]` labels; narrow with `ask --in <scope>/` when you know where you're working.
-- README: a "Monorepos & multi-repo folders" section (the two cases from the design discussion, 6-8 lines, with the auto-split note) + `--in` row in the ask flags.
-- [ ] Steps: failing tests (map multi-scope grouping + single-scope unchanged; hook passes --in when lastFile in scope — extend test/claude-hooks.test.ts with GRAFT_TEST_STDIN pattern; skill/instructions phrase assertions) → implement → full suite → commit `feat(surfaces): scope-aware map, hooks scope hint, guidance + docs`.
-
----
-
-### Task 7: Regression, performance, and skew acceptance harness
-
-This task is the user-mandated gate: **no regressions, latency held, upgrades smooth.** Everything is scripted and numbers land in the report.
-
-- [ ] **Step 1: automated single-repo byte-regression test** (`test/regression-single-repo.test.ts`): build 3 single-repo fixtures (ts-only, py-only, mixed with root-only markers); for each, capture `ask` (plain/`--source`/`--json`), `map`, `grep`, `callers` outputs; assert non-empty and, for the ask JSON, assert scope fields are absent/root and no fusion footer text appears. Then the cross-version diff (scripted, not unit): `git worktree add <scratch>/v050 <0.5.0 tag/commit>` → build its dist → run the same fixture through 0.5.0 binary and new binary → **byte-diff the outputs** (allowing only the version string). Any diff = FAIL.
-- [ ] **Step 2: latency gate** (script in scratchpad, numbers in report): (a) big single repo — the fastapi checkout at /private/tmp/claude-501/-Users-shrishdwivedi-Documents-Context-graphs/d3b217f7-4a78-4399-b91a-8bb7db720797/scratchpad/fastapi-accept: median-of-5 warm `ask` for 3 queries, new vs 0.5.0 worktree binary — gate: ≤ +10%; build time ≤ +15%. (b) colocated 3-repo workspace (rebuild the cobra+fastapi+p-queue fixture from the skew investigation at .../scratchpad/colocated): median-of-5 `ask` at the parent — gate: ≤ 1.5× fastapi-solo ask. (c) MCP: two graft_ask calls one session, second still cache-fast.
-- [ ] **Step 3: skew acceptance** — rerun the original 10-query experiment from .../scratchpad/colocated/skew-report.md on the workspace: gates: ≥8/10 queries have ≥2 repos in the top-10 when ≥2 repos have participation-level matches; the "how are errors handled" query surfaces a cobra hit in the top-10 (was #78); repo-specific queries ("shell completion") still return their repo's hits at top (no over-diversification — assert top-3 all cobra).
-- [ ] **Step 4: upgrade gates** — (a) 0.5.0-built fastapi graph queried by NEW binary without rebuild: works, no scope text, results sane; then `graft build` → meta.scopes appears → ask unchanged (fastapi is single-scope); (b) mega-graph parent auto-split end-to-end (from Task 5's test but with the real 3-repo workspace, timing the split build); (c) fastapi acceptance numbers hold: `callers include_router` = 110, sweep 7 groups, map <6000 chars.
-- [ ] **Step 5: full suite + build; write all numbers into the task report. Commit** (any test-only files) — `test: cross-version regression, latency, and skew acceptance harness`.
-
-## Out of scope (explicitly deferred)
-
-- Cross-repo/cross-scope EDGES (manifest deps, HTTP contract matching) — 0.7 headline; this wave only makes ranking and surfaces scope-aware.
-- Value-visibility wave (session ledger, `graft stats`) — separate small wave, planned next.
-- Per-scope sidecar df precomputation (compute per-scope IDF at query time first; optimize only if Task 7's latency gate fails).
-- Connectivity-based scope validation (edge-cluster sanity check) — revisit if marker-based detection misfires in the field.
-
-## Self-Review
-
-- Both field cases covered: monorepo (Case A: Tasks 1+3, one graph + scopes) and colocated repos (Case B: Task 5, per-child graphs + workspace manifest). ✓
-- User's three hard requirements are Task 7 hard gates (byte-regression, latency budgets, upgrade transparency), not aspirations. ✓
-- Single-scope early branch stated in three places (constraint, Task 3, Task 6) — the regression guarantee is structural. ✓
-- No placeholders: discovery rules enumerated with exact guards; fusion math specified (RRF K=60, participation 0.25); migration wording written out; test code included for the tricky tasks. ✓
-- Type consistency: `ScopeV1`/`scopesOfGraph`/`scopeOf` (Task 1) consumed by Tasks 3-6; `fuseScopes` shapes match ask.ts usage; `WorkspaceV1` matches Task 5 tests. ✓
diff --git a/docs/superpowers/specs/2026-07-15-graft-viz-design.md b/docs/superpowers/specs/2026-07-15-graft-viz-design.md
deleted file mode 100644
index 87582d71..00000000
--- a/docs/superpowers/specs/2026-07-15-graft-viz-design.md
+++ /dev/null
@@ -1,110 +0,0 @@
-# graft viz — Context Graph Visualizer
-
-**Date:** 2026-07-15
-**Status:** Approved (interactive design reference: claude.ai artifact "graft viz — design & mockup")
-
-## Purpose
-
-Graft builds two graph artifacts (`.context/*.md` context graph, `.context/graph.json` code graph) but has no way to see them. `graft viz` serves a local, interactive, nanoindex-style visualization of both. Design priorities, in order: (1) edges must mean something to someone building or reviewing code, (2) modern minimal look, (3) scales to large codebases.
-
-## Decisions made during design (with user)
-
-| Question | Decision |
-|---|---|
-| What to visualize | Both graphs, as tabs — Context (architecture) and Code (symbols) + Outline (tree) |
-| Delivery | New `graft viz` CLI command; serves a prebuilt single-page viewer on localhost; auto-opens browser; no npm install/dev-server at runtime |
-| MVP interactions | Force graph with zoom/pan/drag, legend filters, detail panel, tree outline, search, dark/light mode, live reload |
-| Viewer tech | Vanilla TS, bundled once with esbuild, shipped in the npm package. d3-force for simulation only (Barnes–Hut perf at scale); rendering is hand-rolled SVG |
-| Edge design | Semantic: verbs from the code, not invented taxonomy (below) |
-
-## Edge semantics (the core of the design)
-
-### Verb vocabulary — one test, six verbs
-
-Every relation verb must answer a question someone building or reviewing code actually asks. Vague LLM softeners are banned.
-
-| Verb | Question it answers |
-|---|---|
-| `part_of` / `contains` | where does this live? |
-| `uses` / `calls` / `imports` / `depends_on` | what breaks if I change this? |
-| `produces` | where does this output come from? |
-| `configures` | what changes its behavior without a code change? |
-| `validates` | what checks or judges this? (tests, drift checks, scoring) |
-| `extends` / `implements` | what contract must this honor? |
-
-**Enforcement:**
-1. Engine: the synthesize tool schema (`src/ai/synthesize.ts`) constrains `relation` to a closed enum: `part_of, uses, produces, configures, validates, implements, depends_on`. The LLM must pick one or drop the link.
-2. Viewer: legacy graphs are normalized on load — `influences → configures`; `supports`, `defines`, `measures → validates`. Existing `.context/` folders read cleanly without regeneration.
-
-### Chips (legend + filter)
-
-Shown top-left of the canvas: the verbs **actually present in the repo**, with counts. `part_of`/`contains` group under the chip **"part of"**; `calls`/`uses`/`depends_on`/`imports` group under **"uses"** (user-approved names). Every other verb gets its own chip. Clicking toggles that verb's edges. Hover shows the question the verb answers.
-
-### Form encodes reading priority
-
-- **part of** — thick, muted, no arrowhead, shorter force-spring length (hierarchy pulls clusters together; layout, not clutter)
-- **uses / produces / configures / validates** — solid, small open-chevron arrowhead
-- **extends / implements** — hollow UML-style arrowhead
-- **references** (code graph only) — faint dotted, no arrowhead ("mentioned but never called")
-- Arrowheads are deliberately subtle: open chevrons at rest, compact filled heads only on focused edges
-
-### Meaning on demand (focus mode)
-
-At rest the graph is quiet (edges ~0.3–0.55 opacity). Selecting a node:
-- outgoing edges turn **amber** (`--fil`) = what it depends on
-- incoming edges turn **teal** (`--accent`) = what depends on it
-- relation verbs are written only on those focused edges
-- non-neighbor nodes and edges fade (~0.06–0.2 opacity)
-- detail panel mirrors the colors: "Depends on ·" (amber dot) / "Depended on by ·" (teal dot), each entry showing verb + Graft's per-edge description sentence
-
-### Scale strategy (large codebases)
-
-1. **Containment becomes geometry**: past ~200 visible nodes, `contains` edges stop rendering; files collapse into compound nodes with symbol counts, expandable on click (removes ~40–50% of edges).
-2. **Level-of-detail by zoom**: zoomed out, only aggregated file↔file dependency edges, width ∝ bundled edge count; zoom reveals individual edges, then labels on focused ones.
-3. **Focus is the primary reading mode** at density; ambient edges just show shape.
-4. **Trust is visible**: `confidence: "extracted"` edges solid; `"inferred"` dashed.
-5. Faint-dotted verbs (`references`) hidden by default past ~500 edges.
-
-(v1 implements 3, 4, 5 fully; 1 and 2 are v2 — v1 must stay usable to ~1,500 nodes via d3-force + persistent-element SVG updates.)
-
-## Architecture
-
-```
-src/
-├── cli.ts + viz command: graft viz [dir] [--port 4400] [--no-open]
-└── viz/
- ├── assemble.ts .context/*.md frontmatter → {meta, nodes[], edges[]}
- └── serve.ts node:http server, SSE live reload, port fallback, open browser
-viewer/ frontend source (vanilla TS + tokens.css), esbuild → dist/viewer/
-dist/viewer/ prebuilt bundle shipped in the npm package
-```
-
-- **Server** (`node:http`, zero new runtime deps):
- - `GET /` , `/app.js`, `/style.css` — static viewer from `dist/viewer/`
- - `GET /api/context-graph` — parse every `.context/*.md` with gray-matter; nodes from frontmatter, edges from `links`; relation normalization; dangling edges dropped and counted in `meta.droppedEdges`; malformed files skipped and counted in `meta.skippedFiles`
- - `GET /api/code-graph` — streams `graph.json` if present and `meta.version === 1`, else 404 with `{error}`
- - `GET /events` — SSE; `fs.watch` on the context dir, 300 ms debounce → `data: change`
-- **Viewer**: tabs Context / Code / Outline; d3-force simulation; SVG with persistent elements (positions updated per tick, not rebuilt); semantic edge rendering per this spec; detail panel (summary, sources, links); search (Enter zooms to best match); theme toggle (localStorage + `prefers-color-scheme`); SSE-driven refetch that morphs the sim in place (matching ids keep positions).
-- **CLI**: errors with guidance if the context dir is missing ("run `graft init` first"); Code/Outline tabs show an instructive empty state if `graph.json` absent ("run `graft graph`").
-
-## Visual design
-
-Token-driven, both themes (light default follows OS, toggle persisted). Palette: cool neutrals; accent deep teal `#0B7A69` (light) / `#2FBFA4` (dark); amber `#D98E2B`/`#E0A04A` reserved for "depends on" focus; node categories — system/class blue, concept/interface violet, file amber, function teal, method cyan, type pink, enum green. System font stack (Avenir Next/Segoe UI fallbacks), `ui-monospace` for paths/signatures. Node radius by degree (11 + 2.6·deg, capped). The approved mockup is the visual reference of record.
-
-## Error handling
-
-- No `.context/` → CLI exit 1 with guidance
-- Malformed frontmatter → skip node, warn once, count in `meta.skippedFiles`
-- Dangling link target → drop edge, count in `meta.droppedEdges`
-- Port busy → try next port (up to +10), print final URL
-- `graph.json` missing/wrong version → Code & Outline tabs render empty state; Context unaffected
-
-## Testing
-
-- Unit (node test runner, existing style): assembly from fixture `.context/` (frontmatter → edges, normalization, dangling-drop, malformed-skip); code-graph version gate
-- Server: endpoint shapes on a random port; SSE fires on file change; port fallback
-- End-to-end: run against this repo's own `.context/` and a generated `graph.json`; screenshot check against the design reference
-
-## Out of scope (v1)
-
-Compound-node collapse & zoom LOD (v2), canvas renderer, multi-repo dashboard, editing the graph from the UI, `Ask` (chat) feature from nanoindex.
diff --git a/docs/superpowers/specs/2026-07-20-graft-claude-code-integration-design.md b/docs/superpowers/specs/2026-07-20-graft-claude-code-integration-design.md
deleted file mode 100644
index 69814904..00000000
--- a/docs/superpowers/specs/2026-07-20-graft-claude-code-integration-design.md
+++ /dev/null
@@ -1,271 +0,0 @@
-# Graft × Claude Code integration — design
-
-**Date:** 2026-07-20
-**Status:** Draft for review
-**Owner:** Shrish
-**Scope:** One implementation plan.
-
-## 1. Goal
-
-Make Graft *visible and active* inside a Claude Code session — a live statusline
-that surfaces what Graft holds, and hooks that feed the graph to the model. Today
-Graft is a passive `graft/` folder that an agent is *supposed* to read. This
-feature ships a `.claude/` integration that:
-
-1. **Shows** the developer what Graft holds and whether it's trustworthy (a live statusline).
-2. **Feeds** relevant graph context into the model automatically (retrieval + orientation + blast-radius).
-3. **Keeps itself fresh** — auto-syncs the graph after edits, at `$0`, with no manual command.
-
-Every number shown must be real. No fabricated "tokens saved %", no misleading
-dollar cost. If a signal can't be measured honestly, it isn't displayed.
-
-## 2. Background & constraints (grounded in the engine)
-
-- Graft = `@nanonets/graft` v0.2.1, a Node/TS **CLI + library**. No daemon, no MCP.
- Commands: `graft build` / `ask` / `check` / `viz`.
-- State on disk under `<repo>/graft/`:
- - `graft/.graph/wiring.json` — deterministic code graph. Top-level `meta`
- (`{version, nodeCount, edgeCount, languages[]}`), `nodes[]` (each with
- `id, name, kind, path, span, signature, exported, body_hash, summary_state,
- summary, crux`), `edges[]` (`{from, to, relation, confidence}`,
- `relation ∈ contains|calls|imports|references|implements|extends`).
- - `graft/*.md` — concept nodes (LLM prose) with typed `[[wikilinks]]`.
- - `graft/manifest.json` — roster + `repoDigest` + per-file hashes.
- - `graft/INDEX.md` — human-readable map (~4.4 KB).
- - `graft/.cache/` — **gitignored**; safe home for session state + sync lock.
-- Measured facts that shape the design:
- - `graft check --json` runs in **~0.35s**, read-only, and returns precise drift:
- `graph.changed[]` (files *and* symbols), `graph.added/removed`, `context.contentDrift[]`, and `ok: false` when stale.
- - Plain `graft build` = **structural, deterministic, offline, `$0`**.
- `graft build --deep` = the LLM pass (summaries/crux) that spends OpenRouter
- credits and needs `OPENROUTER_API_KEY`; without a key it degrades to structural.
- - Graft has **no token/cost meter**. There is no runtime signal for "tokens saved".
-- Claude Code `.claude/` surface we rely on (confirmed against docs):
- - `statusLine` (command): runs a script per render, receives a JSON blob on
- **stdin** including `model`, `cwd`, `session_id`, `agent.name`, and
- `context_window.{used_percentage, total_input_tokens, total_output_tokens}` and
- `cost.total_cost_usd`. Re-renders several times/second while streaming → the
- script **must be a fast pure reader**.
- - `subagentStatusLine` — per-subagent row.
- - `footerLinksRegexes` — regex → clickable link in the transcript.
- - Hooks (command scripts, JSON on stdin, can inject context via
- `additionalContext` / `hookSpecificOutput`): `SessionStart`, `UserPromptSubmit`,
- `PreToolUse`, `PostToolUse`, `Stop`.
-
-**Honesty grading** used throughout:
-- **real** — already on disk (`wiring.json`) or in stdin (`context_window`).
-- **instrumented→real** — a small hook captures it honestly (reads count, drift, dirty).
-- **not measurable** — dollar cost (misleading estimate) and "tokens saved %" (no baseline). **Excluded by design.**
-
-## 3. Scope
-
-**In scope (9 features):**
-
-| # | Feature | Surface | Honesty |
-|---|---------|---------|---------|
-| D1 | Status bar (2-line) | `statusLine` | real |
-| D2 | Drift beacon (`⚠ N stale`) | `statusLine` + PostToolUse flag | instrumented→real |
-| D3 | Per-subagent region | `subagentStatusLine` | real |
-| D4 | Clickable node refs | `footerLinksRegexes` | real |
-| F1 | Active retrieval (`graft ask` → inject) | `UserPromptSubmit` | real |
-| F2 | Session orientation (`INDEX.md` → inject) | `SessionStart` | real |
-| F3 | Blast-radius nudge (edges → inject) | `PostToolUse · Edit` | real |
-| O1 | Drift flag (mark dirty) | `PostToolUse · Edit` | instrumented→real |
-| S1 | Auto-sync (turn-end background rebuild) | `Stop` | real |
-
-**Explicitly out of scope (deferred):**
-- Pre-grep short-circuit (`PreToolUse · Grep`) — powerful but intrusive; needs tuning.
-- Coverage-gap detector — nice, not core to this deliverable.
-- Graft-read usage counter as a *displayed number* — we will **capture** graft-vs-source
- reads in state (cheap), but only surface it once we trust it; the bar ships without it if noisy.
-- `$` cost and "tokens saved %" — never shipped (not measurable).
-- A `graft claude-init` CLI subcommand to scaffold this into *other* repos — the helpers
- will be written to be liftable, but productizing the installer is a separate plan.
-- Debounced live watcher / session-end-only sync — rejected in favor of turn-end sync.
-
-## 4. Architecture — readers vs. writers, one state file
-
-The core pattern: the **statusline only reads**; **hooks write and act**. They meet
-at one small gitignored state file, so rendering never invokes Graft and the
-expensive work happens only on real events.
-
-```
- ┌─────────────────────────────┐
- edits / prompts ───▶│ graft-hooks.cjs (writer) │──▶ graft ask / build / check
- │ post-edit · prompt · stop │ (episodic, not per-paint)
- └──────────────┬──────────────┘
- │ writes
- ▼
- ┌─────────────────────────────┐
- │ graft/.cache/ (state) │
- │ stats.json · session/* │
- │ .sync.lock │
- └──────────────┬──────────────┘
- │ reads (small files only)
- ▼
- Claude Code stdin ───────▶ graft-statusline.cjs (reader) ──▶ the 2-line bar
-```
-
-### Files shipped
-
-| Path | Role | Responsibility |
-|------|------|----------------|
-| `.claude/settings.json` | config | wire `statusLine`, `subagentStatusLine`, `footerLinksRegexes`, and 4 hook events |
-| `.claude/helpers/graft-statusline.cjs` | reader | pure/fast: read `stats.json` + `session/<id>.json` + stdin → render bar. Never calls Graft. |
-| `.claude/helpers/graft-hooks.cjs` | writer | single dispatcher: `session-start` \| `prompt` \| `post-edit` \| `stop`. Runs Graft, writes state, injects context. |
-| `graft/.cache/stats.json` | state | precomputed `{nodeCount, edgeCount, languages, enrichedPct, staleCount, dirty, syncedAt}` for the statusline |
-| `graft/.cache/session/<session_id>.json` | state | per-session: `{lastQuery, perAgentQuery, graftReads, sourceReads}` |
-| `graft/.cache/.sync.lock` | lock | one background `graft build` at a time |
-
-CJS Node scripts, no new dependencies (matches Graft's own stack). All paths
-resolved relative to `CLAUDE_PROJECT_DIR` with a `$HOME` fallback.
-
-## 5. The status bar (D1/D2)
-
-Two lines. Top = Graft's own state (capture/coverage/freshness). Bottom = session
-reality from Claude Code stdin. Example:
-
-```
-◤ graft · 319 nodes / 730 edges · 100% enriched · ⚠ 4 stale
-▸ ctx 34% · syncing… · last: pkce.ts
-```
-
-- **Top line** from `stats.json`:
- - `nodeCount` / `edgeCount` (from `wiring.json` meta, precomputed).
- - `enrichedPct` = share of nodes with `summary_state === "ready"` (precomputed).
- **Show this segment only when `readyCount ≥ 1`.** A structural-only graph (no
- `--deep` run) has zero enriched nodes → the segment is hidden entirely; after any
- enrichment it shows `NN% enriched`. Keeps the bar quiet when there's nothing to say.
- - Freshness: `✓ synced` when `dirty=false && staleCount=0`; `⚠ N stale` when drift
- detected; `syncing…` while a background build holds the lock.
-- **Bottom line** from stdin + session state:
- - `ctx NN%` = `context_window.used_percentage` (real, unambiguous).
- - sync status verb OR `last: <basename>` of the most recent captured/edited node.
-- **Colors** (Nanonets palette, ANSI): indigo `#546FFF` for live/real graft data,
- amber for `⚠ stale` / drift, muted grey for separators. No green. No gradients.
-- **Degraded states:** no `wiring.json` → `graft · not built · run graft build`
- (muted). Missing stdin fields → omit that segment, never error.
-- **Performance:** reads only small files (`stats.json`, one session file). Optional
- ~2s /tmp memo keyed by `session_id` to coalesce render storms. Never spawns a
- subprocess. (Guards against a load-average storm from shelling out on every render.)
-
-## 6. Feed features
-
-### F1 — Active retrieval (`UserPromptSubmit`)
-- On each user prompt, run `graft ask "<prompt>" --json -n 5`.
-- Inject the top hits as `additionalContext`, clearly fenced, e.g.:
- ```
- [graft] relevant context for this prompt:
- • PkceVerifier.verify — auth/oauth/pkce.ts:42-71 — validates the PKCE challenge…
- • OAuthClient.exchange — auth/oauth/client.ts:88-120 — …
- ```
-- Caps: ≤5 hits, ≤~800 tokens total, each = title · `path:Lx-Ly` · one-line crux.
-- `graft ask` is `$0`/no-LLM/lexical-structural, so this is cheap and offline.
-- Silent no-op if: graft not built, zero hits, or prompt is trivial (< N chars).
-- Records `lastQuery` (and `perAgentQuery[agent]`) into session state for D3.
-
-### F2 — Session orientation (`SessionStart`)
-- Inject the head of `graft/INDEX.md` (top concepts / entry points) as
- `additionalContext` so Claude starts oriented instead of re-exploring.
-- Cap to a budget (e.g. first ~1.5 KB / top section). Skip on `source: resume`
- if already injected this session. No-op if `INDEX.md` absent.
-
-### F3 — Blast-radius nudge (`PostToolUse · Edit`)
-- After an edit to a source file, find nodes in that file and inject their
- **incoming** edges (who `calls`/`imports`/`references`/`depends_on` this) —
- the "what breaks if I change this?" direction.
-- From `wiring.json` `edges[]` filtered by `to` ∈ edited file's node ids.
-- Cap ≤8, with `+N more`. Format: `↳ used by: OAuthClient.exchange (client.ts), …`.
-- Ignore edits under `graft/` itself (no self-referential noise / loops).
-- Episodic (once per edit) so parsing `wiring.json` here is fine.
-
-## 7. Auto-sync (S1) + drift flag (O1)
-
-The closed loop:
-
-```
-1. edit source → PostToolUse·Edit sets stats.dirty=true, records last file
-2. statusline → shows "⚠ stale" instantly (reads stats.json)
-3. turn ends (Stop) → graft check --json (~0.35s) → write precise staleCount
-4. if dirty & staleCnt → acquire .sync.lock → graft build (structural, $0) in background
-5. build done → recompute stats.json (counts, enrichedPct), dirty=false,
- staleCount=0, syncedAt=now, release lock
-6. statusline → flips to "✓ synced"
-```
-
-- **Money guard (hard rule):** auto-sync runs **only plain `graft build`** —
- structural, offline, `$0`. It **never** runs `--deep`. New/changed nodes sit at
- `summary_state: pending` until the developer manually enriches. No background API spend, ever.
-- **Concurrency:** `.sync.lock` (pid + timestamp). If held, skip (a build is already
- running); stale locks (> N min) are reclaimed.
-- **Non-blocking:** the build is detached/background so the `Stop` hook returns fast
- and never stalls the UI. Failure logs to `graft/.cache/sync.log`, leaves `dirty=true`
- (bar keeps `⚠`), and never throws.
-- **Scope:** v1 runs a full structural `graft build` (fast for this repo). If measured
- slow on large repos, a later optimization scopes to `graph.changed[]` from `check`.
-- **Guard against loops:** edits under `graft/` never set dirty and never trigger sync.
-
-## 8. Display extras
-
-### D3 — Per-subagent region (`subagentStatusLine`)
-- Render `agent.name` + its `perAgentQuery` (last `graft ask` subject) from session
- state. Falls back to the main bar when no per-agent query exists.
-
-### D4 — Clickable node refs (`footerLinksRegexes`)
-- Regex matches `graft/[\w./-]+\.md` mentions in the transcript → link to the local
- file (or the `graft viz` URL, `http://localhost:4400`, if a viz server is detected).
-- Lowest priority; pure garnish; ship last.
-
-## 9. Data contracts
-
-**`stats.json`** (writer: post-edit sets `dirty`; stop/build recomputes the rest):
-```json
-{ "nodeCount": 319, "edgeCount": 730, "languages": ["typescript"],
- "enrichedPct": 100, "staleCount": 0, "dirty": false,
- "syncedAt": "2026-07-20T14:30:00Z", "lastFile": "pkce.ts" }
-```
-**`session/<session_id>.json`:**
-```json
-{ "lastQuery": "pkce verification", "perAgentQuery": { "Explore": "…" },
- "graftReads": 6, "sourceReads": 11 }
-```
-**stdin fields consumed by the statusline:** `session_id`, `agent.name`,
-`context_window.used_percentage`. Everything else optional/ignored.
-
-## 10. Error handling & degradation
-
-- Graft not built / no `wiring.json`: statusline shows muted "not built"; hooks no-op.
-- `graft` binary not resolvable: hooks no-op; statusline still renders from `stats.json` if present.
-- Malformed stdin JSON: render a minimal bar; never crash a hook (crashing a hook can disrupt the session).
-- Concurrent Claude Code sessions: state keyed by `session_id`; single global `.sync.lock`.
-- Windows console-flash (upstream bug): statusline reads files only — no subprocess spawns — so it doesn't flash.
-- All hooks are best-effort: any failure logs to `graft/.cache/*.log` and exits 0.
-
-## 11. Testing
-
-- **Unit:** stdin parse, bar formatting, `enrichedPct` calc, dirty transitions,
- edge filtering for blast-radius, `graft ask` output → injection formatting, lock acquire/release.
-- **Integration:** feed recorded hook payloads (JSON on stdin) to `graft-hooks.cjs`
- and assert (a) state writes and (b) injected `additionalContext`. Feed a recorded
- statusline stdin blob and assert the rendered string.
-- **Dogfood (manual):** run inside `context-graph-engine`'s own Claude Code session
- (it is already indexed by Graft). Edit a source file, confirm `⚠ stale` → turn end →
- `✓ synced`, and that `--deep` is never invoked (watch for OpenRouter calls = none).
-
-## 12. Rollout
-
-1. Build + dogfood in `context-graph-engine/.claude/` on a feature branch.
-2. Keep helpers repo-agnostic (paths via `CLAUDE_PROJECT_DIR`) so they can later be
- emitted by a `graft claude-init` command (separate plan).
-3. Merge once the drift→sync loop is verified end-to-end with zero API spend.
-
-## 13. Decisions (resolved 2026-07-20)
-
-1. **`enrichedPct` display:** show the segment **only when `readyCount ≥ 1`**; hide
- entirely for a structural-only graph. (See §5.)
-2. **`graftReads` on the bar:** **capture in `session/<id>.json` now, do not display yet.**
- Revisit surfacing it once the number is trusted.
-3. **Sync build scope:** **build auto-sync properly** — robust lock, detached
- background process, debounce, and correct `dirty`/`staleCount`/`syncedAt`
- transitions. v1 runs a full structural `graft build`; changed-files scoping is a
- later optimization behind the same interface (not a shortcut on correctness).
diff --git a/docs/superpowers/specs/2026-07-20-graft-init-onboarding-design.md b/docs/superpowers/specs/2026-07-20-graft-init-onboarding-design.md
deleted file mode 100644
index 2c5beba0..00000000
--- a/docs/superpowers/specs/2026-07-20-graft-init-onboarding-design.md
+++ /dev/null
@@ -1,143 +0,0 @@
-# `graft init` — one-command onboarding for the Claude Code integration
-
-**Date:** 2026-07-20
-**Status:** Draft for review
-**Owner:** Shrish
-**Scope:** One implementation plan. Builds on the shipped `.claude/` integration (`src/claude/*`).
-
-## 1. Goal
-
-Make the Claude Code integration work in **any** repo that installs `@nanonets/graft`, not just Graft's own repo. After install, a single command wires everything up:
-
-```
-npm i -D @nanonets/graft # postinstall prints a one-line nudge
-npx graft init # scaffolds .claude/, builds the graph — done
-# open Claude Code in the repo → statusline + hooks + auto-sync live
-```
-
-## 2. Why it doesn't work today (the two gaps)
-
-1. **Shims resolve the wrong place.** `.claude/helpers/graft-*.cjs` import `<CLAUDE_PROJECT_DIR>/dist/claude/*.js` — the *consumer's* dist, which only exists in Graft's own repo. In any other repo that path is empty, so the statusline/hooks silently no-op.
-2. **No installer.** The `.claude/settings.json` + shims exist in Graft's repo only because they were hand-authored. A fresh `npm i @nanonets/graft` drops zero `.claude/` files.
-
-Also relevant: `package.json` has a **restrictive `exports` map** (`"."` only), so a consumer shim cannot `import('@nanonets/graft/dist/claude/…')` — Node blocks non-declared subpaths. The fix resolves the package's location on disk and dynamic-imports the **absolute** file path (which bypasses `exports`).
-
-## 3. Scope
-
-**In scope:**
-- Smart shims that resolve the installed package (with a local-build fallback for Graft's own repo).
-- `exports` addition: `"./package.json": "./package.json"` (guarantees the resolve).
-- `graft init` command: merge settings, write shims, build graph if absent, print next steps. Idempotent.
-- `postinstall` nudge script.
-- Version bump to `0.3.0` and publish.
-
-**Out of scope (deferred):**
-- An interactive wizard / key prompt flow (init just *tells* the user about `OPENROUTER_API_KEY`).
-- `graft init --uninstall` / teardown.
-- A `graft doctor` health check for the integration.
-- Auto-writing `.claude/` from `postinstall` (rejected — invasive, skipped under `--ignore-scripts`, can't prompt).
-
-## 4. Design
-
-### 4.1 Smart shim resolution (the core fix)
-
-`graft init` writes each shim so it resolves the integration from wherever Graft actually lives:
-
-```js
-// .claude/helpers/graft-statusline.cjs
-#!/usr/bin/env node
-const path = require('path');
-const dir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
-function entry(name) {
- try {
- // consumer repo: graft is an installed dependency
- const pkg = require.resolve('@nanonets/graft/package.json', { paths: [dir] });
- return path.join(path.dirname(pkg), 'dist', 'claude', name);
- } catch {
- // graft's own repo (dogfood): compiled into ./dist
- return path.join(dir, 'dist', 'claude', name);
- }
-}
-import(entry('statusline.js')).then((m) => m.main()).catch(() => { /* best-effort */ });
-```
-
-The hooks shim is identical except it imports `entry('hooks.js')` and calls `m.main(process.argv[2])`.
-
-- Absolute-path `import()` is **not** subject to the `exports` map, so this works despite `"."`-only exports.
-- Fallback path keeps Graft's own repo working (there, `@nanonets/graft` is not in `node_modules`, so `require.resolve` throws and we use `./dist`).
-- Graft's **own committed** `.claude/helpers/*.cjs` are updated to this same smart form (single shim shape for both cases).
-
-### 4.2 `package.json` change
-
-Add `"./package.json"` to `exports` so `require.resolve('@nanonets/graft/package.json', …)` is guaranteed under strict resolution:
-
-```json
-"exports": {
- ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
- "./package.json": "./package.json"
-}
-```
-
-### 4.3 Settings merge (never clobber)
-
-`mergeGraftSettings(existing) → { merged, warnings }`, a pure function:
-- **statusLine:** set Graft's only if absent. If the user already has a `statusLine`, **skip it and emit a warning** (a session can have only one). subagentStatusLine: same rule.
-- **hooks:** for each of `PostToolUse` / `UserPromptSubmit` / `SessionStart` / `Stop`, **append** Graft's hook entry to any existing array (create the array if absent). Dedupe: if a Graft entry (identified by the `graft-hooks.cjs` command string) is already present for that event, replace it rather than duplicate — makes re-running init idempotent.
-- **footerLinksRegexes:** add Graft's regex if not already present (union, deduped).
-- Everything else in the existing settings is preserved untouched.
-
-### 4.4 `graft init` command
-
-`graft init [dir] [--no-build]`:
-1. Resolve target dir (arg or cwd).
-2. Read existing `.claude/settings.json` (or `{}`); compute `mergeGraftSettings`; write it back (pretty JSON). Print any warnings.
-3. Write `.claude/helpers/graft-statusline.cjs` and `graft-hooks.cjs` (smart shims), `chmod +x`.
-4. If no `graft/.graph/wiring.json` exists and not `--no-build`: run a structural `graft build` ($0). Never `--deep`.
-5. Print a short next-steps block: what was written, that the integration activates in Claude Code sessions here, and that `OPENROUTER_API_KEY` + `graft build --deep` enriches summaries.
-6. Idempotent: re-running updates in place, no duplicates.
-
-Implemented as `runInit(dir, { build }): InitResult` in `src/claude/init.ts`; `cli.ts` adds `.command("init")`.
-
-### 4.5 Install nudge (`postinstall`)
-
-`scripts/postinstall.mjs`, wired as `"postinstall"` in `package.json`:
-- Prints one line: `Graft installed. Run \`npx graft init\` to enable the Claude Code integration (statusline + hooks + auto-sync).`
-- **Never fails the install:** wrapped so any error exits 0.
-- **Quiet when noise would hurt:** skip if `CI` is set, if `.claude/helpers/graft-statusline.cjs` already exists (already initialized), or if not a TTY-ish interactive install (best-effort check). Skipping is silent.
-
-### 4.6 Money guard (unchanged, still binding)
-
-`graft init`'s build step and everything downstream run only plain `graft build` — structural, offline, `$0`. Never `--deep`. Enrichment stays a manual, explicit, keyed step.
-
-## 5. File structure
-
-**Created:**
-- `src/claude/settings-merge.ts` — `mergeGraftSettings` (pure) + the Graft block constants.
-- `src/claude/shim-template.ts` — `statuslineShim()` / `hooksShim()` returning the `.cjs` source strings.
-- `src/claude/init.ts` — `runInit(dir, opts)` orchestration.
-- `scripts/postinstall.mjs` — the nudge.
-- `test/claude-settings-merge.test.ts`, `test/claude-init.test.ts` — tests.
-
-**Modified:**
-- `src/cli.ts` — add the `init` command.
-- `.claude/helpers/graft-statusline.cjs`, `.claude/helpers/graft-hooks.cjs` — updated to the smart-resolution form.
-- `package.json` — `exports["./package.json"]`, `scripts.postinstall`, version `0.3.0`.
-
-## 6. Testing
-
-- **settings-merge (unit):** empty settings → full Graft blocks; existing foreign `statusLine` → skipped + warning; existing hooks array → Graft appended; re-run → idempotent (no dupes); foreign keys preserved.
-- **shim-template (unit):** generated source is valid JS (loads via `require`/`new Function`) and contains both the package-resolve and the local-fallback branches.
-- **init (integration):** run `runInit` in a temp dir → asserts `.claude/settings.json` + both shims written, graph build skipped with `--no-build`, and a second run is idempotent.
-- **consumer smoke (manual, in verification task):** create a throwaway dir with a fake `node_modules/@nanonets/graft` (symlink to the built package), run the written statusline shim with a stdin payload, confirm it resolves the package path and renders (not "not built").
-- Full suite stays green; `npm run build` clean.
-
-## 7. Publish (after the branch merges / or from the branch once green)
-
-- Bump `0.3.0` (minor — additive feature, no breaking change to existing CLI).
-- `npm publish` requires **security-key 2FA** — use the established pseudo-TTY + auto-ENTER recipe so npm opens the browser and the key is tapped in one shot (tokens expire fast; a publish 404 means auth, not a missing package).
-- Post-publish verify: `npm view @nanonets/graft version` shows `0.3.0`; a scratch `npm i @nanonets/graft && npx graft init` in a temp repo wires up and renders.
-
-## 8. Open decisions
-
-1. **`graft init` runs `graft build` by default** (with `--no-build` to skip). Confirmed: yes — keeps "one command → everything in place" true.
-2. **postinstall nudge verbosity:** one line, skipped in CI / when already initialized. (Leaning: as specified — minimal.)
diff --git a/graft/.graph/wiring.json b/graft/.graph/wiring.json
deleted file mode 100644
index 6be31070..00000000
--- a/graft/.graph/wiring.json
+++ /dev/null
@@ -1,27866 +0,0 @@
-{
- "meta": {
- "version": 1,
- "nodeCount": 853,
- "edgeCount": 2312,
- "languages": [
- "typescript"
- ],
- "scopes": [
- {
- "prefix": "",
- "label": "",
- "markers": [
- "package.json"
- ]
- }
- ]
- },
- "nodes": [
- {
- "id": "bench/agent.ts",
- "name": "agent.ts",
- "kind": "file",
- "path": "bench/agent.ts",
- "span": "L1-L342",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "34a496d38f2dfc14688cb4f0981262d79dacef165bd1a4f9874b94c31e1819e9",
- "chars": 13521,
- "summary_state": "ready",
- "summary": "This file implements a benchmark agent that executes a loop for evaluating the performance of different AI models in answering questions based on a codebase.",
- "crux": {
- "code": "export interface RunAgentOptions {\n /** Directory the filesystem tools are confined to. */\n root: string;\n question: string;\n /** When set (graph/push arm), this bundle is injected before the question. */\n contextBundle?: string;\n /** When set (pull arm), the agent additionally gets graft_ask/graft_skeleton\n * tools over the prebuilt graph at this contextDir — nothing injected up\n * front; the agent pays for graph context only when it asks for it. */\n graft?: { contextDir: string };\n maxIterations?: number;\n model?: ChatModel;",
- "span": "L30-L41"
- }
- },
- {
- "id": "bench/agent.ts#AgentResult",
- "name": "AgentResult",
- "kind": "interface",
- "path": "bench/agent.ts",
- "span": "L20-L28",
- "signature": "interface AgentResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "f4e0672910fa23856c22d12c1cdd474a4d144a773e9147f6e70b67fcbc2f9cdc",
- "summary_state": "ready",
- "summary": "Defines the structure of the result returned by the agent, encapsulating the answer and various metrics.",
- "crux": null
- },
- {
- "id": "bench/agent.ts#globToRegExp",
- "name": "globToRegExp",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L97-L111",
- "signature": "function globToRegExp(glob: string): RegExp",
- "exported": false,
- "origin": "ast",
- "body_hash": "bf9f513a64c4a25612509c1bc9ca3e5ab141d47051aee3cb4d487fc6d87fd484",
- "summary_state": "ready",
- "summary": "Converts a glob pattern into a regular expression for matching file paths.",
- "crux": {
- "code": " } else re += \"[^/]*\";\n } else if (c === \"?\") re += \"[^/]\";\n else if (\".+^${}()|[]\\\\\".includes(c)) re += \"\\\\\" + c;\n else re += c;\n }\n return new RegExp(\"^\" + re + \"$\");",
- "span": "L100-L105"
- }
- },
- {
- "id": "bench/agent.ts#listFiles",
- "name": "listFiles",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L67-L94",
- "signature": "function listFiles(root: string): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "c99c73e1c6a44093a6f779cd0b4c54db649c4f0fb0c03a6af9c38673bc24f711",
- "summary_state": "ready",
- "summary": "Recursively lists all files in a directory while respecting size limits and skipping specified directories.",
- "crux": {
- "code": " try {\n if (statSync(full).size > MAX_FILE_BYTES) continue;\n } catch {\n continue;\n }\n out.push(full);\n }",
- "span": "L78-L84"
- }
- },
- {
- "id": "bench/agent.ts#listFiles.walk",
- "name": "walk",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L69-L91",
- "signature": "walk = (dir: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "5a2365b8f09853c622d73cf63ed6804cf9fe3667bfc30f981759e2aff5483b43",
- "summary_state": "ready",
- "summary": "A helper function that traverses a directory to collect file paths, avoiding hidden files and skipped directories.",
- "crux": {
- "code": " if (e.name.startsWith(\".\")) continue;\n const full = join(dir, e.name);\n if (e.isDirectory()) {\n if (SKIP_DIRS.has(e.name)) continue;\n walk(full);\n } else if (e.isFile()) {\n try {\n if (statSync(full).size > MAX_FILE_BYTES) continue;\n } catch {\n continue;\n }\n out.push(full);",
- "span": "L72-L83"
- }
- },
- {
- "id": "bench/agent.ts#runAgent",
- "name": "runAgent",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L261-L341",
- "signature": "async function runAgent(opts: RunAgentOptions): Promise<AgentResult>",
- "exported": true,
- "origin": "ast",
- "body_hash": "18b047787ff99383e6137911724c03da6cc58294bfc727176fb9f8eab9922130",
- "summary_state": "ready",
- "summary": "Manages the execution of the agent, processing user questions and utilizing tools to generate answers while tracking performance metrics.",
- "crux": {
- "code": "export async function runAgent(opts: RunAgentOptions): Promise<AgentResult> {\n const model = opts.model ?? makeChatModel(AGENT_MODEL);\n const root = resolve(opts.root);\n const maxIterations = opts.maxIterations ?? 15;\n\n const userText = opts.contextBundle\n ? `A knowledge graph of these files was queried for this task and returned the context below. ` +\n `Use it to answer; you may still use the tools to confirm or fill gaps.\\n\\n` +\n `<graph_context>\\n${opts.contextBundle}\\n</graph_context>\\n\\nQuestion: ${opts.question}`\n : `Question: ${opts.question}`;\n\n // Cache breakpoints (Message.cacheBreakpoint) let the adapter mark a stable",
- "span": "L261-L272"
- }
- },
- {
- "id": "bench/agent.ts#runAgent.slideCacheBreakpoint",
- "name": "slideCacheBreakpoint",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L289-L294",
- "signature": "slideCacheBreakpoint = ()",
- "exported": true,
- "origin": "ast",
- "body_hash": "8d5bb7899e04ee3a8acccc0cf663bb7e90af29d67512d6be141896f5ce3f20d5",
- "summary_state": "ready",
- "summary": "Maintains the cache breakpoint on the most recent tool result to optimize performance during the agent's execution.",
- "crux": {
- "code": " const slideCacheBreakpoint = () => {\n const toolMsgs = messages.filter((m) => m.role === \"tool\");\n toolMsgs.forEach((m, i) => {\n m.cacheBreakpoint = i === toolMsgs.length - 1;\n });\n };",
- "span": "L289-L294"
- }
- },
- {
- "id": "bench/agent.ts#RunAgentOptions",
- "name": "RunAgentOptions",
- "kind": "interface",
- "path": "bench/agent.ts",
- "span": "L30-L42",
- "signature": "interface RunAgentOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "6bea792855de015a870cd69720098286069460f9aa7be6e51447a2b1fabf320c",
- "summary_state": "ready",
- "summary": "Defines the options for running the agent, including the root directory and the question to be answered.",
- "crux": {
- "code": "export interface RunAgentOptions {\n /** Directory the filesystem tools are confined to. */\n root: string;\n question: string;\n /** When set (graph/push arm), this bundle is injected before the question. */\n contextBundle?: string;\n /** When set (pull arm), the agent additionally gets graft_ask/graft_skeleton\n * tools over the prebuilt graph at this contextDir — nothing injected up\n * front; the agent pays for graph context only when it asks for it. */\n graft?: { contextDir: string };\n maxIterations?: number;\n model?: ChatModel;",
- "span": "L30-L41"
- }
- },
- {
- "id": "bench/agent.ts#runTool",
- "name": "runTool",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L189-L259",
- "signature": "function runTool(root: string, name: string, input: any, graft?: { contextDir: string }): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "00cdcb79849a3f634c0ea08fe3d26b8156d8714e7b2c5d51ca645f74337852c4",
- "summary_state": "ready",
- "summary": "Executes a specified tool with given input, handling various file operations and queries within a defined root directory.",
- "crux": {
- "code": " if (name === \"read_file\") {\n const file = safePath(root, String(input.path));\n const lines = readFileSync(file, \"utf8\").split(\"\\n\");\n const start = input.start_line ? Math.max(1, input.start_line) : 1;\n const end = input.end_line ? Math.min(lines.length, input.end_line) : Math.min(lines.length, start - 1 + MAX_READ_LINES);\n const slice = lines.slice(start - 1, end);\n const numbered = slice.map((l: string, i: number) => `${start + i}\\t${l}`).join(\"\\n\");\n const more = end < lines.length ? `\\n… (${lines.length - end} more lines)` : \"\";\n return numbered + more || \"(empty file)\";\n }\n if (name === \"list_dir\") {\n const dir = input.path ? safePath(root, String(input.path)) : root;",
- "span": "L201-L212"
- }
- },
- {
- "id": "bench/agent.ts#safePath",
- "name": "safePath",
- "kind": "function",
- "path": "bench/agent.ts",
- "span": "L51-L65",
- "signature": "function safePath(root: string, p: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "8a6349aeb94f54f93a15bde379809135e40fcb4844de10eab68d4c95f0301a16",
- "summary_state": "ready",
- "summary": "Ensures that a given path is safely resolved within a specified root directory, preventing directory traversal attacks.",
- "crux": {
- "code": " if (rel.startsWith(\"..\") || isAbsolute(rel)) throw new Error(`path escapes root: ${p}`);\n try {\n const real = realpathSync(abs);\n const realRoot = realpathSync(root);\n rel = relative(realRoot, real);\n if (rel.startsWith(\"..\") || isAbsolute(rel)) throw new Error(`path escapes root: ${p}`);\n return real;",
- "span": "L49-L55"
- }
- },
- {
- "id": "bench/judge.ts",
- "name": "judge.ts",
- "kind": "file",
- "path": "bench/judge.ts",
- "span": "L1-L87",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "bb48a8012b929bc0237f4d900d0ab7aa9a98f96777d72a89ce5305c6c57e6c47",
- "chars": 3035,
- "summary_state": "ready",
- "summary": "This file implements a correctness scoring system that evaluates AI-generated answers against a reference answer, ensuring both keyword requirements and factual accuracy are met.",
- "crux": {
- "code": " * Final correctness = judge says correct AND the keyword floor passed.",
- "span": "L11-L11"
- }
- },
- {
- "id": "bench/judge.ts#extractJson",
- "name": "extractJson",
- "kind": "function",
- "path": "bench/judge.ts",
- "span": "L35-L49",
- "signature": "function extractJson(text: string): any",
- "exported": false,
- "origin": "ast",
- "body_hash": "8598a77c27df0c2d51964f8e5bd27752fca0c0af9b038302069d9440535fe911",
- "summary_state": "ready",
- "summary": "The extractJson function retrieves the first JSON object from a string, handling cases where the JSON is wrapped in additional text.",
- "crux": {
- "code": " return JSON.parse(text);\n } catch {\n const m = text.match(/\\{[\\s\\S]*\\}/);\n if (m) {\n try {\n return JSON.parse(m[0]);",
- "span": "L37-L42"
- }
- },
- {
- "id": "bench/judge.ts#judge",
- "name": "judge",
- "kind": "function",
- "path": "bench/judge.ts",
- "span": "L51-L86",
- "signature": "async function judge(input: JudgeInput): Promise<Verdict>",
- "exported": true,
- "origin": "ast",
- "body_hash": "10c2f17e3f861d21e0f4f9750141ca1e4377a7d82cd6c3541a3a9953c64e5eb4",
- "summary_state": "ready",
- "summary": "Evaluates an AI agent's answer against a reference answer, returning a verdict that indicates correctness based on both a judge's score and keyword requirements.",
- "crux": {
- "code": " const keywordPass = kw.every((k) => hay.includes(k.toLowerCase()));\n\n const prompt =\n `You are grading an AI agent's answer to a factual question about a codebase/document set. ` +\n `Respond with ONLY a JSON object of the form {\"correct\": boolean, \"score\": number, \"reasoning\": string} ` +\n `where score is 0.0 (wrong/irrelevant) to 1.0 (fully correct and complete). No prose, no code fences.\\n\\n` +\n `Question:\\n${input.question}\\n\\n` +\n `Reference answer (ground truth):\\n${input.referenceAnswer}\\n\\n` +\n `Agent's answer:\\n${input.agentAnswer}\\n\\n` +\n `Grade whether the agent's answer is factually correct and responsive, judged against the reference. ` +\n `Extra correct detail is fine; contradicting the reference or missing the core fact is not.`;\n",
- "span": "L56-L67"
- }
- },
- {
- "id": "bench/judge.ts#JudgeInput",
- "name": "JudgeInput",
- "kind": "interface",
- "path": "bench/judge.ts",
- "span": "L26-L32",
- "signature": "interface JudgeInput",
- "exported": true,
- "origin": "ast",
- "body_hash": "f7eabe8d43f6e4f78138ebd0ec6c33add397b86e67c4032370283f0829abaeb5",
- "summary_state": "ready",
- "summary": "Defines the structure for input data required to evaluate an AI agent's answer, including the question, reference answer, and required keywords.",
- "crux": null
- },
- {
- "id": "bench/judge.ts#Verdict",
- "name": "Verdict",
- "kind": "interface",
- "path": "bench/judge.ts",
- "span": "L18-L24",
- "signature": "interface Verdict",
- "exported": true,
- "origin": "ast",
- "body_hash": "650e88981503f18e5a30dc0050ad111724eb40d2d32ebb0bec9106bb3d934e50",
- "summary_state": "ready",
- "summary": "The Verdict interface encapsulates the scoring results and correctness evaluation of an AI agent's answer.",
- "crux": null
- },
- {
- "id": "bench/llm.ts",
- "name": "llm.ts",
- "kind": "file",
- "path": "bench/llm.ts",
- "span": "L1-L29",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "6fc86553ce48879cb28b411747fe3ffaa2ad5c269e5de50d83e4ed8b629cae2b",
- "chars": 1187,
- "summary_state": "ready",
- "summary": "This file provides a benchmark setup for LLMs, ensuring that the correct models and configurations are used based on environment variables.",
- "crux": null
- },
- {
- "id": "bench/llm.ts#makeChatModel",
- "name": "makeChatModel",
- "kind": "function",
- "path": "bench/llm.ts",
- "span": "L16-L28",
- "signature": "function makeChatModel(model: string): ChatModel",
- "exported": true,
- "origin": "ast",
- "body_hash": "4fdca5065740a7c03ec37acf343949735d86a191cda73c76439fe81ff5123a9e",
- "summary_state": "ready",
- "summary": "Creates a chat model instance while enforcing the requirement of a valid API key for the provider.",
- "crux": {
- "code": " if (!cfg.apiKey) {\n throw new Error(\"Set GRAFT_API_KEY (or OPENROUTER_API_KEY) — the bench agent + judge need a provider key.\");",
- "span": "L18-L19"
- }
- },
- {
- "id": "bench/report.ts",
- "name": "report.ts",
- "kind": "file",
- "path": "bench/report.ts",
- "span": "L1-L176",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "17c0be550f9712165177d070f58cbe7a0f60fcb2c1dc5830eb1a4dde97ec12f3",
- "chars": 6985,
- "summary_state": "ready",
- "summary": "This file aggregates and reports benchmark results for different agent configurations, providing insights into performance metrics.",
- "crux": {
- "code": "/**\n * Aggregation and reporting. Turns the raw per-trial rows into the summary\n * table that is the actual launch deliverable: per corpus, cold vs graph, with\n * the token / latency / correctness deltas that either back the pitch or don't.\n */",
- "span": "L1-L5"
- }
- },
- {
- "id": "bench/report.ts#aggregate",
- "name": "aggregate",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L60-L72",
- "signature": "function aggregate(rows: Row[]): ArmAgg",
- "exported": false,
- "origin": "ast",
- "body_hash": "2dc5a442b3d9d4a3a674a2bee1a8ceddd9410a4d92bacf30bea4503e7588f3fb",
- "summary_state": "ready",
- "summary": "Aggregates multiple benchmark rows into a single ArmAgg object, calculating averages for various metrics.",
- "crux": {
- "code": "function aggregate(rows: Row[]): ArmAgg {\n return {\n n: rows.length,\n tokensTotal: mean(rows.map((r) => r.tokensTotal)),\n tokensInput: mean(rows.map((r) => r.tokensInput)),\n tokensOutput: mean(rows.map((r) => r.tokensOutput)),\n toolCalls: mean(rows.map((r) => r.toolCalls)),\n wallMs: mean(rows.map((r) => r.wallMs)),\n correctness: mean(rows.map((r) => (r.correct ? 1 : 0))),\n score: mean(rows.map((r) => r.score)),\n cost: mean(rows.map((r) => costOf(r))),\n };",
- "span": "L56-L67"
- }
- },
- {
- "id": "bench/report.ts#Arm",
- "name": "Arm",
- "kind": "type",
- "path": "bench/report.ts",
- "span": "L6-L6",
- "signature": "type Arm = \"cold\" | \"graph\" | \"pull\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "4d3e3333d5561c7885e9445936b562e1748016465e14c964652d98acf70b20d4",
- "summary_state": "ready",
- "summary": "Defines the possible execution arms for the benchmarking process, categorizing the types of agent runs.",
- "crux": null
- },
- {
- "id": "bench/report.ts#ArmAgg",
- "name": "ArmAgg",
- "kind": "interface",
- "path": "bench/report.ts",
- "span": "L48-L58",
- "signature": "interface ArmAgg",
- "exported": false,
- "origin": "ast",
- "body_hash": "a7a78cc5f14ddd30155d952a75e96f4508ffbf4d3bf432e53945cbf055cc67dd",
- "summary_state": "ready",
- "summary": "Represents aggregated metrics for a specific arm of the benchmark, including totals and averages.",
- "crux": null
- },
- {
- "id": "bench/report.ts#buildMarkdown",
- "name": "buildMarkdown",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L129-L175",
- "signature": "function buildMarkdown(rows: Row[]): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "0157ce2adf00bdbf4d01440165deabc0b633ffe5c7db30c55fa19d25bc03d288",
- "summary_state": "ready",
- "summary": "Compiles the overall benchmark results into a markdown format for easy readability and presentation.",
- "crux": {
- "code": " const corpora = [...new Set(rows.map((r) => r.corpus))];\n const armOrder: Arm[] = [\"cold\", \"graph\", \"pull\"];\n const lines: string[] = [];\n lines.push(\"# graft — Benchmark Results\", \"\");\n lines.push(\n `Agent: Claude Sonnet 5 · Judge: Claude Opus 4.8 · ${rows.length} agent runs total.`,\n \"\",\n \"Each cell is the mean across all tasks × trials for that subset/arm; Δ is vs cold. \" +\n \"**Cold** = agent explores with filesystem tools from zero. **Graph (push)** = same agent, \" +\n \"same tools, plus a `graft ask --source` bundle injected up front. **Graft (pull)** = same \" +\n \"agent plus graft_ask/graft_skeleton tools over the prebuilt graph — nothing injected; \" +\n \"graph context is paid only when the agent asks for it.\",",
- "span": "L130-L141"
- }
- },
- {
- "id": "bench/report.ts#costOf",
- "name": "costOf",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L37-L42",
- "signature": "function costOf(r: { tokensInput: number; tokensOutput: number; cacheRead: number; cacheCreate: number }): number",
- "exported": true,
- "origin": "ast",
- "body_hash": "413c8810eda0e5edbb94cf5a7491732fdc1e4cb3df89eda614e7ce145f2b7c11",
- "summary_state": "ready",
- "summary": "Calculates the approximate cost of running an agent based on input and output tokens and cache operations.",
- "crux": {
- "code": " return (\n (r.tokensInput + r.cacheCreate * 1.25 + r.cacheRead * 0.1) * IN_PER_TOK +\n r.tokensOutput * OUT_PER_TOK\n );",
- "span": "L34-L37"
- }
- },
- {
- "id": "bench/report.ts#fmt",
- "name": "fmt",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L80-L82",
- "signature": "function fmt(n: number): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "e5554c617b5485df92a2ba8792f4bb715431c2aa0a21f7e900465d0a2690e5b1",
- "summary_state": "ready",
- "summary": "Formats a number for display, adjusting for thousands and decimal precision.",
- "crux": null
- },
- {
- "id": "bench/report.ts#mean",
- "name": "mean",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L44-L46",
- "signature": "function mean(xs: number[]): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "bc3ca4cedc8d6833e415c55049ed08517980bbc60e432640f883cbed2e5aafae",
- "summary_state": "ready",
- "summary": "Computes the mean of an array of numbers, returning zero for an empty array.",
- "crux": null
- },
- {
- "id": "bench/report.ts#metricTable",
- "name": "metricTable",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L88-L114",
- "signature": "function metricTable(rows: Row[], arms: Arm[]): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "040824ba07e90ba35a7d1b3628412ec72297da5395737d9c1affb2dca8f9e479",
- "summary_state": "ready",
- "summary": "Generates a formatted metric table comparing performance across different agent arms, highlighting key metrics and deltas.",
- "crux": {
- "code": " lines.push(cells(\"Cost / task ($)\", (a) => a.cost, (v) => v.toFixed(4), pctDelta));\n lines.push(cells(\"Uncached input tokens\", (a) => a.tokensInput, fmt, pctDelta));\n lines.push(cells(\"Total tokens (incl. cached)\", (a) => a.tokensTotal, fmt, pctDelta));\n lines.push(cells(\"Output tokens\", (a) => a.tokensOutput, fmt, pctDelta));\n lines.push(cells(\"Tool calls\", (a) => a.toolCalls, fmt, pctDelta));\n lines.push(cells(\"Wall-clock (s)\", (a) => a.wallMs, (v) => (v / 1000).toFixed(1), pctDelta));\n lines.push(cells(\"Correctness\", (a) => a.correctness, (v) => (v * 100).toFixed(0) + \"%\"));",
- "span": "L105-L111"
- }
- },
- {
- "id": "bench/report.ts#metricTable.cells",
- "name": "cells",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L93-L102",
- "signature": "cells = (label: string, value: (a: ArmAgg) => number, render: (v: number) => string, delta?: (c: number, x: number) => string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "92c5b466f286a53a3ff7de7e5da8b52695f016703252bbf385df554c730f0b5a",
- "summary_state": "ready",
- "summary": "Constructs individual cells for the metric table, calculating values and formatting them for display.",
- "crux": {
- "code": " const cells = (label: string, value: (a: ArmAgg) => number, render: (v: number) => string, delta?: (c: number, x: number) => string) => {\n const out = [label];\n for (const a of arms) {\n const v = value(agg.get(a)!);\n let cell = render(v);\n if (delta && cold && a !== \"cold\") cell += ` (${delta(value(cold), v)})`;\n out.push(cell);\n }\n return `| ${out.join(\" | \")} |`;\n };",
- "span": "L93-L102"
- }
- },
- {
- "id": "bench/report.ts#pctDelta",
- "name": "pctDelta",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L74-L78",
- "signature": "function pctDelta(cold: number, graph: number): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "e8adea58e85eb9a811c2fbdd6e999781ca014f54162f777f2dbd29cbc541e972",
- "summary_state": "ready",
- "summary": "Calculates the percentage delta between two values, handling the case where the first value is zero.",
- "crux": {
- "code": "function pctDelta(cold: number, graph: number): string {\n if (cold === 0) return \"n/a\";\n const d = ((graph - cold) / cold) * 100;\n return (d > 0 ? \"+\" : \"\") + d.toFixed(0) + \"%\";",
- "span": "L70-L73"
- }
- },
- {
- "id": "bench/report.ts#Row",
- "name": "Row",
- "kind": "interface",
- "path": "bench/report.ts",
- "span": "L8-L30",
- "signature": "interface Row",
- "exported": true,
- "origin": "ast",
- "body_hash": "3ec44fbebb1290b68e6b1d52a189eabfb75f43e416384671a174769265610c30",
- "summary_state": "ready",
- "summary": "Represents a single trial's data, encapsulating all relevant metrics for benchmarking an agent's performance.",
- "crux": null
- },
- {
- "id": "bench/report.ts#verdictFor",
- "name": "verdictFor",
- "kind": "function",
- "path": "bench/report.ts",
- "span": "L117-L127",
- "signature": "function verdictFor(label: string, c: ArmAgg, g: ArmAgg): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "2fb44808117e96d184dcf795bfc7bc9546c05e3d2e0c6b8a888a51c5a8f581ce",
- "summary_state": "ready",
- "summary": "Evaluates and compares the cost and correctness of two agent configurations, providing a verdict on their performance.",
- "crux": {
- "code": " return cheaper && correctnessHeld\n ? `✅ ${label} is cheaper (${pctDelta(c.cost, g.cost)} cost) and correctness held or improved.`\n : !cheaper && g.correctness > c.correctness + 0.001\n ? `➖ ${label} costs more (${pctDelta(c.cost, g.cost)}) but is more correct (+${((g.correctness - c.correctness) * 100).toFixed(0)} pts) — a quality win, not a cost win.`\n : cheaper\n ? `⚠️ ${label} is cheaper but correctness dropped ${((c.correctness - g.correctness) * 100).toFixed(0)} pts — not a clean win.`\n : `❌ ${label} costs more with no correctness gain here.`;",
- "span": "L120-L126"
- }
- },
- {
- "id": "bench/run.ts",
- "name": "run.ts",
- "kind": "file",
- "path": "bench/run.ts",
- "span": "L1-L210",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "fd4445eb0d6d3c1a8b994c7e4be42522c3214612a8499e4f76bfc10d0030f9da",
- "chars": 8902,
- "summary_state": "ready",
- "summary": "Orchestrates benchmarking tasks across different configurations and trials, ensuring efficient execution and result collection.",
- "crux": {
- "code": "async function main() {\n const args = parseArgs(process.argv.slice(2));\n if (!resolveConfig().apiKey) {\n console.error(\"Set GRAFT_API_KEY (or OPENROUTER_API_KEY) — the agent and judge need a provider key.\");\n process.exit(1);\n }\n const agentModel = makeChatModel(AGENT_MODEL);\n const judgeModel = makeChatModel(JUDGE_MODEL);\n\n const corpora = CORPORA.filter((c) => !args.corpora || args.corpora.includes(c.id));\n if (corpora.length === 0) {\n console.error(`No matching corpora. Available: ${CORPORA.map((c) => c.id).join(\", \")}`);",
- "span": "L83-L94"
- }
- },
- {
- "id": "bench/run.ts#Args",
- "name": "Args",
- "kind": "interface",
- "path": "bench/run.ts",
- "span": "L39-L45",
- "signature": "interface Args",
- "exported": false,
- "origin": "ast",
- "body_hash": "081f4c21818443a203a267bb039fb7209a50acf6b714b402af2d010f5c64d06a",
- "summary_state": "ready",
- "summary": "Defines the structure for command-line arguments to configure the benchmarking process.",
- "crux": null
- },
- {
- "id": "bench/run.ts#main",
- "name": "main",
- "kind": "function",
- "path": "bench/run.ts",
- "span": "L83-L204",
- "signature": "async function main()",
- "exported": false,
- "origin": "ast",
- "body_hash": "83b0f4f7fa6b94e59c780554192a56982741682e8457195ca287a88ed9515f96",
- "summary_state": "ready",
- "summary": "Coordinates the overall benchmarking process, including argument parsing, corpus handling, and result generation.",
- "crux": {
- "code": " let done = 0;\n const total = units.length;\n const corpusRows = await pool(units, args.concurrency, async ({ task, arm, trial }) => {\n const base = {\n corpus: corpus.id, taskId: task.id, arm, trial,\n locality: task.locality ?? \"multi-file\",\n };\n try {\n const ar = await runAgent({\n model: agentModel,\n root: corpus.path,\n question: task.question,",
- "span": "L138-L149"
- }
- },
- {
- "id": "bench/run.ts#parseArgs",
- "name": "parseArgs",
- "kind": "function",
- "path": "bench/run.ts",
- "span": "L47-L67",
- "signature": "function parseArgs(argv: string[]): Args",
- "exported": false,
- "origin": "ast",
- "body_hash": "d3862150543501db4a56837578adde9a777203260b8e1c1d7f022615973e0c54",
- "summary_state": "ready",
- "summary": "Parses command-line arguments to set up the benchmarking configuration, ensuring valid options are provided.",
- "crux": {
- "code": " const bad = a.arms.filter((x) => !ALL_ARMS.includes(x));\n if (bad.length) {\n console.error(`Unknown arm(s): ${bad.join(\", \")}. Valid: ${ALL_ARMS.join(\", \")}`);\n process.exit(1);\n }\n return a;",
- "span": "L61-L66"
- }
- },
- {
- "id": "bench/run.ts#pool",
- "name": "pool",
- "kind": "function",
- "path": "bench/run.ts",
- "span": "L70-L81",
- "signature": "async function pool<T, R>(items: T[], n: number, fn: (item: T) => Promise<R>): Promise<R[]>",
- "exported": false,
- "origin": "ast",
- "body_hash": "a7195db3e63798d9ce8138057327e135cc12f0187a870a4856f5b0c5b1c21e84",
- "summary_state": "ready",
- "summary": "Executes a function on a set of items concurrently, limiting the number of simultaneous operations.",
- "crux": {
- "code": "async function pool<T, R>(items: T[], n: number, fn: (item: T) => Promise<R>): Promise<R[]> {\n const results: R[] = new Array(items.length);\n let next = 0;\n async function worker() {\n while (next < items.length) {\n const idx = next++;\n results[idx] = await fn(items[idx]);\n }\n }\n await Promise.all(Array.from({ length: Math.min(n, items.length) }, worker));\n return results;",
- "span": "L55-L65"
- }
- },
- {
- "id": "bench/run.ts#pool.worker",
- "name": "worker",
- "kind": "function",
- "path": "bench/run.ts",
- "span": "L73-L78",
- "signature": "async function worker()",
- "exported": false,
- "origin": "ast",
- "body_hash": "b9705c00faf21752c1d6cd68735d93e6f2a95a30b4ca5b5df894f01966715f79",
- "summary_state": "ready",
- "summary": "Processes items in the pool function, handling each item asynchronously.",
- "crux": {
- "code": " while (next < items.length) {\n const idx = next++;\n results[idx] = await fn(items[idx]);",
- "span": "L59-L61"
- }
- },
- {
- "id": "bench/selfcheck.ts",
- "name": "selfcheck.ts",
- "kind": "file",
- "path": "bench/selfcheck.ts",
- "span": "L1-L111",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "858ec7cce92c9105c4e111ae58f1d1a1b1b57372b96768804308009760c9b2f6",
- "chars": 5108,
- "summary_state": "ready",
- "summary": "This file provides an offline verification mechanism for the harness plumbing, ensuring control flow integrity without requiring an API key.",
- "crux": {
- "code": "import { mkdtempSync, writeFileSync, mkdirSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";",
- "span": "L8-L10"
- }
- },
- {
- "id": "bench/selfcheck.ts#main",
- "name": "main",
- "kind": "function",
- "path": "bench/selfcheck.ts",
- "span": "L41-L105",
- "signature": "async function main()",
- "exported": false,
- "origin": "ast",
- "body_hash": "540f18c9d742ad482342877ba58e677f03c119e371af1acb71cb0ffd5e9b3000",
- "summary_state": "ready",
- "summary": "Coordinates the self-check process by setting up the environment, running the agent, and validating the results through assertions.",
- "crux": {
- "code": " // 1. Agent loop: should call the grep tool once, then answer.\n const ar = await runAgent({ model, root, question: \"What is the secret token?\" });\n assert.equal(ar.toolCalls, 1, \"expected exactly one tool call\");\n assert.equal(ar.toolLog[0].name, \"grep\", \"expected the grep tool to run\");\n assert.ok(ar.answer.includes(\"SECRET_TOKEN\"), \"answer should contain the fact\");\n assert.equal(ar.tokens.total, 300, \"tokens should sum across 2 turns (150 each)\");\n assert.equal(ar.stopReason, \"stop\");\n console.log(`✓ agent loop: ${ar.toolCalls} tool call, ${ar.tokens.total} tokens, answer=\"${ar.answer}\"`);\n\n // 2. Real tool execution actually found the file (grep ran against the temp repo).\n const graphAr = await runAgent({\n model: makeStubModel(),",
- "span": "L48-L59"
- }
- },
- {
- "id": "bench/selfcheck.ts#makeStubModel",
- "name": "makeStubModel",
- "kind": "function",
- "path": "bench/selfcheck.ts",
- "span": "L20-L39",
- "signature": "function makeStubModel(): ChatModel",
- "exported": false,
- "origin": "ast",
- "body_hash": "bb35f851e0d597751b735bdb44d0ae399bb408825c1c4f2ec8d3d04036d0ff82",
- "summary_state": "ready",
- "summary": "Creates a stubbed ChatModel that simulates agent behavior for testing purposes, allowing for controlled responses during the agent loop.",
- "crux": {
- "code": " if (req.responseFormat?.kind === \"json\") {\n const text = JSON.stringify({ correct: true, score: 0.9, reasoning: \"matches reference\" });\n return { text, toolCalls: [], usage, stopReason: \"stop\", assistant: { role: \"assistant\", content: text } };\n }\n // Agent call. First turn: use grep. Second turn: final answer.\n agentTurn++;\n if (agentTurn === 1) {\n const toolCalls = [{ id: \"tc_1\", name: \"grep\", args: { pattern: \"SECRET_TOKEN\" } }];\n return { text: \"\", toolCalls, usage, stopReason: \"tool_use\", assistant: { role: \"assistant\", content: \"\", toolCalls } };\n }\n const text = \"The secret token is SECRET_TOKEN, defined in config.ts.\";\n return { text, toolCalls: [], usage, stopReason: \"stop\", assistant: { role: \"assistant\", content: text } };",
- "span": "L25-L36"
- }
- },
- {
- "id": "bench/selfcheck.ts#makeStubModel.create",
- "name": "create",
- "kind": "method",
- "path": "bench/selfcheck.ts",
- "span": "L24-L37",
- "signature": "async create(req)",
- "exported": false,
- "origin": "ast",
- "body_hash": "2e264ef92e35b9b98b80692d5b985c140e453d412ad8111166c0c3a7d9f15ee1",
- "summary_state": "ready",
- "summary": "Handles requests by returning predefined responses based on the request format, simulating the agent's decision-making process.",
- "crux": {
- "code": " if (req.responseFormat?.kind === \"json\") {\n const text = JSON.stringify({ correct: true, score: 0.9, reasoning: \"matches reference\" });\n return { text, toolCalls: [], usage, stopReason: \"stop\", assistant: { role: \"assistant\", content: text } };\n }\n // Agent call. First turn: use grep. Second turn: final answer.\n agentTurn++;\n if (agentTurn === 1) {\n const toolCalls = [{ id: \"tc_1\", name: \"grep\", args: { pattern: \"SECRET_TOKEN\" } }];\n return { text: \"\", toolCalls, usage, stopReason: \"tool_use\", assistant: { role: \"assistant\", content: \"\", toolCalls } };\n }\n const text = \"The secret token is SECRET_TOKEN, defined in config.ts.\";\n return { text, toolCalls: [], usage, stopReason: \"stop\", assistant: { role: \"assistant\", content: text } };",
- "span": "L25-L36"
- }
- },
- {
- "id": "bench/tasks.ts",
- "name": "tasks.ts",
- "kind": "file",
- "path": "bench/tasks.ts",
- "span": "L1-L365",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "efb90e69f52adcb08bfe45fb5a983fc676df68befdc455513e2581a24f46807e",
- "chars": 18806,
- "summary_state": "ready",
- "summary": "This file defines benchmark tasks and their associated metadata to ensure verifiable answers for codebase questions.",
- "crux": {
- "code": "/**\n * The benchmark corpus and task set. This file *is* the benchmark's validity:\n * every task must have a verifiable answer, grounded in the actual source\n * (cited during authoring), not guessed. Tasks carry a `locality` label so the\n * report can split the verdict: multi-file questions are where graph context\n * should help; localized single-file questions are where it is expected to be\n * net overhead — the bench must measure both, not select for the winner.\n *\n * Corpora: graft's own repo (context-engine — always present, self-contained),\n * plus real external repos expected as siblings of this one under the same\n * parent directory (override a path with BENCH_REPO_<ID_UPPER> if needed):\n * - unified-accounts-login-server — the Nanonets unified auth service (Node/Express).",
- "span": "L1-L12"
- }
- },
- {
- "id": "bench/tasks.ts#Corpus",
- "name": "Corpus",
- "kind": "interface",
- "path": "bench/tasks.ts",
- "span": "L47-L53",
- "signature": "interface Corpus",
- "exported": true,
- "origin": "ast",
- "body_hash": "4b3ae3ef3d07322b65aaa6b2821f5c8e6871251bdc7ab6d8248ce584a28a5603",
- "summary_state": "ready",
- "summary": "This interface defines a corpus of benchmark tasks, specifying its ID, type, path, and associated tasks.",
- "crux": null
- },
- {
- "id": "bench/tasks.ts#repoPath",
- "name": "repoPath",
- "kind": "function",
- "path": "bench/tasks.ts",
- "span": "L30-L33",
- "signature": "function repoPath(id: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "96ac12ff90253b3d673f747af65246aa6707ba09fda29f12266b75fbc9ae50f7",
- "summary_state": "ready",
- "summary": "This function determines the file path for sibling repositories, allowing for environment variable overrides.",
- "crux": {
- "code": " return process.env[envKey] ?? resolve(parent, id);",
- "span": "L28-L28"
- }
- },
- {
- "id": "bench/tasks.ts#Task",
- "name": "Task",
- "kind": "interface",
- "path": "bench/tasks.ts",
- "span": "L35-L45",
- "signature": "interface Task",
- "exported": true,
- "origin": "ast",
- "body_hash": "5f5e2039755acb77b6a0f6a14f752ef11da6c3b9a3fb124fda4f0fc871246304",
- "summary_state": "ready",
- "summary": "The Task interface structures the data for individual benchmark questions, ensuring they include necessary details for validation.",
- "crux": {
- "code": "export interface Task {\n id: string;\n question: string;\n referenceAnswer: string;\n /** Case-insensitive substrings the answer must contain (deterministic floor). */\n requiredKeywords: string[];\n /** \"localized\" = answerable from one file (where graph context is expected to\n * be net overhead — the hono-bench finding this bench must reproduce, not\n * hide). Absent = \"multi-file\", the shape the original corpus was limited to. */\n locality?: \"localized\" | \"multi-file\";\n}",
- "span": "L35-L45"
- }
- },
- {
- "id": "bench/token-ab.ts",
- "name": "token-ab.ts",
- "kind": "file",
- "path": "bench/token-ab.ts",
- "span": "L1-L279",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "b033a023d063cccc329103fbd11d4e1a6ab16c5eb027e1dd85c47a63a7df4ff1",
- "chars": 11343,
- "summary_state": "ready",
- "summary": "This script benchmarks the performance of an agent using two different approaches (COLD and GRAFT) to determine if providing pre-computed context saves tokens during code exploration.",
- "crux": {
- "code": " console.log(\"→ generating graft pack (graft ask --source)…\");\n const { pack, ms: graftMs } = graftPack();\n const packTokEst = Math.round(pack.length / 4); // rough: ~4 chars/token\n console.log(` pack: ${pack.length} chars (~${packTokEst} tok), produced in ${graftMs}ms ($0, local)\\n`);\n\n console.log(\"→ running COLD arm (agent explores the repo itself)…\");\n const cold = await runAgent(\"COLD\", null);\n console.log(` done in ${cold.ms}ms, ${cold.llmCalls} LLM calls\\n`);\n\n console.log(\"→ running GRAFT arm (agent handed the pack up front)…\");\n const graft = await runAgent(\"GRAFT\", pack);\n console.log(` done in ${graft.ms}ms, ${graft.llmCalls} LLM calls\\n`);",
- "span": "L238-L249"
- }
- },
- {
- "id": "bench/token-ab.ts#cost",
- "name": "cost",
- "kind": "function",
- "path": "bench/token-ab.ts",
- "span": "L223-L227",
- "signature": "function cost(m: Metrics): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "f59a853dd420d918b63ac37c796298e8049f644b1c500928290d0fa095245818",
- "summary_state": "ready",
- "summary": "Calculates the estimated cost of the agent's operations based on token usage and pricing configuration.",
- "crux": {
- "code": "function cost(m: Metrics): string {\n if (!CONFIG.PRICE_IN_PER_M && !CONFIG.PRICE_OUT_PER_M) return \"—\";\n const c = (m.promptTokens / 1e6) * CONFIG.PRICE_IN_PER_M + (m.completionTokens / 1e6) * CONFIG.PRICE_OUT_PER_M;\n return \"$\" + c.toFixed(4);\n}",
- "span": "L223-L227"
- }
- },
- {
- "id": "bench/token-ab.ts#graftPack",
- "name": "graftPack",
- "kind": "function",
- "path": "bench/token-ab.ts",
- "span": "L210-L221",
- "signature": "function graftPack(): { pack: string; ms: number }",
- "exported": false,
- "origin": "ast",
- "body_hash": "89a547d4352e3d9dbdb8c04f2a91fc04be812e2a0eb44165ee58e2df0f5f4bdf",
- "summary_state": "ready",
- "summary": "Generates a context pack using the graft tool to provide pre-computed information for the agent.",
- "crux": {
- "code": "function graftPack(): { pack: string; ms: number } {\n const t0 = Date.now();\n if (!existsSync(resolve(CONFIG.REPO, \"graft\"))) {\n console.error(`✗ no graft/ index in ${CONFIG.REPO}. Run: cd ${CONFIG.REPO} && graft build`);\n process.exit(1);\n }\n const pack = execFileSync(\"graft\", [\"ask\", CONFIG.QUESTION, CONFIG.REPO, \"--source\"], {\n encoding: \"utf8\",\n maxBuffer: 16 << 20,\n });\n return { pack, ms: Date.now() - t0 };",
- "span": "L210-L220"
- }
- },
- {
- "id": "bench/token-ab.ts#main",
- "name": "main",
- "kind": "function",
- "path": "bench/token-ab.ts",
- "span": "L233-L273",
- "signature": "async function main()",
- "exported": false,
- "origin": "ast",
- "body_hash": "7e15d43e2c0c022b333db8c2727e7eb184209faff2799a4e8f381a8840072c70",
- "summary_state": "ready",
- "summary": "Coordinates the overall execution of the A/B test, including generating the graft pack and running both agent arms.",
- "crux": {
- "code": "async function main() {\n console.log(`\\nREPO: ${CONFIG.REPO}`);\n console.log(`MODEL: ${CONFIG.MODEL}`);\n console.log(`QUESTION: ${CONFIG.QUESTION.slice(0, 100)}…\\n`);\n\n console.log(\"→ generating graft pack (graft ask --source)…\");\n const { pack, ms: graftMs } = graftPack();\n const packTokEst = Math.round(pack.length / 4); // rough: ~4 chars/token\n console.log(` pack: ${pack.length} chars (~${packTokEst} tok), produced in ${graftMs}ms ($0, local)\\n`);\n\n console.log(\"→ running COLD arm (agent explores the repo itself)…\");\n const cold = await runAgent(\"COLD\", null);",
- "span": "L233-L244"
- }
- },
- {
- "id": "bench/token-ab.ts#main.pct",
- "name": "pct",
- "kind": "function",
- "path": "bench/token-ab.ts",
- "span": "L253-L253",
- "signature": "pct = (a: number, b: number)",
- "exported": false,
- "origin": "ast",
- "body_hash": "a696c500df6bf30f9d1c99fa5c77b12fd6b41d1441dcea77cb160f1ce867e1d3",
- "summary_state": "ready",
- "summary": "Calculates the percentage improvement in token usage between the COLD and GRAFT arms.",
- "crux": {
- "code": " const pct = (a: number, b: number) => (a === 0 ? \"—\" : `${Math.round((1 - b / a) * 100)}%`);",
- "span": "L253-L253"
- }
- },
- {
- "id": "bench/token-ab.ts#Metrics",
- "name": "Metrics",
- "kind": "interface",
- "path": "bench/token-ab.ts",
- "span": "L55-L64",
- "signature": "interface Metrics",
- "exported": false,
- "origin": "ast",
- "body_hash": "4987dcdcf1ce8f9588ca811ca9c4c77d37368a043e39415784c9fde7dcff35d9",
- "summary_state": "ready",
- "summary": "Defines the structure for capturing metrics related to the A/B testing of the agent's performance.",
- "crux": {
- "code": "interface Metrics {\n arm: string;\n llmCalls: number;\n promptTokens: number;\n completionTokens: number;\n toolCalls: number;\n filesRead: Set<string>;\n ms: number;\n answer: string;\n}",
- "span": "L55-L64"
- }
- },
- {
- "id": "bench/token-ab.ts#row",
- "name": "row",
- "kind": "function",
- "path": "bench/token-ab.ts",
- "span": "L229-L231",
- "signature": "function row(label: string, a: string | number, b: string | number): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "b30daa5cdce52d4742bfca9c507fa0e60e335fdf6b67081f373a7e45f29ca92f",
- "summary_state": "ready",
- "summary": "Formats a row of metrics for display in the output table comparing the COLD and GRAFT arms.",
- "crux": {
- "code": "function row(label: string, a: string | number, b: string | number): string {\n return `${label.padEnd(22)} ${String(a).padStart(14)} ${String(b).padStart(14)}`;\n}",
- "span": "L229-L231"
- }
- },
- {
- "id": "bench/token-ab.ts#runAgent",
- "name": "runAgent",
- "kind": "function",
- "path": "bench/token-ab.ts",
- "span": "L150-L207",
- "signature": "async function runAgent(arm: string, extraContext: string | null): Promise<Metrics>",
- "exported": false,
- "origin": "ast",
- "body_hash": "10a292dc1b6275704d3e2409727df72702970ae7296002f153f2157ba1fe85a8",
- "summary_state": "ready",
- "summary": "Manages the agent's execution loop, handling user queries and tool calls while tracking performance metrics.",
- "crux": {
- "code": "async function runAgent(arm: string, extraContext: string | null): Promise<Metrics> {\n const m: Metrics = {\n arm, llmCalls: 0, promptTokens: 0, completionTokens: 0, toolCalls: 0,\n filesRead: new Set(), ms: 0, answer: \"\",\n };\n const t0 = Date.now();\n\n const userParts = [`QUESTION:\\n${CONFIG.QUESTION}`];\n if (extraContext) {\n userParts.push(\n \"\\nYou have been given a pre-computed context pack from a code-graph tool below. \" +\n \"Prefer it; only use the search/read_file tools if it is genuinely insufficient.\\n\\n\" +",
- "span": "L150-L161"
- }
- },
- {
- "id": "bench/token-ab.ts#runRead",
- "name": "runRead",
- "kind": "function",
- "path": "bench/token-ab.ts",
- "span": "L130-L147",
- "signature": "function runRead(path: string, start?: number, end?: number): { text: string; resolved: string }",
- "exported": false,
- "origin": "ast",
- "body_hash": "79923e547c1f135e88cdda255eeffeb2faa75a5fc81be8703694c8eb45a090af",
- "summary_state": "ready",
- "summary": "Reads a specified source file or a range of lines from it, ensuring it is within the repository's bounds.",
- "crux": {
- "code": "function runRead(path: string, start?: number, end?: number): { text: string; resolved: string } {\n const abs = isAbsolute(path) ? resolve(path) : resolve(CONFIG.REPO, path);\n const rel = relative(CONFIG.REPO, abs);\n if (rel.startsWith(\"..\") || isAbsolute(rel)) return { text: `(refused: ${path} is outside the repo)`, resolved: rel };\n if (!existsSync(abs)) return { text: `(not found: ${rel})`, resolved: rel };\n let content = readFileSync(abs, \"utf8\");\n const allLines = content.split(\"\\n\");\n let lines = allLines;\n if (start || end) {\n const s = Math.max(1, start ?? 1);\n const e = Math.min(allLines.length, end ?? allLines.length);\n lines = allLines.slice(s - 1, e).map((l, i) => `${s + i}\\t${l}`);",
- "span": "L130-L141"
- }
- },
- {
- "id": "bench/token-ab.ts#runSearch",
- "name": "runSearch",
- "kind": "function",
- "path": "bench/token-ab.ts",
- "span": "L98-L128",
- "signature": "function runSearch(pattern: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "52208dc37e9ca679f7d182cfbb80de09e29cc2aa62bd0128bcd7c7c72c6747ea",
- "summary_state": "ready",
- "summary": "Executes a regex search across the repository to find relevant code snippets based on a given pattern.",
- "crux": {
- "code": " const args = [\n \"--no-heading\", \"-n\", \"-S\", \"--max-count\", \"40\",\n \"-g\", \"*.ts\", \"-g\", \"*.tsx\", \"-g\", \"!node_modules\",\n pattern, CONFIG.REPO,\n ];\n let out = \"\";\n try {\n out = execFileSync(\"rg\", args, { encoding: \"utf8\", maxBuffer: 8 << 20 });\n } catch (e: any) {\n // rg exits 1 on \"no matches\"; also handle rg-not-installed by falling back to grep.\n if (e?.code === \"ENOENT\") {\n try {",
- "span": "L99-L110"
- }
- },
- {
- "id": "scripts/build-viewer.mjs",
- "name": "build-viewer.mjs",
- "kind": "file",
- "path": "scripts/build-viewer.mjs",
- "span": "L1-L29",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "fb4ba16d7815dbdbaf2fd818362f914671903132be5573fbdd9a7734549b833d",
- "chars": 879,
- "summary_state": "ready",
- "summary": "This script automates the bundling of the viewer application and its static assets for deployment.",
- "crux": {
- "code": "await build({\n entryPoints: [join(root, \"viewer\", \"main.ts\")],\n bundle: true,\n minify: true,\n format: \"esm\",\n target: \"es2022\",\n outfile: join(outDir, \"app.js\"),\n});",
- "span": "L15-L22"
- }
- },
- {
- "id": "scripts/postinstall.mjs",
- "name": "postinstall.mjs",
- "kind": "file",
- "path": "scripts/postinstall.mjs",
- "span": "L1-L12",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "2836cb69bc03453bc22abcae91d58de0a06881ee7f975fe86967aedf5d2d6188",
- "chars": 529,
- "summary_state": "ready",
- "summary": "This script provides a non-intrusive notification after installation, ensuring the install process is not interrupted by errors.",
- "crux": {
- "code": " console.log('\\n Graft installed. Run `npx graft init` to enable the Claude Code integration (statusline + hooks + auto-sync).\\n');",
- "span": "L8-L8"
- }
- },
- {
- "id": "src/ai/crux.ts",
- "name": "crux.ts",
- "kind": "file",
- "path": "src/ai/crux.ts",
- "span": "L1-L141",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "81323b622400aadae1fd584ea09c2016ccf1bf4f14654b648ee50b1b13bd4c68",
- "chars": 5437,
- "summary_state": "ready",
- "summary": "This file defines a system for summarizing code definitions to aid engineers in navigating a codebase.",
- "crux": {
- "code": "const SYSTEM_PROMPT = `You explain code definitions for a code graph that helps engineers navigate a codebase.\n\nYou are given ONE source file with 1-based line numbers, and a list of TARGET definitions in it. For every target, record its purpose and the line range of its core logic via the record_symbols tool.\n\nRules:\n- Emit exactly one entry per target id given, using that id verbatim.\n- summary: ONE sentence — what the symbol is FOR at the business-logic level. Say what problem it solves or rule it enforces, not what its signature already says.\n- crux_start / crux_end: FILE line numbers (as shown), inside that symbol's own line range. Pick the SINGLE most important contiguous span — the core branch, formula, guard, or state change. Keep it TIGHT: at most ~8 lines, and NEVER the whole function. If you can't narrow it below that, the symbol has no distinct crux — use 0/0.\n- Skip boilerplate, logging, and plumbing. If a symbol has no meaningful crux (trivial getter, data holder, one-line delegation, or logic spread evenly with no focal point), use \"crux_start\": 0 and \"crux_end\": 0.`;\n\nconst RECORD_TOOL = \"record_symbols\";",
- "span": "L46-L56"
- }
- },
- {
- "id": "src/ai/crux.ts#ChatCruxSummarizer",
- "name": "ChatCruxSummarizer",
- "kind": "class",
- "path": "src/ai/crux.ts",
- "span": "L117-L140",
- "signature": "class ChatCruxSummarizer implements CruxSummarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "322c43e3735b8c1d84abf6b6e0595a71115f667b6081967f25944d639d8ada41",
- "summary_state": "ready",
- "summary": "Implements a summarizer that utilizes a ChatModel to describe code definitions and their purposes in a file.",
- "crux": {
- "code": " async describeFile(input: FileCruxInput): Promise<NodeCrux[]> {\n if (input.nodes.length === 0) return [];\n const res = await this.model.create({\n temperature: 0,\n maxTokens: 8192,\n tools: [\n {\n name: RECORD_TOOL,\n description: \"Record each target definition's purpose and crux line range.\",\n parameters: SYMBOLS_SCHEMA as unknown as Record<string, unknown>,\n },\n ],",
- "span": "L120-L131"
- }
- },
- {
- "id": "src/ai/crux.ts#ChatCruxSummarizer.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "src/ai/crux.ts",
- "span": "L118-L118",
- "signature": "constructor(private model: ChatModel)",
- "exported": true,
- "origin": "ast",
- "body_hash": "01e4b6b8ac3b764e704374f04305b7acdbdfdbf0302ee7b56376849f61358ddb",
- "summary_state": "ready",
- "summary": "Initializes the ChatCruxSummarizer with a specific ChatModel instance for generating summaries.",
- "crux": {
- "code": " constructor(private model: ChatModel) {}",
- "span": "L118-L118"
- }
- },
- {
- "id": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
- "name": "describeFile",
- "kind": "method",
- "path": "src/ai/crux.ts",
- "span": "L120-L139",
- "signature": "async describeFile(input: FileCruxInput): Promise<NodeCrux[]>",
- "exported": true,
- "origin": "ast",
- "body_hash": "de411bd9d9bd6ad2f065084e2d259b91ae24a9adc01662fa30ef1c6a95cba148",
- "summary_state": "ready",
- "summary": "Processes a file input to generate summaries of its target definitions using the ChatModel.",
- "crux": {
- "code": " if (input.nodes.length === 0) return [];\n const res = await this.model.create({\n temperature: 0,\n maxTokens: 8192,\n tools: [\n {\n name: RECORD_TOOL,\n description: \"Record each target definition's purpose and crux line range.\",\n parameters: SYMBOLS_SCHEMA as unknown as Record<string, unknown>,\n },\n ],\n responseFormat: { kind: \"tool\", name: RECORD_TOOL },",
- "span": "L121-L132"
- }
- },
- {
- "id": "src/ai/crux.ts#CruxSummarizer",
- "name": "CruxSummarizer",
- "kind": "interface",
- "path": "src/ai/crux.ts",
- "span": "L42-L44",
- "signature": "interface CruxSummarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "03333336a2e057667a15b39364d3ba6f09ea739b8c1a35c4b3dfdd71c6f5d4d9",
- "summary_state": "ready",
- "summary": "Interface for summarizing code definitions from a file.",
- "crux": {
- "code": "export interface CruxSummarizer {\n describeFile(input: FileCruxInput): Promise<NodeCrux[]>;\n}",
- "span": "L42-L44"
- }
- },
- {
- "id": "src/ai/crux.ts#FileCruxInput",
- "name": "FileCruxInput",
- "kind": "interface",
- "path": "src/ai/crux.ts",
- "span": "L29-L33",
- "signature": "interface FileCruxInput",
- "exported": true,
- "origin": "ast",
- "body_hash": "5216f1ff3c8ce99cfac0130265f5b9597634df473889050b2af1e193c545ebab",
- "summary_state": "ready",
- "summary": "Encapsulates the input data required for summarizing a file's code definitions.",
- "crux": {
- "code": "export interface FileCruxInput {\n path: string;\n source: string;\n nodes: NodeRef[];\n}",
- "span": "L29-L33"
- }
- },
- {
- "id": "src/ai/crux.ts#NodeCrux",
- "name": "NodeCrux",
- "kind": "interface",
- "path": "src/ai/crux.ts",
- "span": "L35-L40",
- "signature": "interface NodeCrux",
- "exported": true,
- "origin": "ast",
- "body_hash": "df4fb16fefdd35c322e1af2e13c09a9afff91dbd0e96584daaec163aa147c1cd",
- "summary_state": "ready",
- "summary": "Represents the summarized information for a code definition in the file.",
- "crux": {
- "code": "export interface NodeCrux {\n id: string;\n summary: string;\n crux_start: number; // file line, within the symbol's span; 0 = no distinct crux\n crux_end: number;\n}",
- "span": "L35-L40"
- }
- },
- {
- "id": "src/ai/crux.ts#NodeRef",
- "name": "NodeRef",
- "kind": "interface",
- "path": "src/ai/crux.ts",
- "span": "L21-L27",
- "signature": "interface NodeRef",
- "exported": true,
- "origin": "ast",
- "body_hash": "5c9fb969ad7415cf5ba23dfaa412ca015165fe5f8ef98d626b780facc4f6492f",
- "summary_state": "ready",
- "summary": "Defines the structure for referencing a node in the code graph.",
- "crux": {
- "code": "export interface NodeRef {\n id: string;\n kind: Kind;\n signature: string | null;\n startLine: number; // 1-based file line where the definition starts\n endLine: number;\n}",
- "span": "L21-L27"
- }
- },
- {
- "id": "src/ai/crux.ts#numberLines",
- "name": "numberLines",
- "kind": "function",
- "path": "src/ai/crux.ts",
- "span": "L81-L88",
- "signature": "function numberLines(source: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "a80ad2a4410262e8c7ff4a8827e3c2f29bf357defa21d228d71b8d278b09acce",
- "summary_state": "ready",
- "summary": "Formats the source code into a numbered string for better readability.",
- "crux": {
- "code": "function numberLines(source: string): string {\n const clipped =\n source.length > MAX_CODE_CHARS ? `${source.slice(0, MAX_CODE_CHARS)}\\n… (truncated)` : source;\n return clipped\n .split(\"\\n\")\n .map((line, i) => `${i + 1}\\t${line}`)\n .join(\"\\n\");\n}",
- "span": "L63-L70"
- }
- },
- {
- "id": "src/ai/crux.ts#parseResults",
- "name": "parseResults",
- "kind": "function",
- "path": "src/ai/crux.ts",
- "span": "L102-L114",
- "signature": "function parseResults(obj: { symbols?: unknown } | undefined): NodeCrux[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "2e56a71c55e7d782e45421811cd9f7efbfcfea990d623f5595e0d2a79b8e41a2",
- "summary_state": "ready",
- "summary": "Transforms the tool's parsed argument object into a structured list of NodeCrux objects for further processing.",
- "crux": {
- "code": " .map((s) => s as Record<string, unknown>)\n .filter((s) => typeof s.id === \"string\")\n .map((s) => ({\n id: s.id as string,\n summary: typeof s.summary === \"string\" ? s.summary.trim() : \"\",\n crux_start: num(s.crux_start),\n crux_end: num(s.crux_end),",
- "span": "L106-L112"
- }
- },
- {
- "id": "src/ai/crux.ts#parseResults.num",
- "name": "num",
- "kind": "function",
- "path": "src/ai/crux.ts",
- "span": "L104-L104",
- "signature": "num = (v: unknown)",
- "exported": false,
- "origin": "ast",
- "body_hash": "63e8d8e280862f40666698b44f9fb1b4ca58c1712ed8c1f3266c59b683c83471",
- "summary_state": "ready",
- "summary": "This function converts a potentially non-finite number to a finite integer or zero, ensuring valid numerical output.",
- "crux": {
- "code": " const num = (v: unknown) => (typeof v === \"number\" && Number.isFinite(v) ? Math.trunc(v) : 0);",
- "span": "L88-L88"
- }
- },
- {
- "id": "src/ai/crux.ts#userContent",
- "name": "userContent",
- "kind": "function",
- "path": "src/ai/crux.ts",
- "span": "L90-L99",
- "signature": "function userContent(input: FileCruxInput): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c69c7e7741d7da1191a463b960489184527e8d4e0deae84306011fae6469159e",
- "summary_state": "ready",
- "summary": "Constructs a user content string that includes file details and target nodes.",
- "crux": {
- "code": "function userContent(input: FileCruxInput): string {\n const targets = input.nodes\n .map(\n (n) =>\n `- id=${n.id} | ${n.kind} | lines L${n.startLine}-L${n.endLine}` +\n (n.signature ? ` | ${n.signature}` : \"\"),\n )\n .join(\"\\n\");\n return `FILE: ${input.path}\\n\\n${numberLines(input.source)}\\n\\nTARGETS:\\n${targets}`;\n}",
- "span": "L72-L81"
- }
- },
- {
- "id": "src/ai/llm/anthropic.ts",
- "name": "anthropic.ts",
- "kind": "file",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L1-L156",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "db2b6db5102af2045a3f85933faeac8ef9b0c17bc2fcbfd3b41629622bb9551b",
- "chars": 6162,
- "summary_state": "ready",
- "summary": "This module provides an adapter for the Anthropic Messages API, enabling seamless integration of Claude as a first-class AI provider while handling specific API differences.",
- "crux": {
- "code": " async create(req: ChatRequest): Promise<ChatResponse> {\n const system: Anthropic.TextBlockParam[] = [];\n const messages: Anthropic.MessageParam[] = [];\n\n for (const m of req.messages) {\n if (m.role === \"system\") {\n system.push({ type: \"text\", text: m.content, ...cc(m.cacheBreakpoint) });\n } else if (m.role === \"user\") {\n messages.push({ role: \"user\", content: [{ type: \"text\", text: m.content, ...cc(m.cacheBreakpoint) }] });\n } else if (m.role === \"tool\") {\n // Tool results live in a user turn; coalesce consecutive results together.\n const block: Anthropic.ToolResultBlockParam = {",
- "span": "L47-L58"
- }
- },
- {
- "id": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "name": "AnthropicChatModel",
- "kind": "class",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L36-L141",
- "signature": "class AnthropicChatModel implements ChatModel",
- "exported": true,
- "origin": "ast",
- "body_hash": "df44498d6950b1274c70eeb84842639ad0f9d86f1cd2db47b42c9ab20483e8b8",
- "summary_state": "ready",
- "summary": "Implements the chat model interface for interacting with the Anthropic API, encapsulating the logic for message handling and API communication.",
- "crux": {
- "code": "export class AnthropicChatModel implements ChatModel {\n readonly label: string;\n private client: Anthropic;\n private model: string;\n\n constructor(opts: AnthropicChatModelOptions) {\n this.model = opts.model;\n this.label = opts.label ?? `${PROVIDER}:${opts.model}`;\n this.client = opts.client ?? new Anthropic({ apiKey: opts.apiKey, baseURL: opts.baseUrl });\n }\n\n async create(req: ChatRequest): Promise<ChatResponse> {",
- "span": "L36-L47"
- }
- },
- {
- "id": "src/ai/llm/anthropic.ts#AnthropicChatModel.assistantParam",
- "name": "assistantParam",
- "kind": "method",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L103-L111",
- "signature": "private assistantParam(m: Message): Anthropic.MessageParam",
- "exported": true,
- "origin": "ast",
- "body_hash": "d7b6ae0665be6a724f169b18327a7c03f54a374e128df7c8e491db4a6d5824a9",
- "summary_state": "ready",
- "summary": "Reconstructs the assistant's response from the original message blocks, preserving the context and structure of the conversation.",
- "crux": {
- "code": " private assistantParam(m: Message): Anthropic.MessageParam {\n if (m.providerRaw?.provider === PROVIDER) return m.providerRaw.raw as Anthropic.MessageParam;\n const content: Anthropic.ContentBlockParam[] = [];\n if (m.content) content.push({ type: \"text\", text: m.content });\n for (const tc of m.toolCalls ?? []) {\n content.push({ type: \"tool_use\", id: tc.id, name: tc.name, input: tc.args as Record<string, unknown> });\n }\n return { role: \"assistant\", content };\n }",
- "span": "L103-L111"
- }
- },
- {
- "id": "src/ai/llm/anthropic.ts#AnthropicChatModel.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L41-L45",
- "signature": "constructor(opts: AnthropicChatModelOptions)",
- "exported": true,
- "origin": "ast",
- "body_hash": "3e283d003830e60bd46c3f3e93e20715e03e65c67ffc8921a869bea7ec390025",
- "summary_state": "ready",
- "summary": "Initializes an instance of the AnthropicChatModel with the provided options, setting up the necessary API client and model details.",
- "crux": {
- "code": " constructor(opts: AnthropicChatModelOptions) {\n this.model = opts.model;\n this.label = opts.label ?? `${PROVIDER}:${opts.model}`;\n this.client = opts.client ?? new Anthropic({ apiKey: opts.apiKey, baseURL: opts.baseUrl });\n }",
- "span": "L41-L45"
- }
- },
- {
- "id": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "name": "create",
- "kind": "method",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L47-L100",
- "signature": "async create(req: ChatRequest): Promise<ChatResponse>",
- "exported": true,
- "origin": "ast",
- "body_hash": "8e00930f455ffe190513110bb5a79beba2b4f145be804594375781abf08f2d1f",
- "summary_state": "ready",
- "summary": "Handles the creation of chat messages by processing input requests and formatting them for the Anthropic API, ensuring compliance with API requirements.",
- "crux": {
- "code": " async create(req: ChatRequest): Promise<ChatResponse> {\n const system: Anthropic.TextBlockParam[] = [];\n const messages: Anthropic.MessageParam[] = [];\n\n for (const m of req.messages) {\n if (m.role === \"system\") {\n system.push({ type: \"text\", text: m.content, ...cc(m.cacheBreakpoint) });\n } else if (m.role === \"user\") {\n messages.push({ role: \"user\", content: [{ type: \"text\", text: m.content, ...cc(m.cacheBreakpoint) }] });\n } else if (m.role === \"tool\") {\n // Tool results live in a user turn; coalesce consecutive results together.\n const block: Anthropic.ToolResultBlockParam = {",
- "span": "L47-L58"
- }
- },
- {
- "id": "src/ai/llm/anthropic.ts#AnthropicChatModel.fromResponse",
- "name": "fromResponse",
- "kind": "method",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L113-L140",
- "signature": "private fromResponse(resp: Anthropic.Messages.Message, format: \"text\" | \"json\" | \"tool\"): ChatResponse",
- "exported": true,
- "origin": "ast",
- "body_hash": "2a223c595a5d2911bea9aa89f67baca06067110a28a6dc08b59bcc6c7eafb82b",
- "summary_state": "ready",
- "summary": "Transforms the API response into a structured ChatResponse object, extracting relevant information and maintaining the original message format.",
- "crux": {
- "code": " private fromResponse(resp: Anthropic.Messages.Message, format: \"text\" | \"json\" | \"tool\"): ChatResponse {\n let text = \"\";\n let toolCalls: ToolCall[] = [];\n for (const block of resp.content) {\n if (block.type === \"text\") text += block.text;\n else if (block.type === \"tool_use\") toolCalls.push({ id: block.id, name: block.name, args: block.input });\n }\n\n if (format === \"json\") {\n const jsonCall = toolCalls.find((c) => c.name === JSON_TOOL);\n if (jsonCall) text = JSON.stringify(jsonCall.args);\n toolCalls = toolCalls.filter((c) => c.name !== JSON_TOOL);",
- "span": "L113-L124"
- }
- },
- {
- "id": "src/ai/llm/anthropic.ts#AnthropicChatModelOptions",
- "name": "AnthropicChatModelOptions",
- "kind": "interface",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L24-L31",
- "signature": "interface AnthropicChatModelOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "b52d600691c002121647f5fa47c28559ef5ccbf0622946e02b71705e93734732",
- "summary_state": "ready",
- "summary": "Defines the configuration options required to instantiate an Anthropic chat model, ensuring necessary parameters are provided.",
- "crux": {
- "code": " apiKey: string;\n model: string;\n baseUrl?: string;\n label?: string;\n /** Inject a pre-built client (tests pass a stub; production omits it). */\n client?: Anthropic;\n}",
- "span": "L25-L31"
- }
- },
- {
- "id": "src/ai/llm/anthropic.ts#CacheControl",
- "name": "CacheControl",
- "kind": "type",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L33-L33",
- "signature": "type CacheControl = { cache_control: { type: \"ephemeral\" } } | Record<string, never>;",
- "exported": false,
- "origin": "ast",
- "body_hash": "6e3dd85fab0c1f395bb4e7b31d9c4352352f1c2ac7223b9c7ad2efeb2e633867",
- "summary_state": "ready",
- "summary": "Specifies the cache control settings for ephemeral data management in the chat model.",
- "crux": null
- },
- {
- "id": "src/ai/llm/anthropic.ts#cc",
- "name": "cc",
- "kind": "function",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L34-L34",
- "signature": "cc = (on: boolean | undefined): CacheControl",
- "exported": false,
- "origin": "ast",
- "body_hash": "13cf0b3c8efee32666046570936ac3683be97082f8d0b893e44b4488b18fd86d",
- "summary_state": "ready",
- "summary": "Creates a cache control object based on a boolean flag to manage ephemeral caching behavior.",
- "crux": {
- "code": "const cc = (on: boolean | undefined): CacheControl => (on ? { cache_control: { type: \"ephemeral\" } } : {});",
- "span": "L34-L34"
- }
- },
- {
- "id": "src/ai/llm/anthropic.ts#normalizeUsage",
- "name": "normalizeUsage",
- "kind": "function",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L148-L155",
- "signature": "function normalizeUsage(u: Anthropic.Usage): Usage",
- "exported": false,
- "origin": "ast",
- "body_hash": "5569d4f5086a9681eea0ef8083ef7d39cbca2319f0c62522a8f54e5766c2e2d3",
- "summary_state": "ready",
- "summary": "Normalizes the usage statistics from the Anthropic API response, providing a consistent structure for input and output token counts.",
- "crux": {
- "code": "function normalizeUsage(u: Anthropic.Usage): Usage {\n return {\n input: u.input_tokens ?? 0,\n output: u.output_tokens ?? 0,\n cacheRead: u.cache_read_input_tokens ?? 0,\n cacheCreate: u.cache_creation_input_tokens ?? 0,\n };\n}",
- "span": "L148-L155"
- }
- },
- {
- "id": "src/ai/llm/anthropic.ts#toAnthropicTool",
- "name": "toAnthropicTool",
- "kind": "function",
- "path": "src/ai/llm/anthropic.ts",
- "span": "L143-L145",
- "signature": "function toAnthropicTool(t: ToolSpec): Anthropic.Tool",
- "exported": false,
- "origin": "ast",
- "body_hash": "88a0375d055904d0ba42659ec152984a7d6bb3c46602c0d6d2a9802c75d9df77",
- "summary_state": "ready",
- "summary": "Converts a ToolSpec into the format required by the Anthropic API, facilitating the integration of tools into chat requests.",
- "crux": {
- "code": "function toAnthropicTool(t: ToolSpec): Anthropic.Tool {\n return { name: t.name, description: t.description, input_schema: t.parameters as Anthropic.Tool.InputSchema };\n}",
- "span": "L143-L145"
- }
- },
- {
- "id": "src/ai/llm/factory.ts",
- "name": "factory.ts",
- "kind": "file",
- "path": "src/ai/llm/factory.ts",
- "span": "L1-L40",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "d7d22f3b6af8380ff1073ddd6934eda35b3c6b95a1976223751136c0cd26122a",
- "chars": 1382,
- "summary_state": "ready",
- "summary": "Creates instances of ChatModel based on the specified provider configuration, enabling flexible integration with different chat model APIs.",
- "crux": {
- "code": " switch (cfg.provider) {\n case \"anthropic\":\n return new AnthropicChatModel({ apiKey: cfg.apiKey, model: cfg.model, baseUrl: cfg.baseUrl });\n case \"openai\":\n return new OpenAIChatModel({\n apiKey: cfg.apiKey,\n model: cfg.model,\n baseUrl: cfg.baseUrl,\n headers: cfg.headers,\n });\n default: {\n const _exhaustive: never = cfg.provider;",
- "span": "L24-L35"
- }
- },
- {
- "id": "src/ai/llm/factory.ts#ChatModelConfig",
- "name": "ChatModelConfig",
- "kind": "interface",
- "path": "src/ai/llm/factory.ts",
- "span": "L14-L21",
- "signature": "interface ChatModelConfig",
- "exported": true,
- "origin": "ast",
- "body_hash": "fe601294b311058cbc1f66a5c4d1612166ced8f3a0930b29840c7c58dbe8c26d",
- "summary_state": "ready",
- "summary": "Specifies the configuration required to create a chat model, enforcing necessary parameters for initialization.",
- "crux": null
- },
- {
- "id": "src/ai/llm/factory.ts#createChatModel",
- "name": "createChatModel",
- "kind": "function",
- "path": "src/ai/llm/factory.ts",
- "span": "L23-L39",
- "signature": "function createChatModel(cfg: ChatModelConfig): ChatModel",
- "exported": true,
- "origin": "ast",
- "body_hash": "23778c8e4e0f6b0151bdb1ab4a9f13cd454ba48471450592a7a39235868acfc3",
- "summary_state": "ready",
- "summary": "Creates an instance of a chat model based on the specified provider, handling different implementations accordingly.",
- "crux": {
- "code": " switch (cfg.provider) {\n case \"anthropic\":\n return new AnthropicChatModel({ apiKey: cfg.apiKey, model: cfg.model, baseUrl: cfg.baseUrl });\n case \"openai\":\n return new OpenAIChatModel({\n apiKey: cfg.apiKey,\n model: cfg.model,\n baseUrl: cfg.baseUrl,\n headers: cfg.headers,\n });\n default: {\n const _exhaustive: never = cfg.provider;",
- "span": "L24-L35"
- }
- },
- {
- "id": "src/ai/llm/factory.ts#ProviderKind",
- "name": "ProviderKind",
- "kind": "type",
- "path": "src/ai/llm/factory.ts",
- "span": "L12-L12",
- "signature": "type ProviderKind = \"openai\" | \"anthropic\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "0b615c32dce2df3c8f4ab12d84dec220c5dccf856284b414c95117583ac7046b",
- "summary_state": "ready",
- "summary": "Defines the types of providers for chat models, ensuring compatibility with specific APIs.",
- "crux": null
- },
- {
- "id": "src/ai/llm/openai.ts",
- "name": "openai.ts",
- "kind": "file",
- "path": "src/ai/llm/openai.ts",
- "span": "L1-L175",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "6cb2677125f9a2c8c617fb1aef072fad13b87413d5ec40bebf3e21e0acc784df",
- "chars": 6327,
- "summary_state": "ready",
- "summary": "This module provides an adapter for interacting with various OpenAI-compatible endpoints, allowing users to send chat requests and receive responses while managing caching and formatting options.",
- "crux": {
- "code": " async create(req: ChatRequest): Promise<ChatResponse> {\n const messages = req.messages.map(toChatMessage);\n const tools = req.tools ? req.tools.map(toChatTool) : undefined;\n const params: ChatParams = { model: this.model, messages };\n if (req.temperature !== undefined) params.temperature = req.temperature;\n if (req.maxTokens !== undefined) params.max_tokens = req.maxTokens;\n\n const fmt = req.responseFormat ?? { kind: \"text\" };\n if (fmt.kind === \"json\") {\n // Coerce JSON via a forced synthetic tool — the one structured-output\n // mechanism shared with Anthropic (no reliance on `response_format`).\n params.tools = [",
- "span": "L90-L101"
- }
- },
- {
- "id": "src/ai/llm/openai.ts#ChatMessage",
- "name": "ChatMessage",
- "kind": "type",
- "path": "src/ai/llm/openai.ts",
- "span": "L32-L32",
- "signature": "type ChatMessage = OpenAI.Chat.Completions.ChatCompletionMessageParam;",
- "exported": false,
- "origin": "ast",
- "body_hash": "ab4f41436d89ea9d719528cf8858881ddd7b5819bc1d35a581e53e5d054d4646",
- "summary_state": "ready",
- "summary": "Represents a message in the chat, encapsulating the role and content to facilitate communication between users and the AI.",
- "crux": null
- },
- {
- "id": "src/ai/llm/openai.ts#ChatParams",
- "name": "ChatParams",
- "kind": "type",
- "path": "src/ai/llm/openai.ts",
- "span": "L31-L31",
- "signature": "type ChatParams = OpenAI.Chat.Completions.ChatCompletionCreateParamsNonStreaming;",
- "exported": false,
- "origin": "ast",
- "body_hash": "589e332819f8569fb523921b364022d36270aa53171d43a774ac16343e5034cb",
- "summary_state": "ready",
- "summary": "Defines the parameters required for creating a chat completion request, ensuring the correct structure is used for API calls.",
- "crux": null
- },
- {
- "id": "src/ai/llm/openai.ts#normalizeUsage",
- "name": "normalizeUsage",
- "kind": "function",
- "path": "src/ai/llm/openai.ts",
- "span": "L165-L174",
- "signature": "function normalizeUsage(u: OpenAI.Completions.CompletionUsage | undefined): Usage",
- "exported": false,
- "origin": "ast",
- "body_hash": "387c663d9cb9b316e7cd3217c6f98f526fd750364e07ab75c7e455a320d59b4c",
- "summary_state": "ready",
- "summary": "Normalizes usage statistics by calculating uncached input tokens from the OpenAI API response.",
- "crux": {
- "code": "function normalizeUsage(u: OpenAI.Completions.CompletionUsage | undefined): Usage {\n const prompt = u?.prompt_tokens ?? 0;\n const cacheRead = u?.prompt_tokens_details?.cached_tokens ?? 0;\n return {\n input: Math.max(0, prompt - cacheRead),\n output: u?.completion_tokens ?? 0,\n cacheRead,\n cacheCreate: 0,\n };\n}",
- "span": "L165-L174"
- }
- },
- {
- "id": "src/ai/llm/openai.ts#OpenAIChatModel",
- "name": "OpenAIChatModel",
- "kind": "class",
- "path": "src/ai/llm/openai.ts",
- "span": "L73-L162",
- "signature": "class OpenAIChatModel implements ChatModel",
- "exported": true,
- "origin": "ast",
- "body_hash": "575a27dfb2cccd63e9a71e5d67db8d9e47bd57c55ed6327ea4420b9920545efb",
- "summary_state": "ready",
- "summary": "Implements the chat model interface for interacting with OpenAI's chat completions API.",
- "crux": {
- "code": "export class OpenAIChatModel implements ChatModel {\n readonly label: string;\n private client: OpenAI;\n private model: string;\n\n constructor(opts: OpenAIChatModelOptions) {\n this.model = opts.model;\n this.label = opts.label ?? `${PROVIDER}:${opts.model}`;\n this.client =\n opts.client ??\n new OpenAI({\n apiKey: opts.apiKey,",
- "span": "L73-L84"
- }
- },
- {
- "id": "src/ai/llm/openai.ts#OpenAIChatModel.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "src/ai/llm/openai.ts",
- "span": "L78-L88",
- "signature": "constructor(opts: OpenAIChatModelOptions)",
- "exported": true,
- "origin": "ast",
- "body_hash": "b179c8e67ab77c95de1b648919a4329b49a601dd5034aab043a60e6d38d555fc",
- "summary_state": "ready",
- "summary": "Initializes an OpenAIChatModel instance with the specified options, setting up the necessary API client and model parameters for chat interactions.",
- "crux": {
- "code": " constructor(opts: OpenAIChatModelOptions) {\n this.model = opts.model;\n this.label = opts.label ?? `${PROVIDER}:${opts.model}`;\n this.client =\n opts.client ??\n new OpenAI({\n apiKey: opts.apiKey,\n baseURL: opts.baseUrl,\n defaultHeaders: opts.headers,\n });\n }",
- "span": "L78-L88"
- }
- },
- {
- "id": "src/ai/llm/openai.ts#OpenAIChatModel.create",
- "name": "create",
- "kind": "method",
- "path": "src/ai/llm/openai.ts",
- "span": "L90-L115",
- "signature": "async create(req: ChatRequest): Promise<ChatResponse>",
- "exported": true,
- "origin": "ast",
- "body_hash": "1d9f5481b5c893aaf1e904960ce16909b066d969c4fd7ac507b8db1b2ba1ee63",
- "summary_state": "ready",
- "summary": "Creates a chat completion request to the OpenAI API using the provided messages and parameters.",
- "crux": {
- "code": " async create(req: ChatRequest): Promise<ChatResponse> {\n const messages = req.messages.map(toChatMessage);\n const tools = req.tools ? req.tools.map(toChatTool) : undefined;\n const params: ChatParams = { model: this.model, messages };\n if (req.temperature !== undefined) params.temperature = req.temperature;\n if (req.maxTokens !== undefined) params.max_tokens = req.maxTokens;\n\n const fmt = req.responseFormat ?? { kind: \"text\" };\n if (fmt.kind === \"json\") {\n // Coerce JSON via a forced synthetic tool — the one structured-output\n // mechanism shared with Anthropic (no reliance on `response_format`).\n params.tools = [",
- "span": "L90-L101"
- }
- },
- {
- "id": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
- "name": "fromResponse",
- "kind": "method",
- "path": "src/ai/llm/openai.ts",
- "span": "L117-L161",
- "signature": "private fromResponse( resp: OpenAI.Chat.Completions.ChatCompletion, format: \"text\" | \"json\" | \"tool\", ): ChatResponse",
- "exported": true,
- "origin": "ast",
- "body_hash": "bf540f6d0d4bc0d8c22bd5345e2765318f079d7e051b5f3462c35a0a26e0c0a9",
- "summary_state": "ready",
- "summary": "Processes the response from the OpenAI API to extract relevant chat information and tool calls.",
- "crux": {
- "code": " private fromResponse(\n resp: OpenAI.Chat.Completions.ChatCompletion,\n format: \"text\" | \"json\" | \"tool\",\n ): ChatResponse {\n const choice = resp.choices[0];\n const msg = choice?.message;\n const rawCalls = (msg?.tool_calls ?? []).filter(\n (c): c is OpenAI.Chat.Completions.ChatCompletionMessageToolCall & { type: \"function\" } =>\n c.type === \"function\",\n );\n const parse = (s: string): unknown => {\n try {",
- "span": "L117-L128"
- }
- },
- {
- "id": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse.parse",
- "name": "parse",
- "kind": "function",
- "path": "src/ai/llm/openai.ts",
- "span": "L127-L133",
- "signature": "parse = (s: string): unknown",
- "exported": true,
- "origin": "ast",
- "body_hash": "ebfdf3f91ed448d6e123ac7d414de409848181986b97987b04b61d38b6655af2",
- "summary_state": "ready",
- "summary": "Safely parses a JSON string into an object, handling errors to ensure robust processing of responses from the chat API.",
- "crux": {
- "code": " const parse = (s: string): unknown => {\n try {\n return JSON.parse(s || \"{}\");\n } catch {\n return {};\n }\n };",
- "span": "L127-L133"
- }
- },
- {
- "id": "src/ai/llm/openai.ts#OpenAIChatModelOptions",
- "name": "OpenAIChatModelOptions",
- "kind": "interface",
- "path": "src/ai/llm/openai.ts",
- "span": "L19-L29",
- "signature": "interface OpenAIChatModelOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "ff7f8380828dd929b11c662c999e0b7ce9c3260df3d4858b3fe7c0496687b299",
- "summary_state": "ready",
- "summary": "Defines the configuration options for the OpenAI chat model, including API key and model type.",
- "crux": {
- "code": "export interface OpenAIChatModelOptions {\n apiKey: string;\n model: string;\n baseUrl?: string;\n /** Stable manifest label; defaults to `openai:<model>`. */\n label?: string;\n /** Extra default headers (e.g. OpenRouter's `X-Title`). */\n headers?: Record<string, string>;\n /** Inject a pre-built client (tests pass a stub; production omits it). */\n client?: OpenAI;\n}",
- "span": "L19-L29"
- }
- },
- {
- "id": "src/ai/llm/openai.ts#textPart",
- "name": "textPart",
- "kind": "function",
- "path": "src/ai/llm/openai.ts",
- "span": "L35-L39",
- "signature": "function textPart(text: string, cache: boolean | undefined)",
- "exported": false,
- "origin": "ast",
- "body_hash": "10133cedc05270e0f828b1306d2a86ac0ae22a3e8fc92821831861ab3103d311",
- "summary_state": "ready",
- "summary": "Constructs a text message part with optional cache control for OpenRouter passthrough.",
- "crux": {
- "code": "function textPart(text: string, cache: boolean | undefined) {\n return cache\n ? [{ type: \"text\" as const, text, cache_control: { type: \"ephemeral\" as const } }]\n : text;\n}",
- "span": "L35-L39"
- }
- },
- {
- "id": "src/ai/llm/openai.ts#toChatMessage",
- "name": "toChatMessage",
- "kind": "function",
- "path": "src/ai/llm/openai.ts",
- "span": "L41-L67",
- "signature": "function toChatMessage(m: Message): ChatMessage",
- "exported": false,
- "origin": "ast",
- "body_hash": "b4eaa6383c6bdcf7b2380a4d1de0a485010eb5e5615d15e970a8c9391e4b48c3",
- "summary_state": "ready",
- "summary": "Transforms a message object into a format suitable for OpenAI's chat API, handling different roles appropriately.",
- "crux": {
- "code": "function toChatMessage(m: Message): ChatMessage {\n switch (m.role) {\n case \"system\":\n return { role: \"system\", content: textPart(m.content, m.cacheBreakpoint) } as ChatMessage;\n case \"user\":\n return { role: \"user\", content: textPart(m.content, m.cacheBreakpoint) } as ChatMessage;\n case \"tool\":\n return {\n role: \"tool\",\n tool_call_id: m.toolCallId ?? \"\",\n content: textPart(m.content, m.cacheBreakpoint),\n } as ChatMessage;",
- "span": "L41-L52"
- }
- },
- {
- "id": "src/ai/llm/openai.ts#toChatTool",
- "name": "toChatTool",
- "kind": "function",
- "path": "src/ai/llm/openai.ts",
- "span": "L69-L71",
- "signature": "function toChatTool(t: ToolSpec): OpenAI.Chat.Completions.ChatCompletionTool",
- "exported": false,
- "origin": "ast",
- "body_hash": "9bcc919fc8a9b8a5892850e10957c57a1bb03ec575eb982ed9137ddc14f7553e",
- "summary_state": "ready",
- "summary": "Converts a tool specification into a format compatible with OpenAI's chat completion API, enabling the use of external tools in chat interactions.",
- "crux": {
- "code": "function toChatTool(t: ToolSpec): OpenAI.Chat.Completions.ChatCompletionTool {\n return { type: \"function\", function: { name: t.name, description: t.description, parameters: t.parameters } };\n}",
- "span": "L69-L71"
- }
- },
- {
- "id": "src/ai/llm/types.ts",
- "name": "types.ts",
- "kind": "file",
- "path": "src/ai/llm/types.ts",
- "span": "L1-L114",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "8cb0f2a715498ae396ca2f5d6f14711be026346b218e07da0b30909d3cd93c93",
- "chars": 4254,
- "summary_state": "ready",
- "summary": "Defines interfaces and types for a provider-neutral chat transport system that facilitates communication with various language model providers.",
- "crux": {
- "code": "/** A single tool invocation requested by the model. `args` is ALREADY parsed. */\nexport interface ToolCall {\n id: string;\n name: string;\n /** Parsed argument object. Adapters (de)serialize to their wire format. */\n args: unknown;\n}\n\n/** One turn in a conversation, in provider-neutral form. */\nexport interface Message {\n role: \"system\" | \"user\" | \"assistant\" | \"tool\";\n /** Plain-text content. Empty string when a turn is purely tool calls/results. */",
- "span": "L22-L33"
- }
- },
- {
- "id": "src/ai/llm/types.ts#ChatModel",
- "name": "ChatModel",
- "kind": "interface",
- "path": "src/ai/llm/types.ts",
- "span": "L110-L113",
- "signature": "interface ChatModel",
- "exported": true,
- "origin": "ast",
- "body_hash": "189599546411bb1a83083ef8871d3cd5c464e449532e11d3255d20ed5f1facdc",
- "summary_state": "ready",
- "summary": "Defines a connection to a specific model, providing a method to create chat requests and ensuring consistent interaction with the model.",
- "crux": {
- "code": "export interface ChatModel {\n readonly label: string;\n create(req: ChatRequest): Promise<ChatResponse>;\n}",
- "span": "L110-L113"
- }
- },
- {
- "id": "src/ai/llm/types.ts#ChatRequest",
- "name": "ChatRequest",
- "kind": "interface",
- "path": "src/ai/llm/types.ts",
- "span": "L85-L94",
- "signature": "interface ChatRequest",
- "exported": true,
- "origin": "ast",
- "body_hash": "cca0720f5c0bc885c0bebcd0df2faea83445f025bcca11a1e6109dc988136bb6",
- "summary_state": "ready",
- "summary": "Encapsulates a request to the chat model, including messages, tools, and response format, to standardize interactions with the model.",
- "crux": {
- "code": "export interface ChatRequest {\n messages: Message[];\n tools?: ToolSpec[];\n /** Default: `{ kind: \"text\" }`. */\n responseFormat?: ResponseFormat;\n /** Providers that reject it (current Anthropic models) drop it in the adapter. */\n temperature?: number;\n /** Max output tokens. Required by Anthropic; adapters supply a default. */\n maxTokens?: number;\n}",
- "span": "L85-L94"
- }
- },
- {
- "id": "src/ai/llm/types.ts#ChatResponse",
- "name": "ChatResponse",
- "kind": "interface",
- "path": "src/ai/llm/types.ts",
- "span": "L96-L104",
- "signature": "interface ChatResponse",
- "exported": true,
- "origin": "ast",
- "body_hash": "da777026c7875767ace42f299e1881a2d67780936c3392adc7cea722d09ead38",
- "summary_state": "ready",
- "summary": "Represents the response from the chat model, including the assistant's text, tool calls made, and usage statistics, to provide a complete interaction result.",
- "crux": {
- "code": "export interface ChatResponse {\n /** Concatenated assistant text (empty when the turn only made tool calls). */\n text: string;\n toolCalls: ToolCall[];\n usage: Usage;\n stopReason: string | null;\n /** The assistant turn as a neutral message — push straight back into `messages`. */\n assistant: Message;\n}",
- "span": "L96-L104"
- }
- },
- {
- "id": "src/ai/llm/types.ts#Message",
- "name": "Message",
- "kind": "interface",
- "path": "src/ai/llm/types.ts",
- "span": "L31-L52",
- "signature": "interface Message",
- "exported": true,
- "origin": "ast",
- "body_hash": "eaaa8e2638eeaa70f6260926f747620b01a6c2b9ff71c5233c1a49781e0d7287",
- "summary_state": "ready",
- "summary": "Defines a turn in a conversation, allowing for structured communication between users and the assistant, including tool calls and raw provider data.",
- "crux": {
- "code": " role: \"system\" | \"user\" | \"assistant\" | \"tool\";\n /** Plain-text content. Empty string when a turn is purely tool calls/results. */\n content: string;\n /** Assistant turns only: tool calls the model asked for. */\n toolCalls?: ToolCall[];\n /** Tool turns only: the id of the {@link ToolCall} this result answers. */\n toolCallId?: string;\n /**\n * Request a provider cache marker (`cache_control: ephemeral`) on THIS message.\n * The transport only understands this per-message flag; any sliding/rotation\n * policy lives in the caller (see the bench loop).\n */",
- "span": "L32-L43"
- }
- },
- {
- "id": "src/ai/llm/types.ts#ResponseFormat",
- "name": "ResponseFormat",
- "kind": "type",
- "path": "src/ai/llm/types.ts",
- "span": "L68-L71",
- "signature": "type ResponseFormat = | { kind: \"text\" } | { kind: \"json\" } | { kind: \"tool\"; name: string };",
- "exported": true,
- "origin": "ast",
- "body_hash": "61c1f5fab878eba0f3c1dbb15cf272277325c2ca7df4cf36f8986b18c8e673f3",
- "summary_state": "ready",
- "summary": "Specifies the format in which the model must respond, ensuring compatibility across different output types like text, JSON, or tool calls.",
- "crux": {
- "code": "export type ResponseFormat =\n | { kind: \"text\" }\n | { kind: \"json\" }\n | { kind: \"tool\"; name: string };",
- "span": "L68-L71"
- }
- },
- {
- "id": "src/ai/llm/types.ts#ToolCall",
- "name": "ToolCall",
- "kind": "interface",
- "path": "src/ai/llm/types.ts",
- "span": "L23-L28",
- "signature": "interface ToolCall",
- "exported": true,
- "origin": "ast",
- "body_hash": "1ee8861c6f11e6f2c3cd47a765496071720b09f760cda7f0c1c37bde07573913",
- "summary_state": "ready",
- "summary": "Represents a single invocation of a tool requested by the model, encapsulating its ID, name, and parsed arguments.",
- "crux": {
- "code": " id: string;\n name: string;\n /** Parsed argument object. Adapters (de)serialize to their wire format. */\n args: unknown;\n}",
- "span": "L24-L28"
- }
- },
- {
- "id": "src/ai/llm/types.ts#ToolSpec",
- "name": "ToolSpec",
- "kind": "interface",
- "path": "src/ai/llm/types.ts",
- "span": "L55-L59",
- "signature": "interface ToolSpec",
- "exported": true,
- "origin": "ast",
- "body_hash": "6e6b8c516b5772e7989411d4c8707ea5193e65d35b610bb7900579542eefd4d8",
- "summary_state": "ready",
- "summary": "Describes a tool that the model can call, including its name, description, and parameters, facilitating interaction with various tools.",
- "crux": {
- "code": "export interface ToolSpec {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}",
- "span": "L55-L59"
- }
- },
- {
- "id": "src/ai/llm/types.ts#Usage",
- "name": "Usage",
- "kind": "interface",
- "path": "src/ai/llm/types.ts",
- "span": "L78-L83",
- "signature": "interface Usage",
- "exported": true,
- "origin": "ast",
- "body_hash": "3ac3091408d0a87c468fed20e0867ecbd87f41a6cc83c92047c2dbc0281705b7",
- "summary_state": "ready",
- "summary": "Tracks token usage across providers, normalizing input and output counts to facilitate consistent accounting in multi-provider environments.",
- "crux": {
- "code": "export interface Usage {\n input: number;\n output: number;\n cacheRead: number;\n cacheCreate: number;\n}",
- "span": "L78-L83"
- }
- },
- {
- "id": "src/ai/providers.ts",
- "name": "providers.ts",
- "kind": "file",
- "path": "src/ai/providers.ts",
- "span": "L1-L107",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "ba27e2c6d98b088685946371971e9f82c7a54bba9eaa432d44881880274eb1d6",
- "chars": 3713,
- "summary_state": "ready",
- "summary": "This module provides configuration management for AI model providers, allowing users to specify settings and defaults for various AI services.",
- "crux": {
- "code": "export function resolveConfig(config: EngineConfig = {}): ResolvedConfig {\n const env = process.env;\n const provider = config.provider ?? (env.GRAFT_PROVIDER as ProviderKind | undefined) ?? DEFAULTS.provider;\n\n const explicitKey = config.apiKey ?? env.GRAFT_API_KEY;\n const legacyKey = env.OPENROUTER_API_KEY;\n const apiKey = explicitKey ?? legacyKey;\n const usedLegacyEnv = !explicitKey && !!legacyKey;\n\n const model =\n config.model ?? env.GRAFT_MODEL ?? env.GRAFT_OPENROUTER_MODEL ?? DEFAULT_MODELS[provider];\n",
- "span": "L71-L82"
- }
- },
- {
- "id": "src/ai/providers.ts#EngineConfig",
- "name": "EngineConfig",
- "kind": "interface",
- "path": "src/ai/providers.ts",
- "span": "L17-L39",
- "signature": "interface EngineConfig",
- "exported": true,
- "origin": "ast",
- "body_hash": "95b31c84d9d7b7ea444175d84695a3d2843e13e7eff34b43ca44d07b028caf3d",
- "summary_state": "ready",
- "summary": "Defines the configuration structure for the engine, allowing customization of various parameters for LLM operations.",
- "crux": {
- "code": "export interface EngineConfig {\n /** Where the graph lives. Env: GRAFT_DIR. Default: `<repo>/.context`. */\n contextDir?: string;\n\n /** Wire format / SDK. Env: GRAFT_PROVIDER. Default: `openai`. */\n provider?: ProviderKind;\n /** API key for the chosen provider. Env: GRAFT_API_KEY (legacy: OPENROUTER_API_KEY). */\n apiKey?: string;\n /** Model id. Env: GRAFT_MODEL. Provider-specific default. */\n model?: string;\n /** Base URL for OpenAI-compatible endpoints. Env: GRAFT_BASE_URL. */\n baseUrl?: string;",
- "span": "L17-L28"
- }
- },
- {
- "id": "src/ai/providers.ts#resolveConfig",
- "name": "resolveConfig",
- "kind": "function",
- "path": "src/ai/providers.ts",
- "span": "L71-L106",
- "signature": "function resolveConfig(config: EngineConfig = {}): ResolvedConfig",
- "exported": true,
- "origin": "ast",
- "body_hash": "117056d5880fd89b165cf3e7f29f4b07091927a10522000eeef02b5094487204",
- "summary_state": "ready",
- "summary": "Merges user-provided configuration with environment variables and defaults to produce a complete configuration object.",
- "crux": {
- "code": "export function resolveConfig(config: EngineConfig = {}): ResolvedConfig {\n const env = process.env;\n const provider = config.provider ?? (env.GRAFT_PROVIDER as ProviderKind | undefined) ?? DEFAULTS.provider;\n\n const explicitKey = config.apiKey ?? env.GRAFT_API_KEY;\n const legacyKey = env.OPENROUTER_API_KEY;\n const apiKey = explicitKey ?? legacyKey;\n const usedLegacyEnv = !explicitKey && !!legacyKey;\n\n const model =\n config.model ?? env.GRAFT_MODEL ?? env.GRAFT_OPENROUTER_MODEL ?? DEFAULT_MODELS[provider];\n",
- "span": "L71-L82"
- }
- },
- {
- "id": "src/ai/providers.ts#ResolvedConfig",
- "name": "ResolvedConfig",
- "kind": "interface",
- "path": "src/ai/providers.ts",
- "span": "L42-L55",
- "signature": "interface ResolvedConfig",
- "exported": true,
- "origin": "ast",
- "body_hash": "1a0d128beff62ecd8c534a4ec9497130a718a2c0bd221a0909be5aa2bb0dccd5",
- "summary_state": "ready",
- "summary": "Represents the fully resolved configuration after merging user settings with defaults and environment variables.",
- "crux": {
- "code": "export interface ResolvedConfig {\n contextDir?: string;\n provider: ProviderKind;\n apiKey?: string;\n model: string;\n baseUrl?: string;\n headers?: Record<string, string>;\n /** True when the key came from the deprecated OPENROUTER_* fallback. */\n usedLegacyEnv: boolean;\n chatModel?: ChatModel;\n synthesizer?: Synthesizer;\n summarizer?: Summarizer;",
- "span": "L42-L53"
- }
- },
- {
- "id": "src/ai/summarize.ts",
- "name": "summarize.ts",
- "kind": "file",
- "path": "src/ai/summarize.ts",
- "span": "L1-L52",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "8dbec8d421f079ec67c81701d28ed1eb648b64e074b338538d03b9063941cffd",
- "chars": 2216,
- "summary_state": "ready",
- "summary": "This file provides functionality to summarize source code files into concise prose for a knowledge graph, enhancing documentation and understanding of codebases.",
- "crux": {
- "code": "/**\n * Turns one source-code file into a short prose summary for the knowledge graph.\n *\n * Code repos are deliberately NOT fed through the per-chunk entity extractor:\n * static structure is better served by grep/tree-sitter in the consuming agent,\n * and LLM extraction over raw code produces noisy, duplicated entities. Instead\n * the repo ingest path summarizes each file into plain English (purpose, key\n * exports, dependencies, design decisions) and ingests those summaries — prose\n * the existing extraction pipeline is actually good at.",
- "span": "L3-L11"
- }
- },
- {
- "id": "src/ai/summarize.ts#ChatSummarizer",
- "name": "ChatSummarizer",
- "kind": "class",
- "path": "src/ai/summarize.ts",
- "span": "L37-L51",
- "signature": "class ChatSummarizer implements Summarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "707835ebd4bbe74cc6720d5b77187fe3dfb7dc02e9487e02aea6614b2f1b2616",
- "summary_state": "ready",
- "summary": "Provides a mechanism to summarize source code files into plain English for knowledge management.",
- "crux": {
- "code": " async summarize(code: string, opts: { path: string }): Promise<string> {\n const res = await this.model.create({\n temperature: 0,\n maxTokens: 2048,\n messages: [\n { role: \"system\", content: SYSTEM_PROMPT },\n { role: \"user\", content: userContent(code, opts.path) },\n ],\n });\n return res.text.trim();\n }",
- "span": "L40-L50"
- }
- },
- {
- "id": "src/ai/summarize.ts#ChatSummarizer.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "src/ai/summarize.ts",
- "span": "L38-L38",
- "signature": "constructor(private model: ChatModel)",
- "exported": true,
- "origin": "ast",
- "body_hash": "01e4b6b8ac3b764e704374f04305b7acdbdfdbf0302ee7b56376849f61358ddb",
- "summary_state": "ready",
- "summary": "Initializes the ChatSummarizer with a specific ChatModel for generating summaries.",
- "crux": null
- },
- {
- "id": "src/ai/summarize.ts#ChatSummarizer.summarize",
- "name": "summarize",
- "kind": "method",
- "path": "src/ai/summarize.ts",
- "span": "L40-L50",
- "signature": "async summarize(code: string, opts: { path: string }): Promise<string>",
- "exported": true,
- "origin": "ast",
- "body_hash": "248e1cc89ec3a53071dcda5ec005a28b9d698f73af74d4be1d356e0c86334a28",
- "summary_state": "ready",
- "summary": "Generates a summary of the provided source code using the specified ChatModel.",
- "crux": {
- "code": " const res = await this.model.create({\n temperature: 0,\n maxTokens: 2048,\n messages: [\n { role: \"system\", content: SYSTEM_PROMPT },\n { role: \"user\", content: userContent(code, opts.path) },\n ],\n });\n return res.text.trim();",
- "span": "L41-L49"
- }
- },
- {
- "id": "src/ai/summarize.ts#Summarizer",
- "name": "Summarizer",
- "kind": "interface",
- "path": "src/ai/summarize.ts",
- "span": "L13-L15",
- "signature": "interface Summarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "53141087f1297119f32328d09c2f9289dcb09ab0ca3d9ac4b066be98e868166e",
- "summary_state": "ready",
- "summary": "The Summarizer interface defines a contract for summarizing source code files.",
- "crux": null
- },
- {
- "id": "src/ai/summarize.ts#userContent",
- "name": "userContent",
- "kind": "function",
- "path": "src/ai/summarize.ts",
- "span": "L28-L34",
- "signature": "function userContent(code: string, path: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "96aac9962d6811777880bc7062fa497e9cc46e103b7c4620c2d84eaf7d8e4ba2",
- "summary_state": "ready",
- "summary": "The userContent function formats the source code and its path into a structured string for summarization.",
- "crux": {
- "code": " code.length > MAX_CODE_CHARS\n ? `${code.slice(0, MAX_CODE_CHARS)}\\n… (truncated at ${MAX_CODE_CHARS} characters)`\n : code;\n return `File: ${path}\\n\\n${clipped}`;",
- "span": "L30-L33"
- }
- },
- {
- "id": "src/ai/synthesize.ts",
- "name": "synthesize.ts",
- "kind": "file",
- "path": "src/ai/synthesize.ts",
- "span": "L1-L156",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "7c6124323d5112abb15f0adea21962e083ea38234a8771832a71a59350fdc362",
- "chars": 7354,
- "summary_state": "ready",
- "summary": "This file defines the architecture for synthesizing a graph of nodes from file summaries, enabling better understanding and navigation of a codebase.",
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#ChatSynthesizer",
- "name": "ChatSynthesizer",
- "kind": "class",
- "path": "src/ai/synthesize.ts",
- "span": "L128-L154",
- "signature": "class ChatSynthesizer implements Synthesizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "9e2ef8120d3ee1e281cf57ef553ac5ce7ff0768bf5c7b8bbb8bbcb3f91963db0",
- "summary_state": "ready",
- "summary": "The ChatSynthesizer class implements the Synthesizer interface to create a structured architecture graph using a chat model.",
- "crux": {
- "code": " async synthesize(files: FileSummary[]): Promise<SynthNode[]> {\n if (files.length === 0) return [];\n const res = await this.model.create({\n temperature: 0,\n maxTokens: 8192,\n tools: [\n {\n name: RECORD_TOOL,\n description: \"Record the curated architecture-graph nodes and their links.\",\n parameters: NODES_SCHEMA as unknown as Record<string, unknown>,\n },\n ],",
- "span": "L131-L142"
- }
- },
- {
- "id": "src/ai/synthesize.ts#ChatSynthesizer.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "src/ai/synthesize.ts",
- "span": "L129-L129",
- "signature": "constructor(private model: ChatModel)",
- "exported": true,
- "origin": "ast",
- "body_hash": "01e4b6b8ac3b764e704374f04305b7acdbdfdbf0302ee7b56376849f61358ddb",
- "summary_state": "ready",
- "summary": "The constructor initializes the ChatSynthesizer with a specific chat model for generating architecture graphs.",
- "crux": {
- "code": " constructor(private model: ChatModel) {}",
- "span": "L129-L129"
- }
- },
- {
- "id": "src/ai/synthesize.ts#ChatSynthesizer.synthesize",
- "name": "synthesize",
- "kind": "method",
- "path": "src/ai/synthesize.ts",
- "span": "L131-L153",
- "signature": "async synthesize(files: FileSummary[]): Promise<SynthNode[]>",
- "exported": true,
- "origin": "ast",
- "body_hash": "609f7bd1a76c0a6c725b29f63c9103244e87c9a9ff423d76dd739a8cc7329427",
- "summary_state": "ready",
- "summary": "The synthesize method processes file summaries to produce a curated set of SynthNode objects representing the architecture of the codebase.",
- "crux": {
- "code": " async synthesize(files: FileSummary[]): Promise<SynthNode[]> {\n if (files.length === 0) return [];\n const res = await this.model.create({\n temperature: 0,\n maxTokens: 8192,\n tools: [\n {\n name: RECORD_TOOL,\n description: \"Record the curated architecture-graph nodes and their links.\",\n parameters: NODES_SCHEMA as unknown as Record<string, unknown>,\n },\n ],",
- "span": "L131-L142"
- }
- },
- {
- "id": "src/ai/synthesize.ts#clean",
- "name": "clean",
- "kind": "function",
- "path": "src/ai/synthesize.ts",
- "span": "L101-L123",
- "signature": "function clean(nodes: unknown): SynthNode[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "2344d8c4c88dd2126c437bedfed4688859387f3303ae33aae9a056f42ff7bad8",
- "summary_state": "ready",
- "summary": "Normalizes and cleans a raw model response into a structured array of SynthNode objects.",
- "crux": {
- "code": " if (!Array.isArray(nodes)) return [];\n const out: SynthNode[] = [];\n for (const n of nodes as Array<Record<string, unknown>>) {\n if (!n || typeof n.name !== \"string\" || typeof n.type !== \"string\") continue;\n out.push({\n name: n.name,\n type: n.type,\n summary: typeof n.summary === \"string\" ? n.summary : \"\",\n sources: Array.isArray(n.sources) ? (n.sources as unknown[]).filter((s): s is string => typeof s === \"string\") : [],\n links: Array.isArray(n.links)\n ? (n.links as Array<Record<string, unknown>>)\n .filter((l) => l && typeof l.to === \"string\" && typeof l.relation === \"string\")",
- "span": "L101-L112"
- }
- },
- {
- "id": "src/ai/synthesize.ts#FileSummary",
- "name": "FileSummary",
- "kind": "interface",
- "path": "src/ai/synthesize.ts",
- "span": "L30-L33",
- "signature": "interface FileSummary",
- "exported": true,
- "origin": "ast",
- "body_hash": "4c10af76458e184f8d32e13ead75fdbba2b173af7e915f3b6378f895b64bacff",
- "summary_state": "ready",
- "summary": "Holds the summary information for a single file, including its path and a descriptive summary.",
- "crux": {
- "code": " path: string;\n summary: string;",
- "span": "L31-L32"
- }
- },
- {
- "id": "src/ai/synthesize.ts#Synthesizer",
- "name": "Synthesizer",
- "kind": "interface",
- "path": "src/ai/synthesize.ts",
- "span": "L35-L37",
- "signature": "interface Synthesizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "55ed4f6b07f808a7591164fad62527f00d6c042c12f5ff1445f29edaf2674d74",
- "summary_state": "ready",
- "summary": "Defines the interface for synthesizers that convert file summaries into structured nodes.",
- "crux": null
- },
- {
- "id": "src/ai/synthesize.ts#SynthLink",
- "name": "SynthLink",
- "kind": "interface",
- "path": "src/ai/synthesize.ts",
- "span": "L12-L16",
- "signature": "interface SynthLink",
- "exported": true,
- "origin": "ast",
- "body_hash": "0881e19e19cb63095252ce3b817cad3adb83241167ae37dfc274d245e3e9caac",
- "summary_state": "ready",
- "summary": "Defines the structure of a directed edge between nodes, specifying relationships in the synthesized graph.",
- "crux": {
- "code": " to: string;\n relation: string;\n description?: string;",
- "span": "L13-L15"
- }
- },
- {
- "id": "src/ai/synthesize.ts#SynthNode",
- "name": "SynthNode",
- "kind": "interface",
- "path": "src/ai/synthesize.ts",
- "span": "L19-L27",
- "signature": "interface SynthNode",
- "exported": true,
- "origin": "ast",
- "body_hash": "b53b2a25e45cfe4a931d93e2a908bafb4ea7d5fe1a02282a18af3f2010b14277",
- "summary_state": "ready",
- "summary": "Represents a node in the synthesized graph, encapsulating its name, type, summary, sources, and links to other nodes.",
- "crux": {
- "code": " name: string;\n /** system | api | file | concept */\n type: string;\n summary: string;\n /** Source file paths (from the provided set) this node is grounded in. */\n sources: string[];\n links: SynthLink[];",
- "span": "L20-L26"
- }
- },
- {
- "id": "src/ai/synthesize.ts#userContent",
- "name": "userContent",
- "kind": "function",
- "path": "src/ai/synthesize.ts",
- "span": "L93-L98",
- "signature": "function userContent(files: FileSummary[]): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "6873b0a9e5dedbebac883fdce991492dd5d2260990d1dd440dcaa60b1bb1c4e9",
- "summary_state": "ready",
- "summary": "Constructs a formatted string from an array of file summaries, ensuring it does not exceed a specified character limit.",
- "crux": {
- "code": " const body = files.map((f) => `## ${f.path}\\n\\n${f.summary}`).join(\"\\n\\n\");\n return body.length > MAX_INPUT_CHARS\n ? `${body.slice(0, MAX_INPUT_CHARS)}\\n… (truncated)`\n : body;",
- "span": "L93-L96"
- }
- },
- {
- "id": "src/ask/ask.ts",
- "name": "ask.ts",
- "kind": "file",
- "path": "src/ask/ask.ts",
- "span": "L1-L989",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "40233f975f0f2040fd7b0b40cfd01df9a45e6f671dd4ba1ba4533813c2ae3b8c",
- "chars": 47028,
- "summary_state": "stale",
- "summary": "This module provides a mechanism to process natural language queries and return structured results from a codebase, enhancing the ability to find relevant code snippets and their relationships.",
- "crux": {
- "code": "function structural(query: string, graph: GraphV1, limit: number): StructuralOutcome {\n const wantsIn = INCOMING.test(query);\n const wantsOut = OUTGOING.test(query);\n if (!wantsIn && !wantsOut) return null;\n\n const { nodes: subjects, tried } = findSubjectNodes(query, graph);\n if (subjects.length === 0) return { fallthroughNote: fallthroughNoteFor(tried) };\n\n const ids = new Set(subjects.map((n) => n.id));\n const byId = new Map(graph.nodes.map((n) => [n.id, n]));\n const outgoing = wantsOut && !wantsIn; // \"what does X call / import\" — else default to callers\n const rels = new Set(outgoing ? OUTGOING_RELS : INCOMING_RELS);",
- "span": "L230-L241"
- }
- },
- {
- "id": "src/ask/ask.ts#ask",
- "name": "ask",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L775-L820",
- "signature": "function ask(dir: string, query: string, opts: AskOptions = {}): AskResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "fe391f9d96cb8452f28b452ec4a4bd31a6ccb13a5b3f9f1aa928ffe9c6faf0ac",
- "summary_state": "stale",
- "summary": "Handles the main logic for processing a query against a directory, returning structured results based on the query type.",
- "crux": {
- "code": "export function ask(dir: string, query: string, opts: AskOptions = {}): AskResult {\n const root = resolve(dir);\n const outDir = contextDirFor(root, opts.contextDir);\n const limit = opts.limit ?? 8;\n const corpus = loadCorpus(outDir);\n const graphRank = opts.graphRank ?? true;\n\n let result: AskResult;\n if (corpus.graph) {\n const outcome = structural(query, corpus.graph, limit);\n if (outcome && \"result\" in outcome) {\n result = outcome.result;",
- "span": "L592-L603"
- }
- },
- {
- "id": "src/ask/ask.ts#AskHit",
- "name": "AskHit",
- "kind": "interface",
- "path": "src/ask/ask.ts",
- "span": "L29-L46",
- "signature": "interface AskHit",
- "exported": true,
- "origin": "ast",
- "body_hash": "1829b4fe0563b6d00e315d91b386adc901876283c19e54738ecad4be76e9239a",
- "summary_state": "stale",
- "summary": "Represents a hit in the query results, encapsulating details about a code symbol and its context.",
- "crux": null
- },
- {
- "id": "src/ask/ask.ts#AskOptions",
- "name": "AskOptions",
- "kind": "interface",
- "path": "src/ask/ask.ts",
- "span": "L678-L700",
- "signature": "interface AskOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "352459201a57364217b351980b179879cb37170119f6953bfcc3b3cc19f01c92",
- "summary_state": "stale",
- "summary": "Defines the options available for configuring the ask function, allowing customization of its behavior.",
- "crux": {
- "code": "export interface AskOptions {\n contextDir?: string;\n limit?: number;\n /** Inline the source at each `path:Lx-Ly` hit, sliced from `dir`. Turns the\n * pack from a locator into a retriever so the agent needn't re-open the file. */\n source?: boolean;\n /** Re-rank lexical hits by graph connectivity (personalized PageRank over the\n * wiring edges), demoting same-word collisions and rescuing strongly-connected\n * neighbours the query didn't name. On by default; set false for pure lexical. */\n graphRank?: boolean;\n /** With `source`: inline each hit's WHOLE definition span (capped at\n * {@link MAX_SPAN_LINES}) instead of the default crux-first slice. The",
- "span": "L489-L500"
- }
- },
- {
- "id": "src/ask/ask.ts#AskResult",
- "name": "AskResult",
- "kind": "interface",
- "path": "src/ask/ask.ts",
- "span": "L52-L82",
- "signature": "interface AskResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "612e3a2a9dd6b430e14dd6e525aca53bf96a1217e827747ca5163d973b94d9e6",
- "summary_state": "stale",
- "summary": "Represents the result of an 'ask' query, encapsulating the query details and the hits found.",
- "crux": {
- "code": "export interface AskResult {\n query: string;\n mode: \"structural\" | \"lexical\" | \"empty\";\n /** For structural mode: the symbol whose neighbours we walked. */\n subject?: string;\n hits: AskHit[];\n note?: string;\n /** Token-saving estimate, set only in `--source` (retriever) mode: the whole\n * size of the distinct files these hits point into, i.e. the baseline cost of\n * reading them instead of this pack. Computed from file sizes stored at build. */\n saved?: { files: number; baselineChars: number };\n /** Lexical mode only: share (0..1) of the query's distinct terms the TOP hit",
- "span": "L45-L56"
- }
- },
- {
- "id": "src/ask/ask.ts#askSavingsFooter",
- "name": "askSavingsFooter",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L956-L969",
- "signature": "function askSavingsFooter(r: AskResult, body: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "f857cd0ab442a19a66ef012cdf4e5edf35a95c1ddfcfe0264f5e94b0aab8cfe0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/ask.ts#baselineFor",
- "name": "baselineFor",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L769-L772",
- "signature": "function baselineFor(hits: AskHit[], graph: GraphV1 | null): AskResult[\"saved\"] | undefined",
- "exported": false,
- "origin": "ast",
- "body_hash": "91cd3cce13a575ea02b8aa87e2fa9a411a7c34fe85f654640d382f4f305bf8b7",
- "summary_state": "stale",
- "summary": "Calculates the baseline file size and character count for the hits, providing a measure of the cost of reading the full files.",
- "crux": {
- "code": "function baselineFor(hits: AskHit[], graph: GraphV1 | null): AskResult[\"saved\"] | undefined {\n if (!graph) return undefined;\n const size = new Map<string, number>();\n for (const n of graph.nodes)\n if (n.kind === \"file\" && typeof n.chars === \"number\") size.set(n.path, n.chars);\n\n let baselineChars = 0;\n let files = 0;\n for (const path of hitFiles(hits)) {\n const c = size.get(path);\n if (c === undefined) continue;\n baselineChars += c;",
- "span": "L574-L585"
- }
- },
- {
- "id": "src/ask/ask.ts#bm25",
- "name": "bm25",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L186-L202",
- "signature": "function bm25( query: Map<string, number>, doc: Map<string, number>, idf: Map<string, number>, dl: number, avgdl: number, ): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "8e22c96440f87456feecde97f0e10c924ef34f8634216d0ae6c3a562a42dc039",
- "summary_state": "ready",
- "summary": "Implements the BM25 scoring algorithm to rank documents based on term frequency and document length.",
- "crux": {
- "code": "function bm25(\n query: Map<string, number>,\n doc: Map<string, number>,\n idf: Map<string, number>,\n dl: number,\n avgdl: number,\n): number {\n const k1 = 1.2;\n const b = 0.75;\n const norm = k1 * (1 - b + (b * dl) / (avgdl || 1));\n let s = 0;\n for (const t of query.keys()) {",
- "span": "L166-L177"
- }
- },
- {
- "id": "src/ask/ask.ts#computeIdf",
- "name": "computeIdf",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L160-L165",
- "signature": "function computeIdf(docBags: Array<Set<string>>): Map<string, number>",
- "exported": false,
- "origin": "ast",
- "body_hash": "5d59d7e73b63c473b62ab741265b168865d8174d1172cc9e534d23147440b4b4",
- "summary_state": "ready",
- "summary": "Generates IDF values from document bags, which are used to weight query matches based on term rarity.",
- "crux": {
- "code": "function computeIdf(docBags: Array<Set<string>>): Map<string, number> {\n const df = new Map<string, number>();\n for (const bag of docBags)\n for (const t of bag) df.set(t, (df.get(t) ?? 0) + 1);\n return idfFromDf(df, docBags.length);\n}",
- "span": "L140-L145"
- }
- },
- {
- "id": "src/ask/ask.ts#computeIdfFromIndex",
- "name": "computeIdfFromIndex",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L174-L179",
- "signature": "function computeIdfFromIndex(index: AskIndex, conceptBags: Array<Set<string>>): Map<string, number>",
- "exported": false,
- "origin": "ast",
- "body_hash": "cc84ad53f5e0dab091309c87c15652d661faec9f4237e267ba1d2acc51bad9b3",
- "summary_state": "ready",
- "summary": "Calculates IDF values using precomputed index data, optimizing the scoring process for queries.",
- "crux": {
- "code": "function computeIdfFromIndex(index: AskIndex, conceptBags: Array<Set<string>>): Map<string, number> {\n const df = new Map(index.df);\n for (const bag of conceptBags)\n for (const t of bag) df.set(t, (df.get(t) ?? 0) + 1);\n return idfFromDf(df, index.docCount + conceptBags.length);\n}",
- "span": "L154-L159"
- }
- },
- {
- "id": "src/ask/ask.ts#Corpus",
- "name": "Corpus",
- "kind": "interface",
- "path": "src/ask/ask.ts",
- "span": "L94-L101",
- "signature": "interface Corpus",
- "exported": false,
- "origin": "ast",
- "body_hash": "447d1a3c8c6b46c599acb70ea56a6ebad5eefcb17a849187c5aa2b364eb85d5d",
- "summary_state": "ready",
- "summary": "Defines the structure for holding concepts and graph data used in processing queries.",
- "crux": {
- "code": "interface Corpus {\n concepts: Array<{ slug: string; name: string; sources: string[]; related: string[]; snippet: string; text: string }>;\n graph: GraphV1 | null;\n /** Build-time token/df sidecar (`.cache/ask-index.json`), or null when absent,\n * unparseable, an unknown version, or stale (checked against `graph.nodes.length`\n * by the caller — see `lexical()`). Null means: fall back to live tokenization. */\n askIndex: AskIndex | null;\n}",
- "span": "L74-L81"
- }
- },
- {
- "id": "src/ask/ask.ts#escalationNudge",
- "name": "escalationNudge",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L944-L951",
- "signature": "function escalationNudge(r: AskResult): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "9c40bcc6776ac6747c2735c73c9461cc93d6ff1af1169d6696ef3fc24d721668",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/ask.ts#fallthroughNoteFor",
- "name": "fallthroughNoteFor",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L253-L258",
- "signature": "function fallthroughNoteFor(subject: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "8894dd2788429383684ba0a325296c7fd8e11865a5fbb7d1fdadc45f4c99ab23",
- "summary_state": "ready",
- "summary": "Generates a note for cases where a structural query falls back to lexical processing, providing user guidance.",
- "crux": {
- "code": "function fallthroughNoteFor(subject: string): string {\n return (\n `structural index: no entries for '${subject}' — showing lexical matches; ` +\n `for exhaustive callers use grep -rn '${subject}'`\n );\n}",
- "span": "L223-L228"
- }
- },
- {
- "id": "src/ask/ask.ts#findSubjectNodes",
- "name": "findSubjectNodes",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L235-L243",
- "signature": "function findSubjectNodes(query: string, graph: GraphV1, inPrefix?: string): { nodes: NodeV1[]; tried: string }",
- "exported": false,
- "origin": "ast",
- "body_hash": "761fdde19148564b12710387be9dc92d2fe2f61797a537dfe1d796889e313f66",
- "summary_state": "stale",
- "summary": "Finds nodes in the graph that match the structural subject of a query, enhancing query resolution.",
- "crux": {
- "code": "function findSubjectNodes(query: string, graph: GraphV1): { nodes: NodeV1[]; tried: string } {\n const words = subjectWords(query).sort((a, b) => b.length - a.length);\n for (const w of words) {\n const nodes = resolveSymbol(graph, w);\n if (nodes.length > 0) return { nodes, tried: w };\n }\n return { nodes: [], tried: words[0] ?? query };\n}",
- "span": "L206-L213"
- }
- },
- {
- "id": "src/ask/ask.ts#firstProse",
- "name": "firstProse",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L85-L92",
- "signature": "function firstProse(body: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "29dae1ad2ad4bdf2c695c5a817addfb02012d8d1c4093dac9d61bb8d35ef34c5",
- "summary_state": "ready",
- "summary": "Extracts the first meaningful prose line from a body of text, ignoring headings and blank lines.",
- "crux": {
- "code": "function firstProse(body: string): string {\n for (const raw of body.split(\"\\n\")) {\n const line = raw.trim();\n if (!line || line.startsWith(\"#\") || line.startsWith(\"<!--\") || line.startsWith(\"-\")) continue;\n return line;",
- "span": "L66-L70"
- }
- },
- {
- "id": "src/ask/ask.ts#formatAsk",
- "name": "formatAsk",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L895-L937",
- "signature": "function formatAsk(r: AskResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "deabf4d01278ff8b1072c0f08014fbb10def94d18b3dbbec7a42d8511a66d78b",
- "summary_state": "stale",
- "summary": "Formats the results of an ask query into a string for presentation, ensuring clarity and usability.",
- "crux": {
- "code": "export function formatAsk(r: AskResult): string {\n const head = `graft ask — \"${r.query}\" (${r.mode})`;\n // The note prints as its own prominent line(s) right under the header —\n // above every hit — so a loud structural-fallthrough note (or the\n // no-structural-edges / no-lexical-match note) can never be missed by only\n // being embedded inline in the header parenthetical. Only a genuine\n // fallthrough/warning line (from `fallthroughNoteFor`, always prefixed\n // \"structural index:\") gets the ⚠ marker; the benign structural header note\n // (\"callers / references of X\" / \"outgoing edges from X\") prints plain —\n // it's informational, not a warning.\n const noteBlock = r.note\n ? r.note",
- "span": "L693-L704"
- }
- },
- {
- "id": "src/ask/ask.ts#formatSkeleton",
- "name": "formatSkeleton",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L877-L887",
- "signature": "function formatSkeleton(r: SkeletonResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "25c867d1efd19358c8ecd1cd4024c42f8050b8c07816a4a1df6edc57f7a0583d",
- "summary_state": "stale",
- "summary": "Formats the skeleton result into a string representation for display or output purposes.",
- "crux": {
- "code": "export function formatSkeleton(r: SkeletonResult): string {\n const head = `graft skeleton — ${r.file}`;\n if (!r.entries.length) return `${head}\\n\\n${r.note ?? \"no definitions.\"}\\n`;\n const lines = r.entries.map((e) => {\n const sig = e.signature ? ` ${e.signature}` : \"\";\n const sum = e.summary ? ` — ${e.summary}` : \"\";\n return `- ${e.span} ${e.kind} ${e.name}${sig}${sum}`;\n });\n return `${head}\\n${lines.join(\"\\n\")}\\n`;\n}",
- "span": "L676-L685"
- }
- },
- {
- "id": "src/ask/ask.ts#hasTerm",
- "name": "hasTerm",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L328-L330",
- "signature": "function hasTerm(f: Map<string, number>, t: string): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "fc67bfbddd84c204744457e940d090b6c90985539a1c4cdf713f69d6a92b5c37",
- "summary_state": "ready",
- "summary": "Checks for the presence of a term in a document's token map, aiding in relevance scoring.",
- "crux": {
- "code": "function hasTerm(f: Map<string, number>, t: string): boolean {\n return f.has(t) || f.has(`${t}s`) || (t.endsWith(\"s\") && f.has(t.slice(0, -1)));\n}",
- "span": "L298-L300"
- }
- },
- {
- "id": "src/ask/ask.ts#hitFiles",
- "name": "hitFiles",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L755-L764",
- "signature": "function hitFiles(hits: AskHit[]): Set<string>",
- "exported": false,
- "origin": "ast",
- "body_hash": "51b7d4fbb4e2ea5979c8e8b308c7158ad764595538ee72714f4aa2f93d5ee89b",
- "summary_state": "ready",
- "summary": "Extracts a set of unique file paths from the hits, indicating which files are relevant to the query results.",
- "crux": {
- "code": "function hitFiles(hits: AskHit[]): Set<string> {\n const files = new Set<string>();\n for (const h of hits) {\n const span = parseSpan(h.pointer);\n if (span) { files.add(span.path); continue; }\n for (const p of h.pointer.split(\",\").map((s) => s.trim()))\n if (p && !p.includes(\" \")) files.add(p);\n }\n return files;\n}",
- "span": "L560-L569"
- }
- },
- {
- "id": "src/ask/ask.ts#idfFromDf",
- "name": "idfFromDf",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L154-L158",
- "signature": "function idfFromDf(df: Map<string, number>, n: number): Map<string, number>",
- "exported": false,
- "origin": "ast",
- "body_hash": "6e08a73cec05cbac1943acd2d2c588c901fb1e84327aced754012931f7bc5ed1",
- "summary_state": "ready",
- "summary": "Computes the inverse document frequency (IDF) from document frequency (DF) data, aiding in scoring relevance.",
- "crux": {
- "code": "function idfFromDf(df: Map<string, number>, n: number): Map<string, number> {\n const idf = new Map<string, number>();\n for (const [t, d] of df) idf.set(t, Math.log(1 + n / (1 + d)));\n return idf;\n}",
- "span": "L134-L138"
- }
- },
- {
- "id": "src/ask/ask.ts#inlineSource",
- "name": "inlineSource",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L734-L751",
- "signature": "function inlineSource(root: string, hits: AskHit[], graph: GraphV1 | null, full: boolean): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "41579c388276225af6b3ceab098eb0d7817f706b0885aeb1a82c4fb27624e9dd",
- "summary_state": "ready",
- "summary": "Inlines the source code for the hits found, providing context directly in the results without needing to open files.",
- "crux": {
- "code": "function inlineSource(root: string, hits: AskHit[], graph: GraphV1 | null, full: boolean): void {\n const cruxByPointer = new Map<string, string>();\n if (!full && graph) {\n for (const n of graph.nodes)\n if (n.crux?.code) cruxByPointer.set(`${n.path}:${n.span}`, n.crux.code);\n }\n for (const h of hits) {\n const s = parseSpan(h.pointer);\n if (!s) continue;\n const crux = cruxByPointer.get(h.pointer);\n if (crux) {\n h.code = `${crux}\\n… (crux — full definition at ${h.pointer}; rerun with --full)`;",
- "span": "L539-L550"
- }
- },
- {
- "id": "src/ask/ask.ts#lexical",
- "name": "lexical",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L375-L676",
- "signature": "function lexical(query: string, corpus: Corpus, limit: number, graphRank: boolean, inPrefix?: string): AskResult",
- "exported": false,
- "origin": "ast",
- "body_hash": "c1e86f5f126d651dac8a2135fac1b3d041da77403ddad5c273768696fa0e4d9b",
- "summary_state": "stale",
- "summary": "Handles lexical queries by scoring documents based on term matches and relevance, returning structured results.",
- "crux": {
- "code": "function lexical(query: string, corpus: Corpus, limit: number, graphRank: boolean): AskResult {\n // Binary query terms: a word repeated in a pasted issue body counts once, so a\n // ranty description can't linearly amplify an incidental word.\n const q = new Map([...counts(tokenize(query)).keys()].map((t) => [t, 1]));\n const graph = corpus.graph;\n\n // ── Pass 1: tokenize every scored field once, and collect per-document token\n // bags so IDF can down-weight words that occur across the whole corpus. ──\n const conceptDocs = corpus.concepts.map((c) => ({\n c,\n name: counts(tokenize(c.name)),\n body: counts(tokenize(c.text)),",
- "span": "L325-L336"
- }
- },
- {
- "id": "src/ask/ask.ts#lexical.bodyLen",
- "name": "bodyLen",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L495-L499",
- "signature": "bodyLen = (m: Map<string, number>)",
- "exported": false,
- "origin": "ast",
- "body_hash": "79442ce15d0955c8c21add8fdebb6c22462136c2b241e8e60ea75313d1097259",
- "summary_state": "ready",
- "summary": "Calculates the length of the body of a lexical document to ensure it meets certain criteria for processing.",
- "crux": {
- "code": " const bodyLen = (m: Map<string, number>) => {\n let s = 0;\n for (const v of m.values()) s += v;\n return s;\n };",
- "span": "L416-L420"
- }
- },
- {
- "id": "src/ask/ask.ts#loadCorpus",
- "name": "loadCorpus",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L103-L128",
- "signature": "function loadCorpus(outDir: string): Corpus",
- "exported": false,
- "origin": "ast",
- "body_hash": "af968cfe7454eca7769fa907cf30435ab4e4d9a38b1df4a924c3e261b1ea058d",
- "summary_state": "ready",
- "summary": "Loads a corpus of concepts and graph data from a specified directory, enabling query processing.",
- "crux": {
- "code": "function loadCorpus(outDir: string): Corpus {\n const concepts: Corpus[\"concepts\"] = [];\n if (existsSync(outDir)) {\n for (const entry of readdirSync(outDir)) {\n if (!entry.endsWith(\".md\") || entry === \"INDEX.md\") continue;\n const parsed = matter(readFileSync(join(outDir, entry), \"utf8\"));\n const fm = parsed.data as Record<string, unknown>;\n const sources = Array.isArray(fm.sources)\n ? (fm.sources as Array<{ path: string }>).map((s) => s.path)\n : [];\n const related = Array.isArray(fm.links)\n ? (fm.links as Array<{ to: string }>).map((l) => l.to)",
- "span": "L83-L94"
- }
- },
- {
- "id": "src/ask/ask.ts#matchedIdfShare",
- "name": "matchedIdfShare",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L359-L373",
- "signature": "function matchedIdfShare( q: Map<string, number>, fields: Array<Map<string, number>>, idf: Map<string, number>, dfltIdf: number, ): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "93bb9c0ed85fc1574471b01dd1590d29f56829f7f848725be080ff45865f5477",
- "summary_state": "ready",
- "summary": "Calculates the share of query terms matched by a document, weighted by term rarity for relevance assessment.",
- "crux": {
- "code": "function matchedIdfShare(\n q: Map<string, number>,\n fields: Array<Map<string, number>>,\n idf: Map<string, number>,\n dfltIdf: number,\n): number {\n let matched = 0;\n let total = 0;\n for (const t of q.keys()) {\n const w = idf.get(t) ?? dfltIdf;\n total += w;\n if (fields.some((f) => hasTerm(f, t))) matched += w;",
- "span": "L309-L320"
- }
- },
- {
- "id": "src/ask/ask.ts#parseSpan",
- "name": "parseSpan",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L704-L708",
- "signature": "function parseSpan(pointer: string): { path: string; from: number; to: number } | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "167f32f4458f586e27867a3de42b75c75366f38d922fd9ea0b5a2380788ed0b0",
- "summary_state": "ready",
- "summary": "Parses a string pointer into its file path and line range components, facilitating source code navigation.",
- "crux": {
- "code": " const m = pointer.match(/^(.*):L(\\d+)-L(\\d+)$/);\n if (!m) return null;\n return { path: m[1], from: Number(m[2]), to: Number(m[3]) };",
- "span": "L255-L257"
- }
- },
- {
- "id": "src/ask/ask.ts#scopeFooterLines",
- "name": "scopeFooterLines",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L976-L988",
- "signature": "function scopeFooterLines(r: AskResult): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "ce03d65f9e1db5c09735d5949ee47ec715f1c7d1d231741926df77480effc349",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/ask.ts#score",
- "name": "score",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L137-L148",
- "signature": "function score( query: Map<string, number>, doc: Map<string, number>, idf: Map<string, number>, ): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "2072a594183410910a338bd797387b8e6f7d832270aea7037ffad9b397e150d8",
- "summary_state": "ready",
- "summary": "Calculates a score for a document based on its token counts relative to a query, enhancing relevance ranking.",
- "crux": {
- "code": "function score(\n query: Map<string, number>,\n doc: Map<string, number>,\n idf: Map<string, number>,\n): number {\n let s = 0;\n for (const [t, qn] of query) {\n const dn = doc.get(t);\n if (dn) s += qn * dn * (idf.get(t) ?? 1);\n }\n return s;\n}",
- "span": "L117-L128"
- }
- },
- {
- "id": "src/ask/ask.ts#skeleton",
- "name": "skeleton",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L844-L874",
- "signature": "function skeleton(dir: string, file: string, opts: { contextDir?: string } = {}): SkeletonResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "c2057571eb11b9a08e8cd9a1d73d9f006fdfa2cd41df94080656b8e17889f1b2",
- "summary_state": "stale",
- "summary": "Extracts a skeleton representation of a file, providing a summary and context for its contents.",
- "crux": {
- "code": "export function skeleton(dir: string, file: string, opts: { contextDir?: string } = {}): SkeletonResult {\n const outDir = contextDirFor(resolve(dir), opts.contextDir);\n const graph = loadGraphCached(outDir);\n if (!graph) return { file, entries: [], note: \"no wiring graph — run `graft build` first\" };\n\n let defs = graph.nodes.filter((n) => n.kind !== \"file\" && n.path === file);\n if (!defs.length) {\n const matches = new Set(\n graph.nodes.filter((n) => n.path === file || n.path.endsWith(`/${file}`)).map((n) => n.path),\n );\n if (matches.size > 1)\n return { file, entries: [], note: `ambiguous — matches: ${[...matches].sort().join(\", \")}` };",
- "span": "L644-L655"
- }
- },
- {
- "id": "src/ask/ask.ts#skeleton.startLine",
- "name": "startLine",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L861-L861",
- "signature": "startLine = (span: string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "84d2fbc9874f1ef387f00598a55b3d677f8cb91f237fd7763887375557cbde35",
- "summary_state": "ready",
- "summary": "Calculates the starting line number from a given span, aiding in the extraction of relevant code sections.",
- "crux": {
- "code": " const startLine = (span: string) => Number(span.match(/^L(\\d+)/)?.[1] ?? 0);",
- "span": "L661-L661"
- }
- },
- {
- "id": "src/ask/ask.ts#SkeletonEntry",
- "name": "SkeletonEntry",
- "kind": "interface",
- "path": "src/ask/ask.ts",
- "span": "L824-L831",
- "signature": "interface SkeletonEntry",
- "exported": true,
- "origin": "ast",
- "body_hash": "97e65aa8f777a7c35743f802f99b11c49914bb5d94d43fe15bd643fb7ac7c776",
- "summary_state": "ready",
- "summary": "Defines the structure of a skeleton entry, which represents a piece of information extracted from a file.",
- "crux": {
- "code": "export interface SkeletonEntry {\n name: string;\n kind: string;\n span: string;\n signature: string | null;\n /** First line of the Tier-2 summary, when the node has one. */\n summary?: string;\n}",
- "span": "L626-L633"
- }
- },
- {
- "id": "src/ask/ask.ts#SkeletonResult",
- "name": "SkeletonResult",
- "kind": "interface",
- "path": "src/ask/ask.ts",
- "span": "L833-L839",
- "signature": "interface SkeletonResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "9fc13a0df0d2a8e697e0526483319f3f1335418f90e29beaa6f6e6c0e25b12f5",
- "summary_state": "stale",
- "summary": "Defines the structure of the result returned from the skeleton function, encapsulating the extracted information.",
- "crux": {
- "code": "export interface SkeletonResult {\n file: string;\n entries: SkeletonEntry[];\n note?: string;\n}",
- "span": "L635-L639"
- }
- },
- {
- "id": "src/ask/ask.ts#sliceSpan",
- "name": "sliceSpan",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L712-L727",
- "signature": "function sliceSpan(root: string, path: string, from: number, to: number): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "44149097e46f09ef24a44f0b307a1346234527fc47d98b2d52988d26c8d6328d",
- "summary_state": "ready",
- "summary": "Reads a specified range of lines from a source file, allowing for inlined code snippets in query results.",
- "crux": {
- "code": "function sliceSpan(root: string, path: string, from: number, to: number): string | null {\n try {\n const lines = readFileSync(join(root, path), \"utf8\").split(\"\\n\");\n const start = Math.max(1, from);\n const end = Math.min(lines.length, to);\n const slice = lines.slice(start - 1, end);\n if (slice.length > MAX_SPAN_LINES) {\n const head = slice.slice(0, MAX_SPAN_LINES);\n head.push(`… (+${slice.length - MAX_SPAN_LINES} more lines; open ${path}:L${start}-L${end})`);\n return head.join(\"\\n\");\n }\n return slice.join(\"\\n\");",
- "span": "L262-L273"
- }
- },
- {
- "id": "src/ask/ask.ts#strongShare",
- "name": "strongShare",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L348-L357",
- "signature": "function strongShare( q: Map<string, number>, node: NodeV1, doc: { name: Map<string, number> }, idf: Map<string, number>, dfltIdf: number, ): number",
- "exported": true,
- "origin": "ast",
- "body_hash": "59a36584cd040d31423a472b5af9efeeb52e9f6b855f85bbc2ecd0d80df9dfd5",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/ask.ts#structural",
- "name": "structural",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L260-L309",
- "signature": "function structural(query: string, graph: GraphV1, limit: number, inPrefix?: string): StructuralOutcome",
- "exported": false,
- "origin": "ast",
- "body_hash": "28d22f391db0d7decd6c4e2e0575cb620d13a909f63583789dc5c93c9f021532",
- "summary_state": "stale",
- "summary": "Processes a structural query to find relationships in the graph, returning relevant results or fallthrough notes.",
- "crux": {
- "code": "function structural(query: string, graph: GraphV1, limit: number): StructuralOutcome {\n const wantsIn = INCOMING.test(query);\n const wantsOut = OUTGOING.test(query);\n if (!wantsIn && !wantsOut) return null;\n\n const { nodes: subjects, tried } = findSubjectNodes(query, graph);\n if (subjects.length === 0) return { fallthroughNote: fallthroughNoteFor(tried) };\n\n const ids = new Set(subjects.map((n) => n.id));\n const byId = new Map(graph.nodes.map((n) => [n.id, n]));\n const outgoing = wantsOut && !wantsIn; // \"what does X call / import\" — else default to callers\n const rels = new Set(outgoing ? OUTGOING_RELS : INCOMING_RELS);",
- "span": "L230-L241"
- }
- },
- {
- "id": "src/ask/ask.ts#StructuralOutcome",
- "name": "StructuralOutcome",
- "kind": "type",
- "path": "src/ask/ask.ts",
- "span": "L251-L251",
- "signature": "type StructuralOutcome = { result: AskResult } | { fallthroughNote: string } | null;",
- "exported": false,
- "origin": "ast",
- "body_hash": "628e17efd7be8fc7e319d1f0a5a1284ead0b1630ed037560382c6b21e362720f",
- "summary_state": "ready",
- "summary": "Defines the possible outcomes of a structural query, indicating whether a result was found, a fallthrough note is needed, or if there was no structural intent.",
- "crux": {
- "code": "type StructuralOutcome = { result: AskResult } | { fallthroughNote: string } | null;",
- "span": "L221-L221"
- }
- },
- {
- "id": "src/ask/ask.ts#subjectWords",
- "name": "subjectWords",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L214-L216",
- "signature": "function subjectWords(query: string): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "18d4993f0e015fe413d7acd6650f40c85effd40e22ed376b19223c939c6a9d0b",
- "summary_state": "ready",
- "summary": "Tokenizes a query into words while preserving qualified names, facilitating accurate subject resolution.",
- "crux": {
- "code": "function subjectWords(query: string): string[] {\n return [...new Set(query.split(/[^A-Za-z0-9_.]+/).filter(Boolean))];\n}",
- "span": "L194-L196"
- }
- },
- {
- "id": "src/ask/ask.ts#toTokens",
- "name": "toTokens",
- "kind": "function",
- "path": "src/ask/ask.ts",
- "span": "L890-L892",
- "signature": "function toTokens(chars: number): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "c309fa8bd0227742b657331eb45be3225e5a5efc56b1967871624df6c83ab954",
- "summary_state": "ready",
- "summary": "Converts a character count into a token count, facilitating the processing of text for queries.",
- "crux": {
- "code": "function toTokens(chars: number): number {\n return Math.round(chars / 4);\n}",
- "span": "L688-L690"
- }
- },
- {
- "id": "src/ask/fuse.ts",
- "name": "fuse.ts",
- "kind": "file",
- "path": "src/ask/fuse.ts",
- "span": "L1-L261",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a54362abffea36e5df8d2b5e9f667897b735fe78f78d718688347dbac659e9a3",
- "chars": 11960,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/fuse.ts#byScore",
- "name": "byScore",
- "kind": "function",
- "path": "src/ask/fuse.ts",
- "span": "L83-L85",
- "signature": "function byScore(a: ScopedDoc, b: ScopedDoc): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "2e71862b501450e9cb3bb07de26f16c01dd99618906c59c130a414e7da43a7aa",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/fuse.ts#fuseScopes",
- "name": "fuseScopes",
- "kind": "function",
- "path": "src/ask/fuse.ts",
- "span": "L98-L161",
- "signature": "function fuseScopes(docs: ScopedDoc[]): FusionResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "1fc7af0954ef0925b2932d5f741f73f4e3f24ca4d84f2f51a1f0361dd377eac4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/fuse.ts#FusionResult",
- "name": "FusionResult",
- "kind": "interface",
- "path": "src/ask/fuse.ts",
- "span": "L36-L46",
- "signature": "interface FusionResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "4c74f3d554ecf76d50432d9c530683fbef3a6270373dc76c4cfd892c9642e16c",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/fuse.ts#rankScopesAndFuse",
- "name": "rankScopesAndFuse",
- "kind": "function",
- "path": "src/ask/fuse.ts",
- "span": "L204-L260",
- "signature": "function rankScopesAndFuse( scopes: string[], ops: ScopeRankOps, graphWeight: number, rescueFloor: number, ): FusionResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "d27502c18ca4fab6a0ecc495b986f5e532d28d85514ddf7973eb79a8c2b26e9f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/fuse.ts#ScopedDoc",
- "name": "ScopedDoc",
- "kind": "interface",
- "path": "src/ask/fuse.ts",
- "span": "L30-L34",
- "signature": "interface ScopedDoc",
- "exported": true,
- "origin": "ast",
- "body_hash": "7701e249da1aa85502adfa3140abb1817498a34d3e3d5d3982f50d0293d95051",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/fuse.ts#ScopeRankOps",
- "name": "ScopeRankOps",
- "kind": "interface",
- "path": "src/ask/fuse.ts",
- "span": "L167-L182",
- "signature": "interface ScopeRankOps",
- "exported": true,
- "origin": "ast",
- "body_hash": "55d47ff440296617d0b300129d3675ccbf5474426107924144262c23673018be",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/ask/graphrank.ts",
- "name": "graphrank.ts",
- "kind": "file",
- "path": "src/ask/graphrank.ts",
- "span": "L1-L114",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "6f013649bbb0603d2731d19612da2905d346f86affc95e5b918f2330045ce09b",
- "chars": 4857,
- "summary_state": "stale",
- "summary": "This module implements a personalized PageRank algorithm to improve the ranking of code nodes based on their structural relevance rather than just lexical similarity.",
- "crux": {
- "code": " * This module runs personalized PageRank (random-walk-with-restart) over the\n * wiring graph, seeded by the lexical scores. Mass concentrates on nodes that\n * are edge-connected to the matched set; a lexically-matched but structurally\n * isolated node keeps only its own restart mass and sinks. \"Lexical proposes,\n * graph disposes.\" Deterministic, $0, no embeddings — a lexical-seed →\n * graph-rank pipeline, the established alternative to vector search for code.",
- "span": "L10-L15"
- }
- },
- {
- "id": "src/ask/graphrank.ts#PageRankOptions",
- "name": "PageRankOptions",
- "kind": "interface",
- "path": "src/ask/graphrank.ts",
- "span": "L20-L32",
- "signature": "interface PageRankOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "0645c00d3cf93eb3d2194eaa5f87937bb16eff0ae937a433068aa3781b91c162",
- "summary_state": "stale",
- "summary": "Defines options for configuring the personalized PageRank algorithm, including restart probability and iteration count.",
- "crux": null
- },
- {
- "id": "src/ask/graphrank.ts#personalizedPageRank",
- "name": "personalizedPageRank",
- "kind": "function",
- "path": "src/ask/graphrank.ts",
- "span": "L45-L113",
- "signature": "function personalizedPageRank( graph: GraphV1, seeds: Map<string, number>, opts: PageRankOptions = {}, ): Map<string, number>",
- "exported": true,
- "origin": "ast",
- "body_hash": "5cfcdfdadd4ab08f42acb99d706ef062ccfa94990e40d419cf7d80b9d1580603",
- "summary_state": "stale",
- "summary": "Calculates personalized PageRank scores for nodes in a wiring graph based on provided seeds, enhancing the relevance of code suggestions.",
- "crux": {
- "code": " let rank = new Map(restart);\n for (let i = 0; i < iters; i++) {\n const next = new Map<string, number>();\n // Teleport: every step, alpha of the mass returns to the seed set.\n for (const [id, r] of restart) next.set(id, alpha * r);\n // Dangling mass (nodes with no walk edges) is pooled and returned to the\n // seed set ONCE per iteration — same math as redistributing per node, but\n // O(nodes + seeds) instead of O(dangling × seeds).\n let dangling = 0;\n for (const [id, mass] of rank) {\n const nbrs = adj.get(id);\n if (!nbrs || nbrs.length === 0) {",
- "span": "L70-L81"
- }
- },
- {
- "id": "src/ask/graphrank.ts#personalizedPageRank.link",
- "name": "link",
- "kind": "function",
- "path": "src/ask/graphrank.ts",
- "span": "L63-L65",
- "signature": "link = (a: string, b: string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "b76de11ee0fe0076e0901d2e5abc1ac27dfd56c3a8902d3314b7408902316269",
- "summary_state": "ready",
- "summary": "Creates undirected links between nodes in the graph for the PageRank calculation, ensuring that both directions are considered.",
- "crux": null
- },
- {
- "id": "src/ask/index-file.ts",
- "name": "index-file.ts",
- "kind": "file",
- "path": "src/ask/index-file.ts",
- "span": "L1-L160",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "8250b5189d515c4e4bf1573c4c44c96563e121c944951c5f16029c62da62d854",
- "chars": 5977,
- "summary_state": "ready",
- "summary": "This file provides functionality for building and reading a cache of tokenized graph data to optimize query performance.",
- "crux": {
- "code": "/**\n * Build-time sidecar for `graft ask` — `<outDir>/.cache/ask-index.json`.\n *\n * `ask`'s lexical pass tokenizes every symbol node's name/path/body on every\n * query; at 32k nodes that re-tokenization is ~45% of query time (profiled).\n * `graft build` writes this sidecar once, with the token→count bags per node\n * plus the corpus-wide document frequencies, so a query just reads counts\n * instead of re-splitting every node's text. It's a derived cache, not\n * checked-in graph data, so it lives under the gitignored `.cache/` dir\n * (see `CACHE_DIR` in `context/node-file.ts`) rather than `.graph/`.\n *\n * `tokenize`/`counts` live here (not duplicated in `ask.ts`) so build-time and",
- "span": "L1-L12"
- }
- },
- {
- "id": "src/ask/index-file.ts#AskIndex",
- "name": "AskIndex",
- "kind": "interface",
- "path": "src/ask/index-file.ts",
- "span": "L63-L69",
- "signature": "interface AskIndex",
- "exported": true,
- "origin": "ast",
- "body_hash": "a6e5978285b47baf6dc2f857106f65dccb472c8262d8c673600206666af5f7ed",
- "summary_state": "ready",
- "summary": "Represents the overall structure of the ask index, including document frequencies and average body length for efficient querying.",
- "crux": {
- "code": "export interface AskIndex {\n version: 1;\n avgBodyLen: number;\n df: [string, number][];\n docCount: number;\n docs: AskIndexDoc[];\n}",
- "span": "L63-L69"
- }
- },
- {
- "id": "src/ask/index-file.ts#AskIndexDoc",
- "name": "AskIndexDoc",
- "kind": "interface",
- "path": "src/ask/index-file.ts",
- "span": "L54-L59",
- "signature": "interface AskIndexDoc",
- "exported": true,
- "origin": "ast",
- "body_hash": "4e6b189863bc6614aef60491ea5931414251bad599c5c38783ad4c875a080dda",
- "summary_state": "ready",
- "summary": "Defines the structure for storing token bags associated with a single document in the index.",
- "crux": {
- "code": "export interface AskIndexDoc {\n id: string;\n name: [string, number][];\n path: [string, number][];\n body: [string, number][];\n}",
- "span": "L54-L59"
- }
- },
- {
- "id": "src/ask/index-file.ts#askIndexPath",
- "name": "askIndexPath",
- "kind": "function",
- "path": "src/ask/index-file.ts",
- "span": "L76-L78",
- "signature": "function askIndexPath(outDir: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "b16433d7a4366a73ec33bb76fb8e13cdd0039de0c6a783a8b9605f355a7c0dfb",
- "summary_state": "ready",
- "summary": "Generates the absolute file path for the ask index sidecar based on the output directory.",
- "crux": {
- "code": "export function askIndexPath(outDir: string): string {\n return join(outDir, CACHE_DIR, ASK_INDEX_FILE);\n}",
- "span": "L76-L78"
- }
- },
- {
- "id": "src/ask/index-file.ts#bagLen",
- "name": "bagLen",
- "kind": "function",
- "path": "src/ask/index-file.ts",
- "span": "L85-L89",
- "signature": "function bagLen(p: [string, number][]): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "fa14c4dc1e7bf2f6a06307dbb18890b7973992df221f4b26c67d04db640beb0c",
- "summary_state": "ready",
- "summary": "Calculates the total count of tokens in a document's field, representing its length.",
- "crux": {
- "code": "function bagLen(p: [string, number][]): number {\n let s = 0;\n for (const [, c] of p) s += c;\n return s;\n}",
- "span": "L85-L89"
- }
- },
- {
- "id": "src/ask/index-file.ts#counts",
- "name": "counts",
- "kind": "function",
- "path": "src/ask/index-file.ts",
- "span": "L47-L51",
- "signature": "function counts(tokens: string[]): Map<string, number>",
- "exported": true,
- "origin": "ast",
- "body_hash": "55edb54385b8591bd6442f62f998d9d774eda8c15abd3e368e4b3a8086c84112",
- "summary_state": "ready",
- "summary": "Counts the frequency of each token in a given array, facilitating the creation of term-frequency maps for documents.",
- "crux": {
- "code": "export function counts(tokens: string[]): Map<string, number> {\n const m = new Map<string, number>();\n for (const t of tokens) m.set(t, (m.get(t) ?? 0) + 1);\n return m;\n}",
- "span": "L47-L51"
- }
- },
- {
- "id": "src/ask/index-file.ts#pairs",
- "name": "pairs",
- "kind": "function",
- "path": "src/ask/index-file.ts",
- "span": "L80-L82",
- "signature": "function pairs(m: Map<string, number>): [string, number][]",
- "exported": false,
- "origin": "ast",
- "body_hash": "0b366a6cb13cf1c9f4cdc8bcccf3bc270b8793f08059c793dbd93ccf1dbf5fe6",
- "summary_state": "ready",
- "summary": "Converts a Map of token counts into a sorted array format suitable for JSON serialization.",
- "crux": {
- "code": "function pairs(m: Map<string, number>): [string, number][] {\n return [...m.entries()];\n}",
- "span": "L80-L82"
- }
- },
- {
- "id": "src/ask/index-file.ts#readAskIndex",
- "name": "readAskIndex",
- "kind": "function",
- "path": "src/ask/index-file.ts",
- "span": "L138-L159",
- "signature": "function readAskIndex(outDir: string): AskIndex | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "4aa57e86253c4dd7399383853778796baa43ba33801164808b86841d16d7612d",
- "summary_state": "ready",
- "summary": "Reads and validates the ask index from a file, ensuring data integrity before use in queries.",
- "crux": {
- "code": "export function readAskIndex(outDir: string): AskIndex | null {\n const path = askIndexPath(outDir);\n if (!existsSync(path)) return null;\n try {\n const raw = JSON.parse(readFileSync(path, \"utf8\"));\n if (\n !raw ||\n typeof raw !== \"object\" ||\n raw.version !== 1 ||\n typeof raw.docCount !== \"number\" ||\n typeof raw.avgBodyLen !== \"number\" ||\n !Array.isArray(raw.df) ||",
- "span": "L138-L149"
- }
- },
- {
- "id": "src/ask/index-file.ts#tokenize",
- "name": "tokenize",
- "kind": "function",
- "path": "src/ask/index-file.ts",
- "span": "L38-L44",
- "signature": "function tokenize(text: string): string[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "d97d4f8b5422d7b236c0966ab1b1b82002c4691a389eff29fd97e93460269f21",
- "summary_state": "ready",
- "summary": "Tokenizes input text into lowercased subword tokens, ensuring consistent tokenization for both build-time and query-time processes.",
- "crux": {
- "code": "export function tokenize(text: string): string[] {\n return text\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\") // camelCase → camel Case\n .toLowerCase()\n .split(/[^a-z0-9]+/)\n .filter((t) => t.length > 1 && !STOP.has(t));\n}",
- "span": "L38-L44"
- }
- },
- {
- "id": "src/ask/index-file.ts#writeAskIndex",
- "name": "writeAskIndex",
- "kind": "function",
- "path": "src/ask/index-file.ts",
- "span": "L98-L131",
- "signature": "function writeAskIndex(outDir: string, graph: GraphV1): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "9e974a952bf81fe17aa6371841f24af344d8d32ceb67eee3dd6a19d85125e0cb",
- "summary_state": "ready",
- "summary": "Writes the tokenized representation of graph nodes and their frequencies to a JSON file, creating a cache for future queries.",
- "crux": {
- "code": "export function writeAskIndex(outDir: string, graph: GraphV1): string {\n const nodes = [...graph.nodes].sort((a, b) => a.id.localeCompare(b.id));\n const docs: AskIndexDoc[] = [];\n const df = new Map<string, number>();\n\n for (const n of nodes) {\n const name = counts(tokenize(n.name));\n const path = counts(tokenize(n.path));\n const body = counts(\n tokenize(`${n.signature ?? \"\"} ${n.summary ?? \"\"} ${n.body_text ?? \"\"}`),\n );\n docs.push({ id: n.id, name: pairs(name), path: pairs(path), body: pairs(body) });",
- "span": "L98-L109"
- }
- },
- {
- "id": "src/claude/format.ts",
- "name": "format.ts",
- "kind": "file",
- "path": "src/claude/format.ts",
- "span": "L1-L183",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "8e07a4b410189f0932c6b92dc4916939fcb8109f32c15b676e93862f4a10303f",
- "chars": 8612,
- "summary_state": "stale",
- "summary": "This file contains functions and types for formatting and rendering status information related to a graph-based system.",
- "crux": null
- },
- {
- "id": "src/claude/format.ts#AskJson",
- "name": "AskJson",
- "kind": "interface",
- "path": "src/claude/format.ts",
- "span": "L77-L84",
- "signature": "interface AskJson",
- "exported": true,
- "origin": "ast",
- "body_hash": "5758ae8e52d077f5662df3a37af9e59745a3b1b16a7e4bb50a2e62d047bff2fc",
- "summary_state": "ready",
- "summary": "Defines the structure for a JSON object used in retrieval queries, encapsulating query details and hit information.",
- "crux": null
- },
- {
- "id": "src/claude/format.ts#enrichedSegment",
- "name": "enrichedSegment",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L13-L17",
- "signature": "function enrichedSegment(s: Stats): string | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "13d408559074290e5bd519a136440f0021106ece96bde4eb9130807b43436421",
- "summary_state": "ready",
- "summary": "Calculates the percentage of enriched items based on the ready count and total count, returning a formatted string if there are any enriched items.",
- "crux": {
- "code": " const pct = s.totalCount ? Math.round((s.readyCount / s.totalCount) * 100) : 0;\n return C.indigo(`${pct}% enriched`);",
- "span": "L15-L16"
- }
- },
- {
- "id": "src/claude/format.ts#formatBlastRadius",
- "name": "formatBlastRadius",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L64-L75",
- "signature": "function formatBlastRadius(w: GraphV1, filePath: string, cap = 8): string | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "060f1af7d88ad5d2667bc25431982a15e05986ab706b647d4881429fc22cf210",
- "summary_state": "ready",
- "summary": "Formats a string that describes the blast radius for a given file, listing dependencies and their relationships, up to a specified cap.",
- "crux": {
- "code": " const items = edges.slice(0, cap).map((e) => {\n const n = byId.get(e.source);\n const label = n ? `${n.name} (${basename(n.path)})` : e.source;\n return ` • ${e.relation} ← ${label}`;\n });\n const more = edges.length > cap ? `\\n • +${edges.length - cap} more` : '';\n return `[graft] blast radius for ${basename(filePath)} — who depends on it:\\n${items.join('\\n')}${more}`;",
- "span": "L68-L74"
- }
- },
- {
- "id": "src/claude/format.ts#formatOrientation",
- "name": "formatOrientation",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L165-L176",
- "signature": "function formatOrientation(indexMd: string, budgetBytes = 1500): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "b24bba7a613a5fe7b6cd3cfbb87a49bfde19f0fd618a8a716b8d61976da2d480",
- "summary_state": "stale",
- "summary": "Creates a formatted string representing the orientation of the repository map, limited to a specified byte budget.",
- "crux": {
- "code": " return `[graft] repo map (graft/INDEX.md):\\n${indexMd.slice(0, budgetBytes)}`;",
- "span": "L166-L166"
- }
- },
- {
- "id": "src/claude/format.ts#formatRetrieval",
- "name": "formatRetrieval",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L119-L132",
- "signature": "function formatRetrieval(ask: AskJson, cap = 5): string | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "0e749b34c587c31ea6261a491f49e90e0985ed5171ee2f205dcad3466177572c",
- "summary_state": "ready",
- "summary": "Formats the retrieval results into a string, including details about tokens saved and the estimated size of the retrieval pack.",
- "crux": {
- "code": " `${body}\\n[graft] tokens saved ≈ ${saved.toLocaleString()} (${pct}%) — this pack ≈ ` +\n `${tokensOf(body.length).toLocaleString()} tok vs reading the ${ask.saved!.files} file(s) whole ≈ ` +\n `${base.toLocaleString()} tok (estimate).`",
- "span": "L128-L130"
- }
- },
- {
- "id": "src/claude/format.ts#freshnessSegment",
- "name": "freshnessSegment",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L19-L24",
- "signature": "function freshnessSegment(s: Stats): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "4017743e4d027d64db4d0d99f078e8b0f6694409539df5e72ea2951c08e00881",
- "summary_state": "ready",
- "summary": "Generates a status message indicating the freshness of the data, highlighting if the data is syncing or stale.",
- "crux": {
- "code": " if (s.syncing) return C.amber('syncing…');\n if (s.dirty && s.staleCount > 0) return C.amber(`⚠ ${s.staleCount} stale`);\n if (s.dirty) return C.amber('⚠ stale');\n return C.indigo('✓ synced');",
- "span": "L20-L23"
- }
- },
- {
- "id": "src/claude/format.ts#incomingEdges",
- "name": "incomingEdges",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L58-L62",
- "signature": "function incomingEdges(w: GraphV1, filePath: string): EdgeV1[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "df33e0b502eac5f85c753c6d6ba884e232e75ccbc8296eb1c2f74df403786114",
- "summary_state": "ready",
- "summary": "Finds all incoming edges for nodes in a graph that correspond to a specified file path, returning those edges that target the nodes.",
- "crux": {
- "code": " if (!ids.size) return [];\n return (w.edges ?? []).filter((e) => ids.has(e.target) && !ids.has(e.source));",
- "span": "L60-L61"
- }
- },
- {
- "id": "src/claude/format.ts#nodeIdsInFile",
- "name": "nodeIdsInFile",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L50-L56",
- "signature": "function nodeIdsInFile(w: GraphV1, filePath: string): Set<string>",
- "exported": false,
- "origin": "ast",
- "body_hash": "4364752508d77072bf49b2e9f5b788665932916b6c0c081c7d2825f4190d593d",
- "summary_state": "ready",
- "summary": "Retrieves a set of node IDs from a graph that correspond to a specified file path, filtering based on path matches.",
- "crux": {
- "code": " nodes.filter((n) => n.path && (filePath === n.path || filePath.endsWith(`/${n.path}`)))\n .map((n) => n.id),",
- "span": "L53-L54"
- }
- },
- {
- "id": "src/claude/format.ts#relevantRetrieval",
- "name": "relevantRetrieval",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L152-L163",
- "signature": "function relevantRetrieval(ask: AskJson, s: SessionState, cap = 3): string | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "117b69b5bb5a2058d37856fe1429241e2e5b0e00dd3bc87ad2adbb52286f1f4e",
- "summary_state": "ready",
- "summary": "Determines if a retrieval pack should be injected based on relevance and novelty, returning the formatted text or null if not applicable.",
- "crux": {
- "code": " if (typeof ask.coverage === 'number' && ask.coverage < INJECT_MIN_COVERAGE) return null;\n const seen = new Set(s.injectedPointers ?? []);\n const fresh = ask.hits.filter((h) => !seen.has(h.pointer));\n if (!fresh.length) return null;\n const txt = formatRetrieval({ ...ask, hits: fresh }, cap);\n if (!txt) return null;\n s.injectedPointers = [...(s.injectedPointers ?? []), ...fresh.slice(0, cap).map((h) => h.pointer)]\n .slice(-INJECTED_POINTERS_CAP);\n return txt;",
- "span": "L154-L162"
- }
- },
- {
- "id": "src/claude/format.ts#renderStatusline",
- "name": "renderStatusline",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L26-L48",
- "signature": "function renderStatusline( stats: Stats | null, session: SessionState | null, ctx: { ctxPct: number | null }, ): string[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "2879019a5dec5846bba4fadb443068e54af2abb162af24c233c02cab01a82815",
- "summary_state": "ready",
- "summary": "Constructs a status line for displaying the current state of the system, including node and edge counts, enrichment status, and session information.",
- "crux": {
- "code": " const top = [C.muted('◤ ') + C.indigo('graft'), C.text(`${stats.nodeCount} nodes / ${stats.edgeCount} edges`)];\n const enr = enrichedSegment(stats);\n if (enr) top.push(enr);\n top.push(freshnessSegment(stats));",
- "span": "L34-L37"
- }
- },
- {
- "id": "src/claude/format.ts#renderSubagent",
- "name": "renderSubagent",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L178-L182",
- "signature": "function renderSubagent(agentName: string, session: SessionState | null): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "654ed5b50e9a47279bcc15b69c0b45df6e6b5d5684f33520fd7dda9600392de0",
- "summary_state": "ready",
- "summary": "Generates a string representation of a subagent's status, including its query if available, for display purposes.",
- "crux": {
- "code": " const tail = q ? SEP + C.muted('graft: ') + C.text(q) : '';\n return C.muted('◤ ') + C.indigo(agentName) + tail;",
- "span": "L171-L172"
- }
- },
- {
- "id": "src/claude/format.ts#retrievalBody",
- "name": "retrievalBody",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L91-L108",
- "signature": "function retrievalBody(hits: AskJson['hits']): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c1f7256a9594b2717c050b70c35592a22334e58f69fe95236583a42cb6abf899",
- "summary_state": "stale",
- "summary": "Constructs a formatted string representation of retrieval hits, including pointers and snippets, for display purposes.",
- "crux": {
- "code": " const blocks = hits.map((h, i) => {\n const ptr = (h.pointer ?? '').split(',')[0].trim();\n const snip = (h.snippet ?? '').replace(/\\s+/g, ' ').trim().slice(0, 140);\n let b = ` ${i + 1}. ${h.title} — ${ptr}`;\n if (snip) b += `\\n ${snip}`;\n if (h.code) b += `\\n\\`\\`\\`\\n${h.code}\\n\\`\\`\\``;\n return b;\n });\n // Two pack shapes: with inlined code the pack is substitutive (read here, don't\n // re-open); without code it is pointers-only — locators the agent may follow,\n // pulling spans itself via `graft ask --source` (push→pull: per-prompt injected\n // tokens are always fresh full-price input, so the pack stays tiny).",
- "span": "L92-L103"
- }
- },
- {
- "id": "src/claude/format.ts#retrievalTokensSaved",
- "name": "retrievalTokensSaved",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L111-L117",
- "signature": "function retrievalTokensSaved(ask: AskJson, cap = 5): number",
- "exported": true,
- "origin": "ast",
- "body_hash": "fcfb9a5c94f35b59d228ea34edb8435c2f110e25c5a12ad572ec47646166d99a",
- "summary_state": "ready",
- "summary": "Calculates the number of tokens saved by using a retrieval pack instead of reading files in full, based on the hits and baseline size.",
- "crux": {
- "code": " return base > pack ? base - pack : 0;",
- "span": "L116-L116"
- }
- },
- {
- "id": "src/claude/format.ts#tokensOf",
- "name": "tokensOf",
- "kind": "function",
- "path": "src/claude/format.ts",
- "span": "L86-L86",
- "signature": "function tokensOf(chars: number): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "a72a89f1099c37bae9e03a82e42ac3c2040789815176e99511f9bd5e31cbbe32",
- "summary_state": "ready",
- "summary": "Calculates the number of tokens based on character count, facilitating token management in retrieval processes.",
- "crux": null
- },
- {
- "id": "src/claude/hooks.ts",
- "name": "hooks.ts",
- "kind": "file",
- "path": "src/claude/hooks.ts",
- "span": "L1-L187",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "fa521cf3393ae31b324f2a615f156e387f402c1f4bc1f0addb3cf521f1eced9b",
- "chars": 8866,
- "summary_state": "stale",
- "summary": "Handles various events related to the Graft system, including session management and user prompts.",
- "crux": {
- "code": "export async function main(event: string): Promise<void> {\n const input = readStdin();\n const dir = projectDir(input);\n\n if (event === 'session-start') {\n try {\n const idx = readFileSync(join(dir, 'graft', 'INDEX.md'), 'utf8');\n emit('SessionStart', formatOrientation(idx));\n } catch { /* no INDEX.md — skip */ }\n return;\n }\n",
- "span": "L75-L86"
- }
- },
- {
- "id": "src/claude/hooks.ts#checkStaleCount",
- "name": "checkStaleCount",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L48-L52",
- "signature": "function checkStaleCount(dir: string): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "d805c2f6af0f8a76196f80902c408ebe14fd46fb43a79b3944af2bd3c11e1d6a",
- "summary_state": "ready",
- "summary": "Counts the number of changes in the graft graph to determine if it is stale.",
- "crux": {
- "code": " const r = graftJson(dir, ['check', '.', '--json']);\n const g = r?.graph ?? {};\n return (g.changed?.length ?? 0) + (g.added?.length ?? 0) + (g.removed?.length ?? 0);",
- "span": "L43-L45"
- }
- },
- {
- "id": "src/claude/hooks.ts#emit",
- "name": "emit",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L53-L55",
- "signature": "function emit(eventName: string, additionalContext: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "9f7384f6c6c8562520fdc78864670fe66220557504ab0c21cc4cc2278194c2f1",
- "summary_state": "ready",
- "summary": "Outputs a JSON object to standard output for event tracking.",
- "crux": {
- "code": " process.stdout.write(JSON.stringify({ hookSpecificOutput: { hookEventName: eventName, additionalContext } }));\n}",
- "span": "L48-L49"
- }
- },
- {
- "id": "src/claude/hooks.ts#graftJson",
- "name": "graftJson",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L29-L47",
- "signature": "function graftJson(dir: string, args: string[]): any | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "0f44fc5ecba2d5f8893679c6d91659f02339c731d4ef65f8b29cee72dbdf034f",
- "summary_state": "stale",
- "summary": "Executes a command to retrieve JSON output from the graft CLI, handling errors gracefully.",
- "crux": {
- "code": " const out = execFileSync(process.execPath, [graftCliPath(), ...args],\n { cwd: dir, encoding: 'utf8', timeout: 8000, stdio: ['ignore', 'pipe', 'ignore'] });\n return JSON.parse(out);\n } catch (e: any) {\n // `graft check` exits non-zero when the graph is stale (by design) but still\n // prints valid JSON to stdout; recover it from the thrown error before giving up.\n if (e && typeof e.stdout === 'string' && e.stdout.trim()) {\n try { return JSON.parse(e.stdout); } catch { /* not JSON — fall through */ }\n }\n return null;\n }",
- "span": "L30-L40"
- }
- },
- {
- "id": "src/claude/hooks.ts#handlePostEdit",
- "name": "handlePostEdit",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L57-L63",
- "signature": "async function handlePostEdit(input: any, dir: string): Promise<void>",
- "exported": false,
- "origin": "ast",
- "body_hash": "afa0ad391dd4412cd4df9af9ce59983fa67796d316afeabef1275abc9889284d",
- "summary_state": "ready",
- "summary": "Handles post-edit events by updating stats and emitting relevant information.",
- "crux": {
- "code": " patchStats(dir, { dirty: true, staleCount: checkStaleCount(dir), lastFile: basename(file) });\n const w = readWiring(dir);\n if (w) { const br = formatBlastRadius(w, file); if (br) emit('PostToolUse', br); }",
- "span": "L54-L56"
- }
- },
- {
- "id": "src/claude/hooks.ts#handleStop",
- "name": "handleStop",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L125-L139",
- "signature": "function handleStop(dir: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "ef731173b05a469942f641ab924f540a6fdfede444916092a16464150b10bd7b",
- "summary_state": "ready",
- "summary": "Handles the stop event by syncing state if necessary.",
- "crux": {
- "code": " if (stats?.dirty && acquireLock(dir)) {\n patchStats(dir, { syncing: true });\n const child = spawn(process.execPath, [syncRun, dir], { detached: true, stdio: 'ignore' });\n child.unref();\n }",
- "span": "L68-L72"
- }
- },
- {
- "id": "src/claude/hooks.ts#handleToolSavings",
- "name": "handleToolSavings",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L113-L123",
- "signature": "function handleToolSavings(input: any, dir: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "c29390cdd2879e48a0c05210ae252be3a9e8b615eae3ffd2b025f296841e7355",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/claude/hooks.ts#lastFileScopeHint",
- "name": "lastFileScopeHint",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L80-L105",
- "signature": "function lastFileScopeHint(dir: string, lastFile: string | null | undefined): string | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "6677b6aef1edad81e718c13b76983e6f5ec7664878f04382a55691000590dc04",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/claude/hooks.ts#main",
- "name": "main",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L141-L186",
- "signature": "async function main(event: string): Promise<void>",
- "exported": true,
- "origin": "ast",
- "body_hash": "3e8594154785cb8910fc39de294ab1b7e557e35587b9baddfe9fe995acb5017d",
- "summary_state": "stale",
- "summary": "Main entry point for handling various events and orchestrating the application logic.",
- "crux": {
- "code": " if (event === 'session-start') {\n try {\n const idx = readFileSync(join(dir, 'graft', 'INDEX.md'), 'utf8');\n emit('SessionStart', formatOrientation(idx));\n } catch { /* no INDEX.md — skip */ }\n return;\n }\n\n if (event === 'post-edit') { await handlePostEdit(input, dir); return; }\n\n if (event === 'stop') { handleStop(dir); return; }\n",
- "span": "L79-L90"
- }
- },
- {
- "id": "src/claude/hooks.ts#projectDir",
- "name": "projectDir",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L22-L24",
- "signature": "function projectDir(input: any): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "4aa298cb59c252e2c2abe9c18294279b32f78eb55de1a883efd34affdf49cef8",
- "summary_state": "ready",
- "summary": "Determines the project directory based on environment variables or input parameters.",
- "crux": {
- "code": " return process.env.CLAUDE_PROJECT_DIR || input.cwd || process.cwd();\n}",
- "span": "L22-L23"
- }
- },
- {
- "id": "src/claude/hooks.ts#readStdin",
- "name": "readStdin",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L15-L19",
- "signature": "function readStdin(): any",
- "exported": false,
- "origin": "ast",
- "body_hash": "a0c855d260852d9ede8e16aa40adaf829ecc549c5c7ea5f23a128754abc363a0",
- "summary_state": "ready",
- "summary": "Reads input from standard input, handling test seams and parsing JSON.",
- "crux": {
- "code": " const raw = seam !== undefined ? seam : safeReadFd0();\n try { return JSON.parse(raw); } catch { return {}; }",
- "span": "L16-L17"
- }
- },
- {
- "id": "src/claude/hooks.ts#safeReadFd0",
- "name": "safeReadFd0",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L20-L20",
- "signature": "function safeReadFd0(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "7594a29f0e0cf58a56f3730cad00dc40d449de18fc2baf18deb20d6457a63c15",
- "summary_state": "ready",
- "summary": "Safely reads from the standard input file descriptor, returning an empty string on failure.",
- "crux": null
- },
- {
- "id": "src/claude/hooks.ts#underGraft",
- "name": "underGraft",
- "kind": "function",
- "path": "src/claude/hooks.ts",
- "span": "L25-L28",
- "signature": "function underGraft(dir: string, file: string): boolean",
- "exported": true,
- "origin": "ast",
- "body_hash": "b87aa3e7ba9049438b7750b8dc3767fc4a2630e3a347e20900d1beaea543df04",
- "summary_state": "ready",
- "summary": "Checks if a given file is part of the graft project structure.",
- "crux": {
- "code": " const rel = file.startsWith(dir) ? file.slice(dir.length) : file;\n return rel.replace(/^[/\\\\]+/, '').replace(/\\\\/g, '/').startsWith('graft/');",
- "span": "L25-L26"
- }
- },
- {
- "id": "src/claude/init.ts",
- "name": "init.ts",
- "kind": "file",
- "path": "src/claude/init.ts",
- "span": "L1-L58",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "af0c4b0aa75bc1753bfa634e939200cb96539b0388e22549ac458267cbd0ab7e",
- "chars": 2762,
- "summary_state": "stale",
- "summary": "Initializes the Claude environment by setting up necessary directories, configuration files, and shims for the application.",
- "crux": {
- "code": "export function runInit(dir: string, opts: { build?: boolean; cliPath?: string } = {}): InitResult {\n const helpersDir = join(dir, '.claude', 'helpers');\n mkdirSync(helpersDir, { recursive: true });\n\n const settingsPath = join(dir, '.claude', 'settings.json');\n let existing: Record<string, any> = {};\n try { existing = JSON.parse(readFileSync(settingsPath, 'utf8')); } catch { /* none/invalid → start fresh */ }\n const { merged, warnings } = mergeGraftSettings(existing);\n writeFileSync(settingsPath, `${JSON.stringify(merged, null, 2)}\\n`);\n\n const sl = join(helpersDir, 'graft-statusline.cjs');\n const hk = join(helpersDir, 'graft-hooks.cjs');",
- "span": "L17-L28"
- }
- },
- {
- "id": "src/claude/init.ts#InitResult",
- "name": "InitResult",
- "kind": "interface",
- "path": "src/claude/init.ts",
- "span": "L10-L18",
- "signature": "interface InitResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "648322df342d1b35df7d6be1f7626e5deff07a53a4cd67d247b681bdc3db3386",
- "summary_state": "stale",
- "summary": "Defines the structure of the result returned by the runInit function, encapsulating settings, shims, skill, warnings, and build status.",
- "crux": null
- },
- {
- "id": "src/claude/init.ts#runInit",
- "name": "runInit",
- "kind": "function",
- "path": "src/claude/init.ts",
- "span": "L20-L57",
- "signature": "function runInit(dir: string, opts: { build?: boolean; cliPath?: string } = {}): InitResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "ea3853a573550bbd8095b416a8894cbbcfef1f264a41bb18ea37b17fa3475577",
- "summary_state": "stale",
- "summary": "Initializes the Claude environment by setting up necessary directories, merging settings, creating shims, and optionally building the project.",
- "crux": {
- "code": "export function runInit(dir: string, opts: { build?: boolean; cliPath?: string } = {}): InitResult {\n const helpersDir = join(dir, '.claude', 'helpers');\n mkdirSync(helpersDir, { recursive: true });\n\n const settingsPath = join(dir, '.claude', 'settings.json');\n let existing: Record<string, any> = {};\n try { existing = JSON.parse(readFileSync(settingsPath, 'utf8')); } catch { /* none/invalid → start fresh */ }\n const { merged, warnings } = mergeGraftSettings(existing);\n writeFileSync(settingsPath, `${JSON.stringify(merged, null, 2)}\\n`);\n\n const sl = join(helpersDir, 'graft-statusline.cjs');\n const hk = join(helpersDir, 'graft-hooks.cjs');",
- "span": "L17-L28"
- }
- },
- {
- "id": "src/claude/paths.ts",
- "name": "paths.ts",
- "kind": "file",
- "path": "src/claude/paths.ts",
- "span": "L1-L26",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "d4bde8a45859c88921abd6fd06c700199bf1feaf2e5487e8e0e217cf9dab5026",
- "chars": 1188,
- "summary_state": "ready",
- "summary": "This module provides utility functions to resolve paths for the graft CLI and related scripts, ensuring correct path resolution regardless of the installation context.",
- "crux": {
- "code": "export function graftCliPath(): string {\n return join(CLAUDE_DIR, '..', 'cli.js');\n}\n\n/** Absolute path to this package's `dist/claude` dir. Baked into the generated shims at\n * init time as their primary resolution candidate, so the statusline/hooks find graft\n * without runtime guesswork — correct regardless of how Node was installed. */\nexport function claudeDistDir(): string {\n return CLAUDE_DIR;\n}\n\n/** Absolute path to a sibling script in the claude dir (e.g. `sync-run.js`). */",
- "span": "L11-L22"
- }
- },
- {
- "id": "src/claude/paths.ts#claudeDistDir",
- "name": "claudeDistDir",
- "kind": "function",
- "path": "src/claude/paths.ts",
- "span": "L18-L20",
- "signature": "function claudeDistDir(): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "fa79e92f3473e4dc31dd9f505b0f76a76d1e8ba6820f39e1ebd23c217569fd64",
- "summary_state": "ready",
- "summary": "Returns the absolute path to the package's distribution directory, facilitating consistent access to resources without guesswork.",
- "crux": {
- "code": " return CLAUDE_DIR;",
- "span": "L19-L19"
- }
- },
- {
- "id": "src/claude/paths.ts#claudeScriptPath",
- "name": "claudeScriptPath",
- "kind": "function",
- "path": "src/claude/paths.ts",
- "span": "L23-L25",
- "signature": "function claudeScriptPath(name: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "168a58f498382a3a3b70191e87465ccd36d98fe67c050aedefa722e4601a4233",
- "summary_state": "ready",
- "summary": "Constructs the absolute path to a sibling script in the claude directory, enabling dynamic script resolution.",
- "crux": {
- "code": " return join(CLAUDE_DIR, name);",
- "span": "L24-L24"
- }
- },
- {
- "id": "src/claude/paths.ts#graftCliPath",
- "name": "graftCliPath",
- "kind": "function",
- "path": "src/claude/paths.ts",
- "span": "L11-L13",
- "signature": "function graftCliPath(): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "a89543a44c198c7ed91348d71ac004dae93303828aa241c0950ff982e7e14324",
- "summary_state": "ready",
- "summary": "Provides the absolute path to the graft CLI, ensuring it can be located regardless of the installation context.",
- "crux": {
- "code": " return join(CLAUDE_DIR, '..', 'cli.js');",
- "span": "L12-L12"
- }
- },
- {
- "id": "src/claude/settings-merge.ts",
- "name": "settings-merge.ts",
- "kind": "file",
- "path": "src/claude/settings-merge.ts",
- "span": "L1-L63",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "6f5516f451595ecb86078abd33dc47a92900fcf5e764200b26b068b412f62f2b",
- "chars": 3146,
- "summary_state": "stale",
- "summary": "Merges existing settings with new graft configurations, ensuring proper command hooks and permissions are set while avoiding conflicts.",
- "crux": {
- "code": "export function mergeGraftSettings(existing: Json): { merged: Json; warnings: string[] } {\n const merged: Json = { ...(existing ?? {}) };\n const warnings: string[] = [];\n\n if (!merged.statusLine) merged.statusLine = { type: 'command', command: SL_CMD };\n else if (merged.statusLine.command !== SL_CMD)\n warnings.push('Existing statusLine left untouched (a session allows only one). To use Graft, point it at .claude/helpers/graft-statusline.cjs.');\n\n if (!merged.subagentStatusLine) merged.subagentStatusLine = { type: 'command', command: SL_CMD };\n else if (merged.subagentStatusLine.command !== SL_CMD)\n warnings.push('Existing subagentStatusLine left untouched.');\n",
- "span": "L22-L33"
- }
- },
- {
- "id": "src/claude/settings-merge.ts#graftBlocks",
- "name": "graftBlocks",
- "kind": "function",
- "path": "src/claude/settings-merge.ts",
- "span": "L10-L24",
- "signature": "function graftBlocks(): Record<string, Json[]>",
- "exported": false,
- "origin": "ast",
- "body_hash": "e070fcf4acbe04f0ba2fd5c723b6ca72dea77bfc51b90e77cccb2124d3d59449",
- "summary_state": "stale",
- "summary": "Creates a mapping of events to their corresponding Graft command hooks for processing user actions.",
- "crux": {
- "code": " PostToolUse: { matcher: 'Write|Edit|MultiEdit', hooks: [{ type: 'command', command: hookCmd('post-edit'), timeout: 10000 }] },\n UserPromptSubmit: { hooks: [{ type: 'command', command: hookCmd('prompt'), timeout: 8000 }] },\n SessionStart: { hooks: [{ type: 'command', command: hookCmd('session-start'), timeout: 8000 }] },",
- "span": "L12-L14"
- }
- },
- {
- "id": "src/claude/settings-merge.ts#hookCmd",
- "name": "hookCmd",
- "kind": "function",
- "path": "src/claude/settings-merge.ts",
- "span": "L7-L9",
- "signature": "function hookCmd(arg: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "e9298ddcd47ce700591a4d358b92ada2ac0b935b5830b3f73352c9de90fee469",
- "summary_state": "ready",
- "summary": "Generates a command string to execute a specified hook in the Graft environment.",
- "crux": {
- "code": " return `node \"\\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/graft-hooks.cjs\" ${arg}`;",
- "span": "L8-L8"
- }
- },
- {
- "id": "src/claude/settings-merge.ts#isGraftHookEntry",
- "name": "isGraftHookEntry",
- "kind": "function",
- "path": "src/claude/settings-merge.ts",
- "span": "L25-L27",
- "signature": "function isGraftHookEntry(entry: Json): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "99d3b618293eccfb74c0e88c5671c484a54355792596c8b6c2856f8cb432814e",
- "summary_state": "ready",
- "summary": "Checks if a given entry is a Graft hook by inspecting its command reference.",
- "crux": {
- "code": " return JSON.stringify(entry ?? '').includes('graft-hooks.cjs');",
- "span": "L19-L19"
- }
- },
- {
- "id": "src/claude/settings-merge.ts#Json",
- "name": "Json",
- "kind": "type",
- "path": "src/claude/settings-merge.ts",
- "span": "L1-L1",
- "signature": "type Json = Record<string, any>;",
- "exported": false,
- "origin": "ast",
- "body_hash": "0c2b997e71a6ecf28fd3f46a0f9d4799bef1615b247ca3e471aad6b57e73189c",
- "summary_state": "ready",
- "summary": "Defines a flexible JSON type for various settings configurations.",
- "crux": null
- },
- {
- "id": "src/claude/settings-merge.ts#mergeGraftSettings",
- "name": "mergeGraftSettings",
- "kind": "function",
- "path": "src/claude/settings-merge.ts",
- "span": "L29-L62",
- "signature": "function mergeGraftSettings(existing: Json): { merged: Json; warnings: string[] }",
- "exported": true,
- "origin": "ast",
- "body_hash": "58794bc801bfb40081268ebe4759db6c809d81a619bc0a778604c153c525ed5c",
- "summary_state": "stale",
- "summary": "Merges existing settings with Graft-specific configurations, ensuring idempotency and compliance with Graft rules.",
- "crux": {
- "code": " if (!merged.statusLine) merged.statusLine = { type: 'command', command: SL_CMD };\n else if (merged.statusLine.command !== SL_CMD)\n warnings.push('Existing statusLine left untouched (a session allows only one). To use Graft, point it at .claude/helpers/graft-statusline.cjs.');\n\n if (!merged.subagentStatusLine) merged.subagentStatusLine = { type: 'command', command: SL_CMD };\n else if (merged.subagentStatusLine.command !== SL_CMD)\n warnings.push('Existing subagentStatusLine left untouched.');",
- "span": "L26-L32"
- }
- },
- {
- "id": "src/claude/shim-template.ts",
- "name": "shim-template.ts",
- "kind": "file",
- "path": "src/claude/shim-template.ts",
- "span": "L1-L64",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "53c468c5de89b06fb76439c756932592409eba5fc19ba07ff6a37403912033a9",
- "chars": 3141,
- "summary_state": "ready",
- "summary": "Generates shims to dynamically locate and execute the correct version of the @nanonets/graft package's entry points, ensuring compatibility across different installation methods.",
- "crux": {
- "code": "}",
- "span": "L56-L56"
- }
- },
- {
- "id": "src/claude/shim-template.ts#hooksShim",
- "name": "hooksShim",
- "kind": "function",
- "path": "src/claude/shim-template.ts",
- "span": "L63-L63",
- "signature": "function hooksShim(bakedDir: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "8ea2753059a8ae115b10aaa971482641a2462ad97d8c79dbd7a78cbe94c9213a",
- "summary_state": "ready",
- "summary": "Creates a shim for the hooks entry of the graft package, enabling its execution with command-line arguments.",
- "crux": null
- },
- {
- "id": "src/claude/shim-template.ts#shim",
- "name": "shim",
- "kind": "function",
- "path": "src/claude/shim-template.ts",
- "span": "L16-L60",
- "signature": "function shim(entryFile: string, call: string, bakedDir: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "bc007e4fd1420dea4e01d8ae1c8994ea3e04c75b62ddc76b8a5fd671bab71dd3",
- "summary_state": "ready",
- "summary": "Generates a script that dynamically locates and executes a specified entry file from the installed graft package, ensuring compatibility across various installation methods.",
- "crux": {
- "code": "// The dist/claude dir of @nanonets/graft resolved from a base whose node_modules is searched.\nfunction fromPkg(base) {\n try {\n const pkg = require.resolve('@nanonets/graft/package.json', { paths: [base] });\n return path.join(path.dirname(pkg), 'dist', 'claude');\n } catch { return null; }\n}\n\n// The global node_modules dir per npm (handles Homebrew/Windows/volta). Queried on demand.\nfunction globalRoot() {\n try {\n const root = execFileSync('npm', ['root', '-g'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], shell: process.platform === 'win32' }).trim();",
- "span": "L25-L36"
- }
- },
- {
- "id": "src/claude/shim-template.ts#statuslineShim",
- "name": "statuslineShim",
- "kind": "function",
- "path": "src/claude/shim-template.ts",
- "span": "L62-L62",
- "signature": "function statuslineShim(bakedDir: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "1923650d5135a05cad7f41616e3c1e7c5d8af844798ad9fa9cbcb77299de5a3c",
- "summary_state": "ready",
- "summary": "Creates a shim for the statusline entry of the graft package, facilitating its execution in a consistent manner.",
- "crux": null
- },
- {
- "id": "src/claude/skill-template.ts",
- "name": "skill-template.ts",
- "kind": "file",
- "path": "src/claude/skill-template.ts",
- "span": "L1-L102",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "80ea21212897a7c0e6b94029d75b3e4567f24a3496e6c72d290c978cc2bbbc3d",
- "chars": 5768,
- "summary_state": "stale",
- "summary": "Provides a structured template for the graft Claude Code skill, enabling efficient onboarding and understanding of the codebase.",
- "crux": {
- "code": "export function skillTemplate(): string {\n return `---\nname: graft\ndescription: This repo is indexed by graft/. For ANY task here — understanding\n how something works, finding where code lives, or scoping a change — get your\n context from graft before grepping or reading source files.\n---\n\n# graft\n\nThis repo's code is summarised in \\`graft/\\` — small markdown nodes, each\nexplaining one part in plain prose and naming the exact files and line-spans it",
- "span": "L6-L17"
- }
- },
- {
- "id": "src/claude/skill-template.ts#skillTemplate",
- "name": "skillTemplate",
- "kind": "function",
- "path": "src/claude/skill-template.ts",
- "span": "L6-L101",
- "signature": "function skillTemplate(): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "bc06430568ac09424dd30bc8afca2a5321183ebf0fb46f2804aeca3f89116b54",
- "summary_state": "stale",
- "summary": "Generates a markdown string that serves as a comprehensive guide for using the graft tool effectively within a code repository.",
- "crux": {
- "code": "export function skillTemplate(): string {\n return `---\nname: graft\ndescription: This repo is indexed by graft/. For ANY task here — understanding\n how something works, finding where code lives, or scoping a change — get your\n context from graft before grepping or reading source files.\n---\n\n# graft\n\nThis repo's code is summarised in \\`graft/\\` — small markdown nodes, each\nexplaining one part in plain prose and naming the exact files and line-spans it",
- "span": "L6-L17"
- }
- },
- {
- "id": "src/claude/state.ts",
- "name": "state.ts",
- "kind": "file",
- "path": "src/claude/state.ts",
- "span": "L1-L81",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "f8b8d93b534be15a3d71565e63a63caa302f036348d20dcd645fb49f25db3f61",
- "chars": 3650,
- "summary_state": "ready",
- "summary": "Manages application state and session data, including statistics and file locking mechanisms.",
- "crux": {
- "code": "export function patchStats(d: string, patch: Partial<Stats>): Stats {\n const next: Stats = { ...(readStats(d) ?? emptyStats()), ...patch };\n writeStats(d, next);\n return next;",
- "span": "L51-L54"
- }
- },
- {
- "id": "src/claude/state.ts#acquireLock",
- "name": "acquireLock",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L63-L79",
- "signature": "function acquireLock(d: string): boolean",
- "exported": true,
- "origin": "ast",
- "body_hash": "d10ac8134d1cc35d9bd14414ba7608b48646c70492b96b624f1e140f86dbd4b6",
- "summary_state": "ready",
- "summary": "Attempts to acquire a lock for the specified directory to prevent concurrent access issues.",
- "crux": {
- "code": "export function acquireLock(d: string): boolean {\n const p = lockPath(d);\n mkdirSync(cacheDir(d), { recursive: true });\n const payload = JSON.stringify({ pid: process.pid, at: new Date().toISOString() });\n try {\n writeFileSync(p, payload, { flag: 'wx' }); // atomic exclusive create\n return true;\n } catch (e: any) {\n if (e?.code !== 'EEXIST') throw e;\n let stale: boolean;\n try { stale = Date.now() - statSync(p).mtimeMs >= LOCK_STALE_MS; } catch { stale = true; }\n if (!stale) return false;",
- "span": "L63-L74"
- }
- },
- {
- "id": "src/claude/state.ts#cacheDir",
- "name": "cacheDir",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L32-L32",
- "signature": "function cacheDir(projectDir: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "c5b57c650fe2af36c19b2cad9b398f6c77e16046d173394d0710edde24c516f2",
- "summary_state": "ready",
- "summary": "Constructs the path to the cache directory for a given project.",
- "crux": {
- "code": "export function cacheDir(projectDir: string): string { return join(projectDir, 'graft', '.cache'); }",
- "span": "L32-L32"
- }
- },
- {
- "id": "src/claude/state.ts#emptySession",
- "name": "emptySession",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L28-L30",
- "signature": "function emptySession(): SessionState",
- "exported": false,
- "origin": "ast",
- "body_hash": "b08d2c899575a022887655dd89d27362e526c5f66dc5c41b0766da5f918c7b31",
- "summary_state": "ready",
- "summary": "Creates and returns an initial empty SessionState object to reset session tracking.",
- "crux": {
- "code": "function emptySession(): SessionState {\n return { lastQuery: null, perAgentQuery: {}, graftReads: 0, sourceReads: 0, savedTokens: 0, injectedPointers: [] };\n}",
- "span": "L28-L30"
- }
- },
- {
- "id": "src/claude/state.ts#emptyStats",
- "name": "emptyStats",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L24-L27",
- "signature": "function emptyStats(): Stats",
- "exported": true,
- "origin": "ast",
- "body_hash": "f507d8c6bb5222d97af97220bed44ebab58221672fe4c0f1e43c410c7ad6f03f",
- "summary_state": "ready",
- "summary": "Creates and returns an initial empty Stats object to reset statistics tracking.",
- "crux": {
- "code": "export function emptyStats(): Stats {\n return { nodeCount: 0, edgeCount: 0, languages: [], totalCount: 0, readyCount: 0,\n staleCount: 0, dirty: false, syncing: false, syncedAt: null, lastFile: null };\n}",
- "span": "L24-L27"
- }
- },
- {
- "id": "src/claude/state.ts#lockPath",
- "name": "lockPath",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L35-L35",
- "signature": "function lockPath(d: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "d9e771038564b59c8e77023262cf3b4cb19cb67a11bdffd03596b55ba16abd19",
- "summary_state": "ready",
- "summary": "Generates the file path for the synchronization lock used in the caching mechanism.",
- "crux": {
- "code": "function lockPath(d: string): string { return join(cacheDir(d), '.sync.lock'); }",
- "span": "L35-L35"
- }
- },
- {
- "id": "src/claude/state.ts#patchStats",
- "name": "patchStats",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L51-L55",
- "signature": "function patchStats(d: string, patch: Partial<Stats>): Stats",
- "exported": true,
- "origin": "ast",
- "body_hash": "44a7279d2463dc0c60b5992a1bbf3ca152a81fbf281ba3181f66306ea47bac0b",
- "summary_state": "ready",
- "summary": "Updates the existing statistics with a patch and writes the updated stats back to storage.",
- "crux": {
- "code": "export function patchStats(d: string, patch: Partial<Stats>): Stats {\n const next: Stats = { ...(readStats(d) ?? emptyStats()), ...patch };\n writeStats(d, next);\n return next;\n}",
- "span": "L51-L55"
- }
- },
- {
- "id": "src/claude/state.ts#readJson",
- "name": "readJson",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L37-L39",
- "signature": "function readJson<T>(p: string): T | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "70bcbc68383bedc607095d101f70d8bf5a7c0bfa84d2fec3b9583674646386e0",
- "summary_state": "ready",
- "summary": "Reads and parses a JSON file, returning the content or null if an error occurs.",
- "crux": {
- "code": "function readJson<T>(p: string): T | null {\n try { return JSON.parse(readFileSync(p, 'utf8')) as T; } catch { return null; }\n}",
- "span": "L37-L39"
- }
- },
- {
- "id": "src/claude/state.ts#readSession",
- "name": "readSession",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L56-L58",
- "signature": "function readSession(d: string, id: string): SessionState",
- "exported": true,
- "origin": "ast",
- "body_hash": "9c9ff7506f27585bde3a8218144cc25959b1b5a460f65eedbec712dce641f391",
- "summary_state": "ready",
- "summary": "Reads the session data from the specified path, returning an empty session if not found.",
- "crux": {
- "code": "export function readSession(d: string, id: string): SessionState {\n return readJson<SessionState>(sessionPath(d, id)) ?? emptySession();\n}",
- "span": "L56-L58"
- }
- },
- {
- "id": "src/claude/state.ts#readStats",
- "name": "readStats",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L47-L47",
- "signature": "function readStats(d: string): Stats | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "0fc71d400d255e986f4914c0a59304ed5b6d39684e7ddbae7e72fa4edd56a633",
- "summary_state": "ready",
- "summary": "Reads the statistics from the specified path, returning null if not found.",
- "crux": {
- "code": "export function readStats(d: string): Stats | null { return readJson<Stats>(statsPath(d)); }",
- "span": "L47-L47"
- }
- },
- {
- "id": "src/claude/state.ts#releaseLock",
- "name": "releaseLock",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L80-L80",
- "signature": "function releaseLock(d: string): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "0e65162ca2e768f56fcd08d222fb831dc50e2c8f69bf8e3a4b568178d3efb7bb",
- "summary_state": "ready",
- "summary": "Releases the lock for the specified directory, allowing other processes to access it.",
- "crux": {
- "code": "export function releaseLock(d: string): void { try { rmSync(lockPath(d)); } catch { /* already gone */ } }",
- "span": "L80-L80"
- }
- },
- {
- "id": "src/claude/state.ts#sessionPath",
- "name": "sessionPath",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L34-L34",
- "signature": "function sessionPath(d: string, id: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "2cb9cb73fc21b0857099f40d2df6a5b62657b5464ba8830cda3edd015ef1ccc3",
- "summary_state": "ready",
- "summary": "Generates the file path for storing session data in JSON format.",
- "crux": {
- "code": "function sessionPath(d: string, id: string): string { return join(cacheDir(d), 'session', `${id}.json`); }",
- "span": "L34-L34"
- }
- },
- {
- "id": "src/claude/state.ts#SessionState",
- "name": "SessionState",
- "kind": "interface",
- "path": "src/claude/state.ts",
- "span": "L10-L20",
- "signature": "interface SessionState",
- "exported": true,
- "origin": "ast",
- "body_hash": "71b7141bbad2edaaeb5de514b603e2f56d62428dfe0da720818a505a19b96c52",
- "summary_state": "ready",
- "summary": "Defines the structure for maintaining the state of a session, including queries and token savings.",
- "crux": {
- "code": "export interface SessionState {\n lastQuery: string | null;\n perAgentQuery: Record<string, string>;\n graftReads: number; sourceReads: number;\n /** Cumulative tokens saved this session via `ask --source` retrieval (est.). */\n savedTokens: number;\n /** Pointers the prompt hook already injected this session (novelty gate:\n * a hit whose pointer was shown once is never re-injected). Optional so\n * session files written before this field still parse. */\n injectedPointers?: string[];\n}",
- "span": "L10-L20"
- }
- },
- {
- "id": "src/claude/state.ts#Stats",
- "name": "Stats",
- "kind": "interface",
- "path": "src/claude/state.ts",
- "span": "L4-L9",
- "signature": "interface Stats",
- "exported": true,
- "origin": "ast",
- "body_hash": "c6f7b600be3741c9535991dad2a97f36768b6376460c696df32a279008044ab0",
- "summary_state": "ready",
- "summary": "Defines the structure for tracking various statistics related to nodes and edges in the system.",
- "crux": {
- "code": "export interface Stats {\n nodeCount: number; edgeCount: number; languages: string[];\n totalCount: number; readyCount: number;\n staleCount: number; dirty: boolean; syncing: boolean;\n syncedAt: string | null; lastFile: string | null;\n}",
- "span": "L4-L9"
- }
- },
- {
- "id": "src/claude/state.ts#statsPath",
- "name": "statsPath",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L33-L33",
- "signature": "function statsPath(d: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "82bf554697f883d634f98df066c106f57a2dd1f90f5d2ff5575f04ae5237a829",
- "summary_state": "ready",
- "summary": "Generates the file path for storing statistics in JSON format.",
- "crux": {
- "code": "function statsPath(d: string): string { return join(cacheDir(d), 'stats.json'); }",
- "span": "L33-L33"
- }
- },
- {
- "id": "src/claude/state.ts#writeJsonAtomic",
- "name": "writeJsonAtomic",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L40-L45",
- "signature": "function writeJsonAtomic(p: string, value: unknown): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "52709eed6470bfb5239dc6472ae93c63768fa95d1bc308cadc7f2c99f4961ba6",
- "summary_state": "ready",
- "summary": "Writes a JSON object to a file atomically, ensuring no data corruption during the write process.",
- "crux": {
- "code": "function writeJsonAtomic(p: string, value: unknown): void {\n mkdirSync(dirname(p), { recursive: true });\n const tmp = `${p}.${process.pid}.tmp`;\n writeFileSync(tmp, JSON.stringify(value, null, 2));\n renameSync(tmp, p);\n}",
- "span": "L40-L45"
- }
- },
- {
- "id": "src/claude/state.ts#writeSession",
- "name": "writeSession",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L59-L61",
- "signature": "function writeSession(d: string, id: string, s: SessionState): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "a8eead65e532c3c1791cffad444c6fd7622cdb054e1eaae5cf7e441a83d58b81",
- "summary_state": "ready",
- "summary": "Writes the session data to the specified path in JSON format.",
- "crux": {
- "code": "export function writeSession(d: string, id: string, s: SessionState): void {\n writeJsonAtomic(sessionPath(d, id), s);\n}",
- "span": "L59-L61"
- }
- },
- {
- "id": "src/claude/state.ts#writeStats",
- "name": "writeStats",
- "kind": "function",
- "path": "src/claude/state.ts",
- "span": "L48-L48",
- "signature": "function writeStats(d: string, s: Stats): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "9be95135d233dd6454caab02396b7a742dd79d3f7fc3bf7eb4ddc3d5991b56d6",
- "summary_state": "ready",
- "summary": "Writes the provided statistics to the specified path in JSON format.",
- "crux": {
- "code": "export function writeStats(d: string, s: Stats): void { writeJsonAtomic(statsPath(d), s); }",
- "span": "L48-L48"
- }
- },
- {
- "id": "src/claude/stats.ts",
- "name": "stats.ts",
- "kind": "file",
- "path": "src/claude/stats.ts",
- "span": "L1-L26",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "fc205923682e656d3e68bf301ba25702b827262f12057910615b4b648de3338b",
- "chars": 853,
- "summary_state": "ready",
- "summary": "This module provides functions to read wiring data from a JSON file and compute statistics about graph nodes and edges, facilitating analysis of project structure.",
- "crux": {
- "code": "export function computeStats(\n w: GraphV1,\n): Pick<Stats, 'nodeCount' | 'edgeCount' | 'languages' | 'totalCount' | 'readyCount'> {\n const nodes = w.nodes ?? [];\n const edges = w.edges ?? [];\n const readyCount = nodes.filter((n) => n.summary_state === 'ready').length;\n return {\n nodeCount: w.meta?.nodeCount ?? nodes.length,\n edgeCount: w.meta?.edgeCount ?? edges.length,\n languages: w.meta?.languages ?? [],\n totalCount: nodes.length,\n readyCount,",
- "span": "L12-L23"
- }
- },
- {
- "id": "src/claude/stats.ts#computeStats",
- "name": "computeStats",
- "kind": "function",
- "path": "src/claude/stats.ts",
- "span": "L12-L25",
- "signature": "function computeStats( w: GraphV1, ): Pick<Stats, 'nodeCount' | 'edgeCount' | 'languages' | 'totalCount' | 'readyCount'>",
- "exported": true,
- "origin": "ast",
- "body_hash": "87947ad507814b67ebf5ac5ad9517c223db582a48a1731c266e3a2d9eb1ce289",
- "summary_state": "ready",
- "summary": "Calculates and returns statistics about the nodes and edges in a graph, including counts and languages used.",
- "crux": {
- "code": " const readyCount = nodes.filter((n) => n.summary_state === 'ready').length;\n return {\n nodeCount: w.meta?.nodeCount ?? nodes.length,\n edgeCount: w.meta?.edgeCount ?? edges.length,\n languages: w.meta?.languages ?? [],\n totalCount: nodes.length,\n readyCount,",
- "span": "L17-L23"
- }
- },
- {
- "id": "src/claude/stats.ts#readWiring",
- "name": "readWiring",
- "kind": "function",
- "path": "src/claude/stats.ts",
- "span": "L6-L10",
- "signature": "function readWiring(projectDir: string): GraphV1 | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "af195cd730aedc42089766e76e9e82876adbc6ee689b7b06626ad3aa90ed9ac4",
- "summary_state": "ready",
- "summary": "Loads and parses the wiring configuration from a JSON file, returning the graph structure or null if an error occurs.",
- "crux": {
- "code": " return JSON.parse(readFileSync(join(projectDir, 'graft', '.graph', 'wiring.json'), 'utf8')) as GraphV1;\n } catch { return null; }",
- "span": "L8-L9"
- }
- },
- {
- "id": "src/claude/statusline.ts",
- "name": "statusline.ts",
- "kind": "file",
- "path": "src/claude/statusline.ts",
- "span": "L1-L34",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "0708f2f773f65b931d488688d898c56344cd930fae1af6614a579e6fb47fae16",
- "chars": 1668,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/claude/statusline.ts#main",
- "name": "main",
- "kind": "function",
- "path": "src/claude/statusline.ts",
- "span": "L22-L33",
- "signature": "function main(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "bddbcc037fe00e01bb76e40b1ceed83b0a308423cc286bc4b3cc95bf9c98c825",
- "summary_state": "ready",
- "summary": "Handles input and orchestrates the rendering of the status line or subagent output based on the provided context.",
- "crux": {
- "code": " if (agent) { process.stdout.write(renderSubagent(agent, session)); return; }\n const stats = resolveStats(dir);\n const raw = input?.context_window?.used_percentage;\n const ctxPct = typeof raw === 'number' ? Math.round(raw) : null;\n process.stdout.write(renderStatusline(stats, session, { ctxPct }).join('\\n'));",
- "span": "L28-L32"
- }
- },
- {
- "id": "src/claude/statusline.ts#resolveStats",
- "name": "resolveStats",
- "kind": "function",
- "path": "src/claude/statusline.ts",
- "span": "L14-L20",
- "signature": "function resolveStats(dir: string): Stats | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "080c7327bf26883f0575973010484e67024f57e455022563706d85582ca08891",
- "summary_state": "ready",
- "summary": "Determines the current statistics of the project, either from a cache or by reading the wiring graph directly.",
- "crux": {
- "code": " if (cached && cached.nodeCount > 0) return cached;\n const wiring = readWiring(dir);\n if (wiring) return { ...emptyStats(), ...computeStats(wiring) };",
- "span": "L16-L18"
- }
- },
- {
- "id": "src/claude/sync-run.ts",
- "name": "sync-run.ts",
- "kind": "file",
- "path": "src/claude/sync-run.ts",
- "span": "L1-L36",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "7ee672e67d3167a38e9577a673656f7958c69b48e62ec715850a9b14599a1d2a",
- "chars": 1291,
- "summary_state": "ready",
- "summary": "Coordinates the synchronous build process and updates the system state based on the build results.",
- "crux": {
- "code": "export function runSync(dir: string, build: (d: string) => void = realBuild): void {\n try {\n build(dir);\n const w = readWiring(dir);\n if (!w) { patchStats(dir, { syncing: false }); return; } // build ran but output unreadable — stay dirty, retry\n patchStats(dir, {\n dirty: false, staleCount: 0, syncing: false, syncedAt: new Date().toISOString(),\n ...computeStats(w),\n });\n } catch {\n patchStats(dir, { syncing: false }); // leave dirty=true; retry next turn\n } finally {",
- "span": "L13-L24"
- }
- },
- {
- "id": "src/claude/sync-run.ts#main",
- "name": "main",
- "kind": "function",
- "path": "src/claude/sync-run.ts",
- "span": "L29-L32",
- "signature": "function main(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "f4921fe8ea499e226c1d9a10d551ed55efcab2c954dfe44299c23bfe7c833b5d",
- "summary_state": "ready",
- "summary": "Initiates the synchronization process when the script is executed directly with a specified directory.",
- "crux": {
- "code": " const dir = process.argv[2];\n if (dir) runSync(dir);",
- "span": "L30-L31"
- }
- },
- {
- "id": "src/claude/sync-run.ts#realBuild",
- "name": "realBuild",
- "kind": "function",
- "path": "src/claude/sync-run.ts",
- "span": "L8-L11",
- "signature": "function realBuild(dir: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "9138acc16457c5ba012c6a206acc5e406dd226657f7915e57d6a215aa138a4e6",
- "summary_state": "ready",
- "summary": "Executes a build process for a specified directory, ensuring it adheres to specific constraints.",
- "crux": {
- "code": " execFileSync(process.execPath, [graftCliPath(), 'build', '.'],\n { cwd: dir, stdio: 'ignore', timeout: 120000 });",
- "span": "L9-L10"
- }
- },
- {
- "id": "src/claude/sync-run.ts#runSync",
- "name": "runSync",
- "kind": "function",
- "path": "src/claude/sync-run.ts",
- "span": "L13-L27",
- "signature": "function runSync(dir: string, build: (d: string) => void = realBuild): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "31c8d6625fe3855ae2c854d45a6364ad66759b9098596ddacb95b9b8f883fccc",
- "summary_state": "ready",
- "summary": "Coordinates the build process and updates the system state based on the build outcome.",
- "crux": {
- "code": " const w = readWiring(dir);\n if (!w) { patchStats(dir, { syncing: false }); return; } // build ran but output unreadable — stay dirty, retry\n patchStats(dir, {\n dirty: false, staleCount: 0, syncing: false, syncedAt: new Date().toISOString(),\n ...computeStats(w),\n });",
- "span": "L16-L21"
- }
- },
- {
- "id": "src/cli-epilogue.ts",
- "name": "cli-epilogue.ts",
- "kind": "file",
- "path": "src/cli-epilogue.ts",
- "span": "L1-L86",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a4534c83c0a600020421be92882a83db7fda3e1626a38702fc372bb3c523a232",
- "chars": 3220,
- "summary_state": "ready",
- "summary": "Generates a closing message for the `graft init` command, including next steps and a visual wordmark.",
- "crux": {
- "code": " const wordmark = WORDMARK_LINES.map((l) => (tty ? indigo(l) : l));\n if (graphBuilt && nodes !== undefined && edges !== undefined) {\n const stats = ` ${nodes.toLocaleString(\"en-US\")} nodes · ${edges.toLocaleString(\"en-US\")} edges`;\n wordmark[STATS_LINE_INDEX] += tty ? muted(stats) : stats;\n }\n\n const steps: Step[] = [\n ...(graphBuilt ? [] : [{ label: \"build the graph\", command: \"graft build\" }]),\n { label: \"restart your agent\", command: \"a new session picks up graft automatically\" },\n {\n label: \"code as usual\",\n command: \"ask your agent to fix a bug or explain a flow —\",",
- "span": "L48-L59"
- }
- },
- {
- "id": "src/cli-epilogue.ts#formatInitEpilogue",
- "name": "formatInitEpilogue",
- "kind": "function",
- "path": "src/cli-epilogue.ts",
- "span": "L44-L85",
- "signature": "function formatInitEpilogue(opts: InitEpilogueOptions): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "9d5c62edd17deaccdf340662903164b7d3d4d3d641a2de63e4d724d5c5414eae",
- "summary_state": "ready",
- "summary": "Formats and returns the next-steps epilogue for the `graft init` command based on provided options.",
- "crux": {
- "code": " const wordmark = WORDMARK_LINES.map((l) => (tty ? indigo(l) : l));\n if (graphBuilt && nodes !== undefined && edges !== undefined) {\n const stats = ` ${nodes.toLocaleString(\"en-US\")} nodes · ${edges.toLocaleString(\"en-US\")} edges`;\n wordmark[STATS_LINE_INDEX] += tty ? muted(stats) : stats;\n }\n\n const steps: Step[] = [\n ...(graphBuilt ? [] : [{ label: \"build the graph\", command: \"graft build\" }]),\n { label: \"restart your agent\", command: \"a new session picks up graft automatically\" },\n {\n label: \"code as usual\",\n command: \"ask your agent to fix a bug or explain a flow —\",",
- "span": "L48-L59"
- }
- },
- {
- "id": "src/cli-epilogue.ts#indigo",
- "name": "indigo",
- "kind": "function",
- "path": "src/cli-epilogue.ts",
- "span": "L23-L23",
- "signature": "indigo = (s: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "c8106154914b8f7b5e0f082446550f686fb2e88b53c90f669c27ee0fee6a09d8",
- "summary_state": "ready",
- "summary": "Applies a specific color formatting to a string for terminal output.",
- "crux": null
- },
- {
- "id": "src/cli-epilogue.ts#InitEpilogueOptions",
- "name": "InitEpilogueOptions",
- "kind": "interface",
- "path": "src/cli-epilogue.ts",
- "span": "L33-L40",
- "signature": "interface InitEpilogueOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "5cf812b2bbf455f2e65e722c3d550f588c328a471edf9578bdc6d9b897b770d8",
- "summary_state": "ready",
- "summary": "Specifies options for rendering the init epilogue, including graph status and node/edge counts.",
- "crux": null
- },
- {
- "id": "src/cli-epilogue.ts#muted",
- "name": "muted",
- "kind": "function",
- "path": "src/cli-epilogue.ts",
- "span": "L24-L24",
- "signature": "muted = (s: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "8e2dfbf259448165613a7d727cf2a32d4f097985d48e67393b809379fb3bb0d7",
- "summary_state": "ready",
- "summary": "Applies a muted color formatting to a string for terminal output.",
- "crux": null
- },
- {
- "id": "src/cli-epilogue.ts#Step",
- "name": "Step",
- "kind": "interface",
- "path": "src/cli-epilogue.ts",
- "span": "L26-L31",
- "signature": "interface Step",
- "exported": false,
- "origin": "ast",
- "body_hash": "a968435c9dfdf66413f2465053633289b8ec0b3be46d92eae9616521b0ec3873",
- "summary_state": "ready",
- "summary": "Defines the structure for a step in the epilogue, including a label and command.",
- "crux": null
- },
- {
- "id": "src/cli-meta.ts",
- "name": "cli-meta.ts",
- "kind": "file",
- "path": "src/cli-meta.ts",
- "span": "L1-L144",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "95ee44a152ed1936f0461b2452d9902fbf422555da9f01e8f5ff57fbb84a2f00",
- "chars": 5427,
- "summary_state": "ready",
- "summary": "This file provides support for version management and upgrade functionality for the graft package, including version resolution and reporting.",
- "crux": {
- "code": "const PKG_NAME = \"@nanonets/graft\";",
- "span": "L12-L12"
- }
- },
- {
- "id": "src/cli-meta.ts#formatUpgradeReport",
- "name": "formatUpgradeReport",
- "kind": "function",
- "path": "src/cli-meta.ts",
- "span": "L116-L127",
- "signature": "function formatUpgradeReport(result: UpgradeResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "55b6aaadead32c8dda3ff65edf58270fa52b937ae45c1c8c8067c416a3923c86",
- "summary_state": "ready",
- "summary": "Generates a user-friendly report after an upgrade attempt, indicating success or failure.",
- "crux": {
- "code": " return `✗ npm install -g ${PKG_NAME}@latest failed${result.errorMessage ? `: ${result.errorMessage}` : \"\"}`;\n }\n return `graft ${result.oldVersion ?? \"?\"} → ${result.newVersion ?? result.oldVersion ?? \"?\"}`;",
- "span": "L124-L126"
- }
- },
- {
- "id": "src/cli-meta.ts#formatVersionReport",
- "name": "formatVersionReport",
- "kind": "function",
- "path": "src/cli-meta.ts",
- "span": "L63-L73",
- "signature": "function formatVersionReport(current: string, latest: NpmViewResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "2bd4c8400f266d189b191ed9ec76a804b8bedf30e0cb2d3cb9d087a3da3001a9",
- "summary_state": "ready",
- "summary": "Formats a report on the current and latest package versions for user-friendly output.",
- "crux": {
- "code": " if (!latest.ok || !latest.version) {\n lines.push(\"latest: unreachable (offline?)\");\n } else if (latest.version === current) {\n lines.push(`latest on npm: ${current} ✓ up to date`);\n } else {\n lines.push(`latest on npm: ${latest.version} — run graft upgrade`);\n }\n return lines.join(\"\\n\");",
- "span": "L65-L72"
- }
- },
- {
- "id": "src/cli-meta.ts#getNpmViewVersion",
- "name": "getNpmViewVersion",
- "kind": "function",
- "path": "src/cli-meta.ts",
- "span": "L46-L60",
- "signature": "function getNpmViewVersion(pkgName: string = PKG_NAME, timeoutMs = 2000): NpmViewResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "7f899924ef65d988bcc484d526263978178eeb1df18c3f4e189a7b5553cdf346",
- "summary_state": "ready",
- "summary": "Fetches the version of a specified package from npm, handling errors gracefully to ensure reliability.",
- "crux": {
- "code": " if (res.error || res.signal || res.status !== 0) return { ok: false };\n const version = res.stdout?.trim();\n if (!version) return { ok: false };\n return { ok: true, version };",
- "span": "L53-L56"
- }
- },
- {
- "id": "src/cli-meta.ts#globalRoot",
- "name": "globalRoot",
- "kind": "function",
- "path": "src/cli-meta.ts",
- "span": "L76-L87",
- "signature": "function globalRoot(): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "5296e6bdbdafb80632f1587a2815e89717ae7eeaa7b5d384cbf164d6e73ffb45",
- "summary_state": "ready",
- "summary": "Determines the global npm node_modules directory, accommodating various installation layouts.",
- "crux": {
- "code": "function globalRoot(): string | null {\n try {\n const root = execFileSync(\"npm\", [\"root\", \"-g\"], {\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n shell: process.platform === \"win32\",\n }).trim();\n return root || null;\n } catch {\n return null;\n }",
- "span": "L76-L86"
- }
- },
- {
- "id": "src/cli-meta.ts#isRunningViaNpx",
- "name": "isRunningViaNpx",
- "kind": "function",
- "path": "src/cli-meta.ts",
- "span": "L35-L37",
- "signature": "function isRunningViaNpx(moduleUrl: string): boolean",
- "exported": true,
- "origin": "ast",
- "body_hash": "da893b35a5ddbd2d55bf3d9e0eb76737586227d1c80ca3ab3dba8b88a2357781",
- "summary_state": "ready",
- "summary": "Checks if the current module is executed from an npx cache directory, affecting how upgrades are handled.",
- "crux": {
- "code": " return fileURLToPath(moduleUrl).includes(\"/_npx/\");",
- "span": "L36-L36"
- }
- },
- {
- "id": "src/cli-meta.ts#NpmViewResult",
- "name": "NpmViewResult",
- "kind": "interface",
- "path": "src/cli-meta.ts",
- "span": "L39-L42",
- "signature": "interface NpmViewResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "90ac467dca193bc177b9a38002fc19687935fe93dee82c7f0667b7355905126e",
- "summary_state": "ready",
- "summary": "Defines the structure for the result of an npm view command, indicating success and the version of a package.",
- "crux": {
- "code": "export interface NpmViewResult {\n ok: boolean;\n version?: string;\n}",
- "span": "L39-L42"
- }
- },
- {
- "id": "src/cli-meta.ts#readCurrentVersion",
- "name": "readCurrentVersion",
- "kind": "function",
- "path": "src/cli-meta.ts",
- "span": "L27-L31",
- "signature": "function readCurrentVersion(moduleUrl: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "2853fef726b29eba13de30dd028e6e1f2eff130828dc1b0ba8278d408e112b68",
- "summary_state": "ready",
- "summary": "Retrieves the current version of the graft package from its package.json file, ensuring the application uses the correct version.",
- "crux": {
- "code": " const raw = readFileSync(resolvePackageJsonPath(moduleUrl), \"utf8\");\n const pkg = JSON.parse(raw) as { version?: string };\n return pkg.version ?? \"0.0.0\";",
- "span": "L28-L30"
- }
- },
- {
- "id": "src/cli-meta.ts#readGlobalInstalledVersion",
- "name": "readGlobalInstalledVersion",
- "kind": "function",
- "path": "src/cli-meta.ts",
- "span": "L92-L103",
- "signature": "function readGlobalInstalledVersion(pkgName: string = PKG_NAME): string | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "8d5197a36519f93e72ca3694601f4b7f8e4986badda334b6a58fd62faf02e456",
- "summary_state": "ready",
- "summary": "Reads the installed version of a package directly from the global node_modules directory, providing accurate local versioning.",
- "crux": {
- "code": " const pkg = JSON.parse(readFileSync(pkgJson, \"utf8\")) as { version?: string };\n return pkg.version ?? null;",
- "span": "L98-L99"
- }
- },
- {
- "id": "src/cli-meta.ts#resolvePackageJsonPath",
- "name": "resolvePackageJsonPath",
- "kind": "function",
- "path": "src/cli-meta.ts",
- "span": "L17-L24",
- "signature": "function resolvePackageJsonPath(moduleUrl: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "1f7a429abe093ad617757a954aac19d08c678691a5ecb54332b81fe0bb375752",
- "summary_state": "ready",
- "summary": "Determines the path to the package.json file for a given module URL, enabling access to package metadata.",
- "crux": {
- "code": " if (existsSync(c)) return c;\n }\n return candidates[0];",
- "span": "L21-L23"
- }
- },
- {
- "id": "src/cli-meta.ts#runUpgrade",
- "name": "runUpgrade",
- "kind": "function",
- "path": "src/cli-meta.ts",
- "span": "L132-L143",
- "signature": "function runUpgrade(moduleUrl: string): UpgradeResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "e97acdffcbf87e0d54489080b688476ec3b4ae5ecf0b76dd0e418c754e053e5c",
- "summary_state": "ready",
- "summary": "Executes the upgrade process for the graft package, ensuring the latest version is installed unless running via npx.",
- "crux": {
- "code": " const oldVersion = readCurrentVersion(moduleUrl);\n if (isRunningViaNpx(moduleUrl)) {\n return { ran: false, ok: true, oldVersion };\n }\n const res = spawnSync(\"npm\", [\"install\", \"-g\", `${PKG_NAME}@latest`], { stdio: \"inherit\" });\n if (res.error || (res.status ?? 1) !== 0) {\n return { ran: true, ok: false, oldVersion, errorMessage: res.error?.message };\n }\n const newVersion = readGlobalInstalledVersion(PKG_NAME) ?? getNpmViewVersion(PKG_NAME).version ?? oldVersion;\n return { ran: true, ok: true, oldVersion, newVersion };",
- "span": "L133-L142"
- }
- },
- {
- "id": "src/cli-meta.ts#UpgradeResult",
- "name": "UpgradeResult",
- "kind": "interface",
- "path": "src/cli-meta.ts",
- "span": "L105-L113",
- "signature": "interface UpgradeResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "c9bb4b9900b362a7a657417bd3b0ffb018623634cff10a318332c4d1bb83654e",
- "summary_state": "ready",
- "summary": "Defines the structure for the result of an upgrade operation, indicating whether it was executed and its success status.",
- "crux": {
- "code": "export interface UpgradeResult {\n /** True when `npm install -g` actually ran (false for the npx no-op path). */\n ran: boolean;\n ok: boolean;\n /** Present when ran=true and the install failed. */\n errorMessage?: string;\n oldVersion?: string;\n newVersion?: string;\n}",
- "span": "L105-L113"
- }
- },
- {
- "id": "src/cli.ts",
- "name": "cli.ts",
- "kind": "file",
- "path": "src/cli.ts",
- "span": "L1-L500",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "ac147b7c437f7c1a530c7d7f7ebb6262c9bce7252b5acbe41b4fc528411d9f59",
- "chars": 20773,
- "summary_state": "stale",
- "summary": "Defines the command-line interface for the graft tool, enabling various operations on the codebase's context graph.",
- "crux": {
- "code": "program\n .name(\"graft\")\n .description(\"Build a repo's context graph as linked markdown, and keep it in sync with the code.\")",
- "span": "L38-L40"
- }
- },
- {
- "id": "src/cli.ts#cliConfig",
- "name": "cliConfig",
- "kind": "function",
- "path": "src/cli.ts",
- "span": "L55-L64",
- "signature": "function cliConfig(): EngineConfig",
- "exported": false,
- "origin": "ast",
- "body_hash": "590dc12f9a414fbcb6b1fbf9ebfd22558f09f9026befe27f6e9ba777f69fe71f",
- "summary_state": "ready",
- "summary": "Constructs the configuration object for the engine based on CLI options, ensuring the correct parameters are used for graph generation.",
- "crux": {
- "code": " const o = program.opts<GlobalOpts>();\n return {\n contextDir: o.dir,\n provider: o.provider as ProviderKind | undefined,\n model: o.model,\n apiKey: o.apiKey,\n baseUrl: o.baseUrl,\n };\n}",
- "span": "L58-L66"
- }
- },
- {
- "id": "src/cli.ts#engineFrom",
- "name": "engineFrom",
- "kind": "function",
- "path": "src/cli.ts",
- "span": "L66-L66",
- "signature": "engineFrom = (): Graft",
- "exported": false,
- "origin": "ast",
- "body_hash": "257943edfa1daab9dbd9ab558b255d37be13bdee052d5a8c9f8bc274d4114a63",
- "summary_state": "stale",
- "summary": "Creates an instance of the Graft engine using the current CLI configuration, enabling graph operations.",
- "crux": {
- "code": "function engineFrom(): Graft {\n return new Graft(cliConfig());\n}",
- "span": "L68-L70"
- }
- },
- {
- "id": "src/cli.ts#fmt",
- "name": "fmt",
- "kind": "function",
- "path": "src/cli.ts",
- "span": "L101-L105",
- "signature": "fmt = (o: Record<string, number>)",
- "exported": false,
- "origin": "ast",
- "body_hash": "31c01b913d716a1932fff4c3a0e4a82dfa745d73f488f05b3d71910145bf98ad",
- "summary_state": "ready",
- "summary": "Formats a record of counts into a human-readable string for console output.",
- "crux": {
- "code": " const fmt = (o: Record<string, number>) =>\n Object.entries(o)\n .sort((a, b) => b[1] - a[1])\n .map(([k, n]) => `${n} ${k}`)\n .join(\", \");",
- "span": "L42-L46"
- }
- },
- {
- "id": "src/cli.ts#GlobalOpts",
- "name": "GlobalOpts",
- "kind": "interface",
- "path": "src/cli.ts",
- "span": "L46-L52",
- "signature": "interface GlobalOpts",
- "exported": false,
- "origin": "ast",
- "body_hash": "9cf4b199ef21dbd1a2ea64ac02508675e2a8b3958dbbdb2a741dd2322145bc2e",
- "summary_state": "ready",
- "summary": "Holds the global options for the CLI, allowing configuration of the context graph generation and LLM provider settings.",
- "crux": null
- },
- {
- "id": "src/context/build.ts",
- "name": "build.ts",
- "kind": "file",
- "path": "src/context/build.ts",
- "span": "L1-L350",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "8c614e5dc6b1ef2d6949016ce7480099f95f021ea6b0882f2919397f97a68ce7",
- "chars": 11678,
- "summary_state": "ready",
- "summary": "This file builds a context graph from a code repository by summarizing source files and synthesizing nodes.",
- "crux": {
- "code": "export async function buildContext(dir: string, opts: BuildOptions): Promise<BuildResult> {\n const root = resolve(dir);\n const outDir = contextDirFor(root, opts.contextDir);\n const exts = opts.extensions ?? CODE_EXTENSIONS;\n const files = walkDir(root)\n .filter((f) => exts.some((e) => f.toLowerCase().endsWith(e)))\n .filter((f) => !f.startsWith(outDir));\n\n const cache = loadCache(outDir);\n const result: BuildResult = {\n contextDir: outDir,\n files: 0,",
- "span": "L99-L110"
- }
- },
- {
- "id": "src/context/build.ts#batchBySize",
- "name": "batchBySize",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L269-L285",
- "signature": "function batchBySize(files: FileSummary[], budget: number): FileSummary[][]",
- "exported": false,
- "origin": "ast",
- "body_hash": "5875cfc2eae35e10fbe5105c48209f37d2b121b15dff5a0ebf1bb9dbf96f8eb7",
- "summary_state": "ready",
- "summary": "Groups file summaries into batches that fit within a specified character budget for processing.",
- "crux": {
- "code": "function batchBySize(files: FileSummary[], budget: number): FileSummary[][] {\n const batches: FileSummary[][] = [];\n let cur: FileSummary[] = [];\n let size = 0;\n for (const f of files) {\n const len = f.path.length + f.summary.length + 8;\n if (cur.length > 0 && size + len > budget) {\n batches.push(cur);\n cur = [];\n size = 0;\n }\n cur.push(f);",
- "span": "L269-L280"
- }
- },
- {
- "id": "src/context/build.ts#batchKey",
- "name": "batchKey",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L288-L295",
- "signature": "function batchKey(batch: FileSummary[], hashByPath: Map<string, string>): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "8fece338d989b714e96a275a7d4febdf2292a4a25590ce4b3ec73d6be5b45827",
- "summary_state": "ready",
- "summary": "Generates a stable key for a batch of file summaries based on their content hashes.",
- "crux": {
- "code": "function batchKey(batch: FileSummary[], hashByPath: Map<string, string>): string {\n return contentHash(\n batch\n .map((f) => `${f.path}:${hashByPath.get(f.path) ?? \"\"}`)\n .sort()\n .join(\"\\n\"),\n );\n}",
- "span": "L288-L295"
- }
- },
- {
- "id": "src/context/build.ts#BuildCache",
- "name": "BuildCache",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L78-L81",
- "signature": "interface BuildCache",
- "exported": false,
- "origin": "ast",
- "body_hash": "c359f1a92e6d72b2734f0ff2f8f38879f95eca1af6ddb47c4c6cab0f62a32133",
- "summary_state": "ready",
- "summary": "Stores cached summaries and synthesized nodes to optimize the build process.",
- "crux": {
- "code": "interface BuildCache {\n summaries: Record<string, { hash: string; summary: string }>;\n synth: Record<string, SynthNode[]>;\n}",
- "span": "L78-L81"
- }
- },
- {
- "id": "src/context/build.ts#buildContext",
- "name": "buildContext",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L99-L266",
- "signature": "async function buildContext(dir: string, opts: BuildOptions): Promise<BuildResult>",
- "exported": true,
- "origin": "ast",
- "body_hash": "e2afee780fd3be28d7cf55c8aa3fdfebc10ddb1ec63ffbe50f5e712a4625c0f2",
- "summary_state": "ready",
- "summary": "Main function that orchestrates the building of the context graph from the source files.",
- "crux": {
- "code": " // Phase 1: summarize each file, concurrent, content-hash cached.\n const work = await mapWithConcurrency(files, 8, async (file, i): Promise<FileWork | undefined> => {\n const rel = relative(root, file);\n opts.onProgress?.({ phase: \"summarize\", index: i, total: files.length, file: rel });\n let code: string;\n try {\n code = readFileSync(file, \"utf8\");\n } catch (err) {\n result.errors.push(`${rel}: ${errMsg(err)}`);\n return undefined;\n }\n const hash = contentHash(code);",
- "span": "L119-L130"
- }
- },
- {
- "id": "src/context/build.ts#BuildOptions",
- "name": "BuildOptions",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L54-L64",
- "signature": "interface BuildOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "a8c3781581f56372337a3c3ddd980b7be084f78b359820f8540ec384807c57a8",
- "summary_state": "ready",
- "summary": "Defines options for customizing the build process, including output directory and model settings.",
- "crux": {
- "code": "export interface BuildOptions {\n /** Override the output dir (default: `<root>/.context`). */\n contextDir?: string;\n /** Extensions to treat as code. Default: {@link CODE_EXTENSIONS}. */\n extensions?: string[];\n /** Human label for the model, recorded in the manifest (e.g. \"openrouter:openai/gpt-4o-mini\"). */\n model: string;\n summarizer: Summarizer;\n synthesizer: Synthesizer;\n onProgress?: (info: BuildProgress) => void;\n}",
- "span": "L54-L64"
- }
- },
- {
- "id": "src/context/build.ts#BuildProgress",
- "name": "BuildProgress",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L47-L52",
- "signature": "interface BuildProgress",
- "exported": true,
- "origin": "ast",
- "body_hash": "144303735947dfd0c43c5a58e2f8d53ad35ad62b438f65c29c51a56e1dfa56b2",
- "summary_state": "ready",
- "summary": "Tracks the progress of the build process across different phases.",
- "crux": {
- "code": " phase: \"summarize\" | \"synthesize\" | \"write\";\n index: number;\n total: number;\n file: string;\n}",
- "span": "L48-L52"
- }
- },
- {
- "id": "src/context/build.ts#BuildResult",
- "name": "BuildResult",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L66-L75",
- "signature": "interface BuildResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "5d4316f8de68fbeba849eaa7a8b12892855205f006361e2a32049e135cf9407e",
- "summary_state": "ready",
- "summary": "Holds the results of the build process, including counts of files and nodes processed.",
- "crux": {
- "code": "export interface BuildResult {\n contextDir: string;\n files: number;\n summarized: number;\n cached: number;\n batches: number;\n nodes: number;\n links: number;\n errors: string[];\n}",
- "span": "L66-L75"
- }
- },
- {
- "id": "src/context/build.ts#cachePath",
- "name": "cachePath",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L310-L312",
- "signature": "function cachePath(outDir: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "ff252b490e39f50d7aa97d0a9fc2ad6330248f194cf27cc31981329e833fb8aa",
- "summary_state": "ready",
- "summary": "Constructs the file path for the cache storage based on the output directory.",
- "crux": {
- "code": "function cachePath(outDir: string): string {\n return join(outDir, CACHE_DIR, \"summaries.json\");\n}",
- "span": "L310-L312"
- }
- },
- {
- "id": "src/context/build.ts#errMsg",
- "name": "errMsg",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L306-L308",
- "signature": "function errMsg(err: unknown): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "79993b725e730fcec35e4a32479a51dfba694b5c9bf900db729b6fc821caee71",
- "summary_state": "ready",
- "summary": "Formats error messages for better readability.",
- "crux": {
- "code": "function errMsg(err: unknown): string {\n return err instanceof Error ? err.message : String(err);\n}",
- "span": "L306-L308"
- }
- },
- {
- "id": "src/context/build.ts#FileWork",
- "name": "FileWork",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L83-L87",
- "signature": "interface FileWork",
- "exported": false,
- "origin": "ast",
- "body_hash": "06db66a9c25581eac975d533a049ce38bfed463080492389915feb84d9634171",
- "summary_state": "ready",
- "summary": "Represents the work done on each file during the build process, including its summary and hash.",
- "crux": {
- "code": "interface FileWork {\n rel: string;\n hash: string;\n summary?: string;\n}",
- "span": "L83-L87"
- }
- },
- {
- "id": "src/context/build.ts#loadCache",
- "name": "loadCache",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L314-L325",
- "signature": "function loadCache(outDir: string): BuildCache",
- "exported": false,
- "origin": "ast",
- "body_hash": "8f0f4b949cd4d774433b4043ef9d154fa5722e45d19f69fb4fb1843c4071a3af",
- "summary_state": "ready",
- "summary": "Loads the build cache from disk, returning existing summaries and synthesized nodes.",
- "crux": {
- "code": "function loadCache(outDir: string): BuildCache {\n const path = cachePath(outDir);\n if (existsSync(path)) {\n try {\n const parsed = JSON.parse(readFileSync(path, \"utf8\")) as Partial<BuildCache>;\n return { summaries: parsed.summaries ?? {}, synth: parsed.synth ?? {} };\n } catch {\n /* fall through to empty */\n }\n }\n return { summaries: {}, synth: {} };\n}",
- "span": "L314-L325"
- }
- },
- {
- "id": "src/context/build.ts#mapWithConcurrency",
- "name": "mapWithConcurrency",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L334-L349",
- "signature": "async function mapWithConcurrency<T, R>( items: T[], limit: number, fn: (item: T, index: number) => Promise<R>, ): Promise<R[]>",
- "exported": false,
- "origin": "ast",
- "body_hash": "a4c9438ba7cb397b91c5ab695f081e20db5678db9eea0be35a086fda1d9714e5",
- "summary_state": "ready",
- "summary": "Executes a function over a list of items with a limit on concurrent executions, preserving order.",
- "crux": {
- "code": "async function mapWithConcurrency<T, R>(\n items: T[],\n limit: number,\n fn: (item: T, index: number) => Promise<R>,\n): Promise<R[]> {\n const results: R[] = new Array(items.length);\n let next = 0;\n const workers = Array.from({ length: Math.min(limit, items.length) }, async () => {\n while (next < items.length) {\n const i = next++;\n results[i] = await fn(items[i], i);\n }",
- "span": "L334-L345"
- }
- },
- {
- "id": "src/context/build.ts#NodeDraft",
- "name": "NodeDraft",
- "kind": "interface",
- "path": "src/context/build.ts",
- "span": "L90-L97",
- "signature": "interface NodeDraft",
- "exported": false,
- "origin": "ast",
- "body_hash": "8ced91ed9a81f2acf4c6047b5091d9d972531cda6c94dfeacd8f52032a37e479",
- "summary_state": "ready",
- "summary": "Represents a node being constructed before finalizing its properties and links.",
- "crux": {
- "code": "interface NodeDraft {\n name: string;\n slug: string;\n type: string;\n summary: string;\n sources: Map<string, string>; // path → hash\n links: Map<string, NodeLink>; // \"to|relation\" → link\n}",
- "span": "L90-L97"
- }
- },
- {
- "id": "src/context/build.ts#registerName",
- "name": "registerName",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L297-L300",
- "signature": "function registerName(table: Map<string, string>, name: string, slug: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "19baf28fe22be9ee095b9158cc475114b372193f75407ad731aff306f455d432",
- "summary_state": "ready",
- "summary": "Registers a name and its corresponding slug in a mapping table to avoid duplicates.",
- "crux": {
- "code": "function registerName(table: Map<string, string>, name: string, slug: string): void {\n const key = name.trim().toLowerCase();\n if (key && !table.has(key)) table.set(key, slug);\n}",
- "span": "L297-L300"
- }
- },
- {
- "id": "src/context/build.ts#resolveSlug",
- "name": "resolveSlug",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L302-L304",
- "signature": "function resolveSlug(table: Map<string, string>, name: string): string | undefined",
- "exported": false,
- "origin": "ast",
- "body_hash": "e3b335543a5eb9e316abcb762fcc43a8e66ef10b9217c3b5682958d58eccb40b",
- "summary_state": "ready",
- "summary": "Retrieves the slug associated with a given name from a mapping table.",
- "crux": {
- "code": "function resolveSlug(table: Map<string, string>, name: string): string | undefined {\n return table.get(name.trim().toLowerCase());\n}",
- "span": "L302-L304"
- }
- },
- {
- "id": "src/context/build.ts#saveCache",
- "name": "saveCache",
- "kind": "function",
- "path": "src/context/build.ts",
- "span": "L327-L331",
- "signature": "function saveCache(outDir: string, cache: BuildCache): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "858a9e1dd3769382de94bbf1c7dc76b4c137a777872fca251d2d214eb185a6e3",
- "summary_state": "ready",
- "summary": "Saves the current build cache to disk to persist summaries and synthesized nodes.",
- "crux": {
- "code": "function saveCache(outDir: string, cache: BuildCache): void {\n const path = cachePath(outDir);\n mkdirSync(join(outDir, CACHE_DIR), { recursive: true });\n writeFileSync(path, JSON.stringify(cache, null, 2));\n}",
- "span": "L327-L331"
- }
- },
- {
- "id": "src/context/check.ts",
- "name": "check.ts",
- "kind": "file",
- "path": "src/context/check.ts",
- "span": "L1-L140",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "2444e1f4dfd78208a9b54942364ee1811d064459857c6d6cee178426e278d481",
- "chars": 4846,
- "summary_state": "ready",
- "summary": "This file provides functionality to verify if the committed context graph is synchronized with the current codebase, ensuring consistency in CI environments.",
- "crux": {
- "code": " const manifest = readManifest(outDir);\n if (!manifest) {\n result.missing = true;\n return result;\n }\n\n // Current code files on disk (same rules `init` used).\n const current = new Map<string, string>(); // rel → hash\n for (const file of walkDir(root)) {\n if (file.startsWith(outDir)) continue;\n if (!exts.some((e) => file.toLowerCase().endsWith(e))) continue;\n try {",
- "span": "L51-L62"
- }
- },
- {
- "id": "src/context/check.ts#checkContext",
- "name": "checkContext",
- "kind": "function",
- "path": "src/context/check.ts",
- "span": "L37-L107",
- "signature": "function checkContext(dir: string, opts: CheckOptions = {}): CheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "06ef9cdf299314884c2c167ef2b07261c310fa4973c392ec8f951354e4657195",
- "summary_state": "ready",
- "summary": "Checks the current state of the context graph against the recorded manifest, identifying any content drift, removals, or coverage issues.",
- "crux": {
- "code": " result.ok =\n result.contentDrift.length === 0 &&\n result.removed.length === 0 &&\n result.coverage.length === 0 &&\n result.indexDrift.length === 0;\n return result;",
- "span": "L101-L106"
- }
- },
- {
- "id": "src/context/check.ts#CheckOptions",
- "name": "CheckOptions",
- "kind": "interface",
- "path": "src/context/check.ts",
- "span": "L32-L35",
- "signature": "interface CheckOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "9ea98ccd24c4398fa3c15b57991778a2c5f300000220e01c3e36e0b52093f097",
- "summary_state": "ready",
- "summary": "Specifies optional parameters for the checkContext function, allowing customization of the context directory and file extensions to check.",
- "crux": null
- },
- {
- "id": "src/context/check.ts#CheckResult",
- "name": "CheckResult",
- "kind": "interface",
- "path": "src/context/check.ts",
- "span": "L22-L30",
- "signature": "interface CheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "91144295d6967be1d7e9675698c39f552001f149346f052f92582dcb23353a6c",
- "summary_state": "ready",
- "summary": "Defines the structure of the result returned by the checkContext function, encapsulating the status and details of any discrepancies found.",
- "crux": null
- },
- {
- "id": "src/context/check.ts#formatCheckReport",
- "name": "formatCheckReport",
- "kind": "function",
- "path": "src/context/check.ts",
- "span": "L110-L135",
- "signature": "function formatCheckReport(r: CheckResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "b1b96c36f7f186373c1d51db9acd9b9a975e7197a9a75d8c4cd8e821990228d3",
- "summary_state": "ready",
- "summary": "Generates a human-readable report summarizing the results of the checkContext function, detailing any discrepancies found.",
- "crux": {
- "code": " const lines: string[] = [\"graft check: STALE\", \"\"];\n if (r.contentDrift.length) {\n lines.push(`changed (${r.contentDrift.length}):`);\n for (const c of r.contentDrift) lines.push(` ~ ${c.path} (${c.from} → ${c.to})`);\n }\n if (r.removed.length) {\n lines.push(`removed (${r.removed.length}):`);\n for (const p of r.removed) lines.push(` - ${p}`);\n }\n if (r.coverage.length) {\n lines.push(`not in graph (${r.coverage.length}):`);\n for (const p of r.coverage) lines.push(` + ${p}`);",
- "span": "L116-L127"
- }
- },
- {
- "id": "src/context/check.ts#short",
- "name": "short",
- "kind": "function",
- "path": "src/context/check.ts",
- "span": "L137-L139",
- "signature": "function short(hash: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "174b5d08d0283571566816317520c72d2d9a1416f660ce45a854c34aa4cb45e6",
- "summary_state": "ready",
- "summary": "Shortens a hash string to its first eight characters for easier readability in reports.",
- "crux": {
- "code": "function short(hash: string): string {\n return hash.slice(0, 8);\n}",
- "span": "L137-L139"
- }
- },
- {
- "id": "src/context/node-file.ts",
- "name": "node-file.ts",
- "kind": "file",
- "path": "src/context/node-file.ts",
- "span": "L1-L230",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "9e958d74597b4d6d31fa5391882ddab8faab4076d7d33f93de861ab6c2e0b93a",
- "chars": 8479,
- "summary_state": "ready",
- "summary": "This file defines the structure and operations for managing a context graph represented as markdown files.",
- "crux": {
- "code": "/**\n * The on-disk format of the context graph: a folder of plain markdown files\n * under `.context/`, one per node. The files ARE the graph — the frontmatter\n * carries the machine-readable node (identity, source provenance, edges) and\n * the body is human/agent-readable prose. There is no database.",
- "span": "L1-L5"
- }
- },
- {
- "id": "src/context/node-file.ts#contextDirFor",
- "name": "contextDirFor",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L100-L103",
- "signature": "function contextDirFor(root: string, override?: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "bff3e70e01fbfde31e41893ba3bc3d41dc29b9359c55dd9333670aa02aecc088",
- "summary_state": "ready",
- "summary": "Determines the absolute path for the graft directory in a repository, allowing for file operations.",
- "crux": {
- "code": "export function contextDirFor(root: string, override?: string): string {\n if (override) return override;\n return join(root, \"graft\");\n}",
- "span": "L100-L103"
- }
- },
- {
- "id": "src/context/node-file.ts#ContextNode",
- "name": "ContextNode",
- "kind": "interface",
- "path": "src/context/node-file.ts",
- "span": "L43-L58",
- "signature": "interface ContextNode",
- "exported": true,
- "origin": "ast",
- "body_hash": "6cb97dab12942b8742efa5c785547222aa0350e75d994ccc99f0e1867f1e09d3",
- "summary_state": "ready",
- "summary": "Models a single node in the context graph, encapsulating its metadata and relationships.",
- "crux": {
- "code": "export interface ContextNode {\n name: string;\n slug: string;\n /** Coarse category from extraction: system | service | api | concept | … */\n type: string;\n /** Prose description that becomes the node body. */\n summary: string;\n /** Source files that produced this node (empty only for hand-authored nodes). */\n sources: SourceRef[];\n /** sha256 over the sorted `path:hash` lines of {@link sources}. */\n sourcesDigest: string;\n /** Outbound edges. */",
- "span": "L43-L54"
- }
- },
- {
- "id": "src/context/node-file.ts#defaultHuman",
- "name": "defaultHuman",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L121-L123",
- "signature": "function defaultHuman(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "ea0f628a1792282addf319eaa6469945e4229bacdbba7ad9b44854bd5bfb5373",
- "summary_state": "ready",
- "summary": "Provides a default human-readable section for a new node, which is preserved in future generations.",
- "crux": {
- "code": "function defaultHuman(): string {\n return `\\n## Notes\\n\\n_Anything written below the generated block is preserved when the graph is regenerated._\\n`;\n}",
- "span": "L121-L123"
- }
- },
- {
- "id": "src/context/node-file.ts#deleteNode",
- "name": "deleteNode",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L211-L214",
- "signature": "function deleteNode(dir: string, slug: string): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "49e161325092c3caf6c1b6d39d78b2d948445dd7609a72f9490e4898e9a973d3",
- "summary_state": "ready",
- "summary": "Deletes a specified node file from the filesystem, if it exists.",
- "crux": {
- "code": "export function deleteNode(dir: string, slug: string): void {\n const path = join(dir, `${slug}.md`);\n if (existsSync(path)) rmSync(path);\n}",
- "span": "L211-L214"
- }
- },
- {
- "id": "src/context/node-file.ts#digestSources",
- "name": "digestSources",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L89-L95",
- "signature": "function digestSources(sources: SourceRef[]): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "4c53e7543bc40ada4b0b0d853a6af071965175bef7b90980fa911149b2d691db",
- "summary_state": "ready",
- "summary": "Calculates a SHA256 hash over the sorted lines of source file paths and hashes to ensure integrity.",
- "crux": {
- "code": "export function digestSources(sources: SourceRef[]): string {\n const lines = sources\n .map((s) => `${s.path}:${s.hash}`)\n .sort()\n .join(\"\\n\");\n return contentHash(lines);\n}",
- "span": "L89-L95"
- }
- },
- {
- "id": "src/context/node-file.ts#existingNodeSlugs",
- "name": "existingNodeSlugs",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L201-L208",
- "signature": "function existingNodeSlugs(dir: string): Set<string>",
- "exported": true,
- "origin": "ast",
- "body_hash": "2f1f56206f2ae542e8cfaeebc0e3b9cc3e245a83f5ed7c70e4124d3d985a6403",
- "summary_state": "ready",
- "summary": "Lists the slugs of existing node files in a directory, aiding in the management of deleted nodes.",
- "crux": {
- "code": "export function existingNodeSlugs(dir: string): Set<string> {\n if (!existsSync(dir)) return new Set();\n return new Set(\n readdirSync(dir)\n .filter((e) => e.endsWith(\".md\") && e !== \"INDEX.md\")\n .map((e) => e.replace(/\\.md$/, \"\")),\n );\n}",
- "span": "L201-L208"
- }
- },
- {
- "id": "src/context/node-file.ts#Manifest",
- "name": "Manifest",
- "kind": "interface",
- "path": "src/context/node-file.ts",
- "span": "L61-L71",
- "signature": "interface Manifest",
- "exported": true,
- "origin": "ast",
- "body_hash": "5caafb5633830210bfe7a9d72a8d202f01560f80e2195995013a437e5ab59202",
- "summary_state": "ready",
- "summary": "Represents the generated index of all nodes and their metadata for quick access and integrity checks.",
- "crux": {
- "code": "export interface Manifest {\n version: number;\n /** Human label for the model that built the graph, e.g. \"openrouter:openai/gpt-4o-mini\". */\n model: string;\n /** sha256 over every source file's `path:hash` — the whole-graph fingerprint. */\n repoDigest: string;\n /** Every source file `init` processed, with its hash. The staleness ground-truth. */\n files: SourceRef[];\n /** Node roster (a subset of each node's frontmatter, for fast reads). */\n nodes: Array<{ slug: string; name: string; type: string; sources: string[]; sourcesDigest: string }>;\n}",
- "span": "L61-L71"
- }
- },
- {
- "id": "src/context/node-file.ts#NodeLink",
- "name": "NodeLink",
- "kind": "interface",
- "path": "src/context/node-file.ts",
- "span": "L36-L40",
- "signature": "interface NodeLink",
- "exported": true,
- "origin": "ast",
- "body_hash": "126d9b834cb0560714092dabc06b13ac71402695d797a7b770040112c180d9a5",
- "summary_state": "ready",
- "summary": "Defines a directed edge to another node, capturing the relationship and optional description.",
- "crux": {
- "code": "export interface NodeLink {\n to: string;\n relation: string;\n description?: string;\n}",
- "span": "L36-L40"
- }
- },
- {
- "id": "src/context/node-file.ts#ParsedNode",
- "name": "ParsedNode",
- "kind": "interface",
- "path": "src/context/node-file.ts",
- "span": "L172-L179",
- "signature": "interface ParsedNode",
- "exported": true,
- "origin": "ast",
- "body_hash": "1ffb557b4f3f224db4f31fd909bd40d4c25dfe521a4ce551e984167aa6365954",
- "summary_state": "ready",
- "summary": "Represents a parsed node file, capturing essential metadata without the body content.",
- "crux": {
- "code": "export interface ParsedNode {\n slug: string;\n name: string;\n type: string;\n sources: SourceRef[];\n sourcesDigest: string;\n links: NodeLink[];\n}",
- "span": "L172-L179"
- }
- },
- {
- "id": "src/context/node-file.ts#preserveHuman",
- "name": "preserveHuman",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L148-L152",
- "signature": "function preserveHuman(existingContent: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c36a99d53cd67a0c767859701d8efcf4e50c975709f8295b4a5579d9bda574aa",
- "summary_state": "ready",
- "summary": "Extracts the human region from an existing node file to ensure it is not lost during regeneration.",
- "crux": {
- "code": "function preserveHuman(existingContent: string): string {\n const idx = existingContent.indexOf(GEN_END);\n if (idx === -1) return defaultHuman();\n return existingContent.slice(idx + GEN_END.length).replace(/^\\n/, \"\");\n}",
- "span": "L148-L152"
- }
- },
- {
- "id": "src/context/node-file.ts#readManifest",
- "name": "readManifest",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L221-L229",
- "signature": "function readManifest(dir: string): Manifest | undefined",
- "exported": true,
- "origin": "ast",
- "body_hash": "0e0c22b3cdad566ef833ddc0a4cc2e7be2c262ce50ecc63fbc2c7431c83d2549",
- "summary_state": "ready",
- "summary": "Reads and parses the manifest file from disk, returning its contents or undefined if not found.",
- "crux": {
- "code": "export function readManifest(dir: string): Manifest | undefined {\n const path = join(dir, MANIFEST_FILE);\n if (!existsSync(path)) return undefined;\n try {\n return JSON.parse(readFileSync(path, \"utf8\")) as Manifest;\n } catch {\n return undefined;\n }\n}",
- "span": "L221-L229"
- }
- },
- {
- "id": "src/context/node-file.ts#readNodes",
- "name": "readNodes",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L182-L198",
- "signature": "function readNodes(dir: string): ParsedNode[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "55afcb307fdd33693c8eec1154da27f67cf834744c42e4b061eb99f646592eb0",
- "summary_state": "ready",
- "summary": "Reads and parses all markdown node files in a specified directory, returning their metadata.",
- "crux": {
- "code": "export function readNodes(dir: string): ParsedNode[] {\n if (!existsSync(dir)) return [];\n const out: ParsedNode[] = [];\n for (const entry of readdirSync(dir)) {\n if (!entry.endsWith(\".md\") || entry === \"INDEX.md\") continue;\n const fm = matter(readFileSync(join(dir, entry), \"utf8\")).data as Record<string, unknown>;\n out.push({\n slug: String(fm.slug ?? entry.replace(/\\.md$/, \"\")),\n name: String(fm.name ?? \"\"),\n type: String(fm.type ?? \"\"),\n sources: Array.isArray(fm.sources) ? (fm.sources as SourceRef[]) : [],\n sourcesDigest: String(fm.sources_digest ?? \"\"),",
- "span": "L182-L193"
- }
- },
- {
- "id": "src/context/node-file.ts#renderGenerated",
- "name": "renderGenerated",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L106-L118",
- "signature": "function renderGenerated(node: ContextNode): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "2e1f760d1c196c9bcbef16789bdb3d3860fc7c406e1b5f5745e7cf4bbe1f40f0",
- "summary_state": "ready",
- "summary": "Generates the markdown content for the summary and related links of a node.",
- "crux": {
- "code": "function renderGenerated(node: ContextNode): string {\n const lines = [`## Summary`, ``, node.summary.trim() || \"_(no summary)_\", ``];\n if (node.links.length > 0) {\n lines.push(`## Related`, ``);\n for (const link of [...node.links].sort((a, b) => a.to.localeCompare(b.to))) {\n const rel = link.relation.replace(/_/g, \" \");\n const tail = link.description ? ` — ${link.description}` : \"\";\n lines.push(`- ${rel} [[${link.to}]]${tail}`);\n }\n lines.push(``);\n }\n return lines.join(\"\\n\");",
- "span": "L106-L117"
- }
- },
- {
- "id": "src/context/node-file.ts#renderNodeFile",
- "name": "renderNodeFile",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L126-L141",
- "signature": "function renderNodeFile(node: ContextNode): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "f064173ff3e72f9f7f703694379edf165ba55d72949f4e6f097118e8e9d79a96",
- "summary_state": "ready",
- "summary": "Serializes a node into its complete markdown file format, including generated and human sections.",
- "crux": {
- "code": "export function renderNodeFile(node: ContextNode): string {\n const data = {\n name: node.name,\n slug: node.slug,\n type: node.type,\n sources: node.sources.map((s) => ({ path: s.path, hash: s.hash })),\n sources_digest: node.sourcesDigest,\n links: node.links.map((l) =>\n l.description ? { to: l.to, relation: l.relation, description: l.description } : { to: l.to, relation: l.relation },\n ),\n generator: { version: MANIFEST_VERSION },\n };",
- "span": "L126-L137"
- }
- },
- {
- "id": "src/context/node-file.ts#slugify",
- "name": "slugify",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L81-L86",
- "signature": "function slugify(name: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "70fca5f67f42bcb40f42175a26795d6a6ac72953f62ada7775a91d8300581fb0",
- "summary_state": "ready",
- "summary": "Converts a display name into a URL-safe slug for use in file naming and linking.",
- "crux": {
- "code": "export function slugify(name: string): string {\n const base = normalizeName(name)\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n return base || \"node\";\n}",
- "span": "L81-L86"
- }
- },
- {
- "id": "src/context/node-file.ts#SourceRef",
- "name": "SourceRef",
- "kind": "interface",
- "path": "src/context/node-file.ts",
- "span": "L30-L33",
- "signature": "interface SourceRef",
- "exported": true,
- "origin": "ast",
- "body_hash": "2603554df891243f1f9c13ab6639a48627c787e5869c2bf692fdd481ae5050dd",
- "summary_state": "ready",
- "summary": "Represents a source file that contributed to the creation of a node, including its content hash.",
- "crux": {
- "code": "export interface SourceRef {\n path: string;\n hash: string;\n}",
- "span": "L30-L33"
- }
- },
- {
- "id": "src/context/node-file.ts#writeManifest",
- "name": "writeManifest",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L216-L219",
- "signature": "function writeManifest(dir: string, manifest: Manifest): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "049e90311a97eda62d11bd8b35ed1debded19d6f06daa975c938287943e22d88",
- "summary_state": "ready",
- "summary": "Writes the manifest file to disk, containing metadata about the context graph.",
- "crux": {
- "code": "export function writeManifest(dir: string, manifest: Manifest): void {\n mkdirSync(dir, { recursive: true });\n writeFileSync(join(dir, MANIFEST_FILE), JSON.stringify(manifest, null, 2) + \"\\n\");\n}",
- "span": "L216-L219"
- }
- },
- {
- "id": "src/context/node-file.ts#writeNode",
- "name": "writeNode",
- "kind": "function",
- "path": "src/context/node-file.ts",
- "span": "L158-L169",
- "signature": "function writeNode(dir: string, node: ContextNode): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "78ec07695ac8cf3949025497d7f56b47e5b8f0c16d6eb1dbe237c1ecc3e2fffe",
- "summary_state": "ready",
- "summary": "Writes a node to disk, preserving any existing human content and ensuring directory structure.",
- "crux": {
- "code": "export function writeNode(dir: string, node: ContextNode): string {\n mkdirSync(dir, { recursive: true });\n const path = join(dir, `${node.slug}.md`);\n if (existsSync(path)) {\n const parsed = matter(readFileSync(path, \"utf8\"));\n node = { ...node, human: preserveHuman(parsed.content) };\n } else {\n node = { ...node, human: node.human || defaultHuman() };\n }\n writeFileSync(path, renderNodeFile(node));\n return path;\n}",
- "span": "L158-L169"
- }
- },
- {
- "id": "src/context/savings.ts",
- "name": "savings.ts",
- "kind": "file",
- "path": "src/context/savings.ts",
- "span": "L1-L83",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "43e2cfc29123851a5f4bee55fe5716de8ab4a102ff39201e65c9907eb914b9bb",
- "chars": 3723,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/savings.ts#fileSizes",
- "name": "fileSizes",
- "kind": "function",
- "path": "src/context/savings.ts",
- "span": "L32-L37",
- "signature": "function fileSizes(graph: GraphV1): Map<string, number>",
- "exported": false,
- "origin": "ast",
- "body_hash": "cf86e222b98ca1b1598d640d52714b647757eeaf60e5b42e1ef2fd203e138ca2",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/savings.ts#Savings",
- "name": "Savings",
- "kind": "interface",
- "path": "src/context/savings.ts",
- "span": "L17-L22",
- "signature": "interface Savings",
- "exported": true,
- "origin": "ast",
- "body_hash": "0c0a753f5e797f72b421f7bd766396ef4e84b440d5080497187820d907b2690a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/savings.ts#savingsFooter",
- "name": "savingsFooter",
- "kind": "function",
- "path": "src/context/savings.ts",
- "span": "L69-L82",
- "signature": "function savingsFooter(body: string, saved: Savings | undefined): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "d515334ac994b49da696c652441cfcb49a6c3f502fb0d44b428bcdbb3f93ad19",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/savings.ts#savingsFor",
- "name": "savingsFor",
- "kind": "function",
- "path": "src/context/savings.ts",
- "span": "L42-L53",
- "signature": "function savingsFor(graph: GraphV1, paths: Iterable<string>): Savings | undefined",
- "exported": true,
- "origin": "ast",
- "body_hash": "4fcc66724fcb55e23fff7e019707b7b7148fb41f635d3b3b5209c48e0a32a658",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/context/savings.ts#toTokens",
- "name": "toTokens",
- "kind": "function",
- "path": "src/context/savings.ts",
- "span": "L25-L27",
- "signature": "function toTokens(chars: number): number",
- "exported": true,
- "origin": "ast",
- "body_hash": "c309fa8bd0227742b657331eb45be3225e5a5efc56b1967871624df6c83ab954",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/engine.ts",
- "name": "engine.ts",
- "kind": "file",
- "path": "src/engine.ts",
- "span": "L1-L147",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "26150fbd17e28dc95952380426b55e2a9ac25089f2fa640fd805b134e499a1fe",
- "chars": 5506,
- "summary_state": "stale",
- "summary": "The Graft class manages the construction and validation of a context graph from a code repository, ensuring it remains in sync with the codebase.",
- "crux": {
- "code": " /** Build the `.context/` graph from the repo at `dir`. */\n async init(dir: string, opts: InitOptions = {}): Promise<BuildResult> {\n return buildContext(dir, {\n contextDir: this.cfg.contextDir,\n extensions: opts.extensions,\n model: this.modelLabel(),\n summarizer: this.summarizer(),\n synthesizer: this.synthesizer(),\n onProgress: opts.onProgress,\n });\n }\n",
- "span": "L54-L65"
- }
- },
- {
- "id": "src/engine.ts#CheckRunOptions",
- "name": "CheckRunOptions",
- "kind": "interface",
- "path": "src/engine.ts",
- "span": "L35-L37",
- "signature": "interface CheckRunOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "705bea732f08c471e6566f8b6621038988554944b4bf9eca74674cdf518bf9b1",
- "summary_state": "ready",
- "summary": "Specifies options for checking the context graph, allowing for code extensions to be included.",
- "crux": null
- },
- {
- "id": "src/engine.ts#Graft",
- "name": "Graft",
- "kind": "class",
- "path": "src/engine.ts",
- "span": "L47-L146",
- "signature": "class Graft",
- "exported": true,
- "origin": "ast",
- "body_hash": "d22bbb74764ee80994c72fca91ae094b550c1c77438aea072d9a87fec2ce2bb9",
- "summary_state": "stale",
- "summary": "Manages the context graph operations, including building and checking synchronization with the codebase.",
- "crux": {
- "code": " /** Build the `.context/` graph from the repo at `dir`. */\n async init(dir: string, opts: InitOptions = {}): Promise<BuildResult> {\n return buildContext(dir, {\n contextDir: this.cfg.contextDir,\n extensions: opts.extensions,\n model: this.modelLabel(),\n summarizer: this.summarizer(),\n synthesizer: this.synthesizer(),\n onProgress: opts.onProgress,\n });\n }",
- "span": "L54-L64"
- }
- },
- {
- "id": "src/engine.ts#Graft.ask",
- "name": "ask",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L95-L103",
- "signature": "ask(dir: string, query: string, opts: { limit?: number; source?: boolean; full?: boolean; in?: string } = {}): AskResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "855b7e12e241b242096a3b457ea181e47e11d1613583edb30931d473d2b06bfb",
- "summary_state": "stale",
- "summary": "Processes a query against the context graph, returning results based on structural and lexical analysis.",
- "crux": {
- "code": " ask(dir: string, query: string, opts: { limit?: number; source?: boolean; full?: boolean } = {}): AskResult {\n return ask(dir, query, { contextDir: this.cfg.contextDir, limit: opts.limit, source: opts.source, full: opts.full });",
- "span": "L95-L96"
- }
- },
- {
- "id": "src/engine.ts#Graft.chatModel",
- "name": "chatModel",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L108-L125",
- "signature": "private chatModel(): ChatModel",
- "exported": true,
- "origin": "ast",
- "body_hash": "8027a62d0dbb02b564aaf97010177ba193d415b944639211a6aa8604049001d0",
- "summary_state": "ready",
- "summary": "Retrieves the configured chat model or throws an error if the API key is missing, ensuring proper setup for LLM operations.",
- "crux": {
- "code": " if (!this.cfg.apiKey) {\n throw new Error(\n \"No API key. Set GRAFT_API_KEY (and GRAFT_PROVIDER / GRAFT_BASE_URL / GRAFT_MODEL \" +\n \"for your provider) to build or summarize the graph.\",\n );\n }",
- "span": "L105-L110"
- }
- },
- {
- "id": "src/engine.ts#Graft.check",
- "name": "check",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L67-L69",
- "signature": "check(dir: string, opts: CheckRunOptions = {}): CheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "c0ef54370f24e88b0dfc83f2dd21d3db0a44c44538b3ec8bd54d38fac8be2c49",
- "summary_state": "ready",
- "summary": "Checks if the committed context graph is in sync with the code in the specified directory.",
- "crux": {
- "code": " check(dir: string, opts: CheckRunOptions = {}): CheckResult {\n return checkContext(dir, { contextDir: this.cfg.contextDir, extensions: opts.extensions });\n }",
- "span": "L63-L65"
- }
- },
- {
- "id": "src/engine.ts#Graft.checkGraph",
- "name": "checkGraph",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L72-L74",
- "signature": "checkGraph(dir: string): GraphCheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "eda4bef32536dd54b29cba56c59d4ea971625167a482e8fe15c5d799be81f870",
- "summary_state": "ready",
- "summary": "Verifies if the committed graph.json file is in sync with the code, focusing on the Tier-1 differences.",
- "crux": {
- "code": " checkGraph(dir: string): GraphCheckResult {\n return checkGraph(dir, { contextDir: this.cfg.contextDir });\n }",
- "span": "L68-L70"
- }
- },
- {
- "id": "src/engine.ts#Graft.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L50-L52",
- "signature": "constructor(config: EngineConfig = {})",
- "exported": true,
- "origin": "ast",
- "body_hash": "374d5de4021aadc3150f3cb521b536653584976599a4956fea4b26c40131c19f",
- "summary_state": "ready",
- "summary": "Initializes the Graft class with a configuration, resolving the necessary settings for the context graph.",
- "crux": {
- "code": " constructor(config: EngineConfig = {}) {\n this.cfg = resolveConfig(config);\n }",
- "span": "L46-L48"
- }
- },
- {
- "id": "src/engine.ts#Graft.cruxSummarizer",
- "name": "cruxSummarizer",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L132-L134",
- "signature": "private cruxSummarizer(): CruxSummarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "59d1f34a9105fe6c97198009342ac29f8c7047efa2ba68f10001439bf14a14cd",
- "summary_state": "ready",
- "summary": "Returns a crux summarizer for the Tier-2 pass of the code graph, ensuring detailed summarization of nodes.",
- "crux": {
- "code": " private cruxSummarizer(): CruxSummarizer {\n return this.cfg.cruxSummarizer ?? new ChatCruxSummarizer(this.chatModel());\n }",
- "span": "L126-L128"
- }
- },
- {
- "id": "src/engine.ts#Graft.graph",
- "name": "graph",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L81-L88",
- "signature": "graph(dir: string, opts: GraphRunOptions = {}): Promise<GraphBuildResult>",
- "exported": true,
- "origin": "ast",
- "body_hash": "cec39cf7bba0c124990ab186d6aae7ae2dcf5f17bfc56ecbef85f1fcc394050e",
- "summary_state": "ready",
- "summary": "Builds a per-symbol code graph from the repository, optionally using a meaning layer with LLM.",
- "crux": {
- "code": " graph(dir: string, opts: GraphRunOptions = {}): Promise<GraphBuildResult> {\n return buildGraph(dir, {\n contextDir: this.cfg.contextDir,\n summarizer: opts.llm ? this.cruxSummarizer() : undefined,\n concurrency: opts.concurrency,\n onProgress: opts.onProgress,\n });",
- "span": "L79-L85"
- }
- },
- {
- "id": "src/engine.ts#Graft.init",
- "name": "init",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L55-L64",
- "signature": "async init(dir: string, opts: InitOptions = {}): Promise<BuildResult>",
- "exported": true,
- "origin": "ast",
- "body_hash": "7ee2e73a5a5412667db890e91f0f2abfb15b94ea1331db17aef0f841c348fbf1",
- "summary_state": "ready",
- "summary": "Builds the context graph from the specified directory, utilizing various options and configurations.",
- "crux": {
- "code": " async init(dir: string, opts: InitOptions = {}): Promise<BuildResult> {\n return buildContext(dir, {\n contextDir: this.cfg.contextDir,\n extensions: opts.extensions,\n model: this.modelLabel(),\n summarizer: this.summarizer(),\n synthesizer: this.synthesizer(),\n onProgress: opts.onProgress,\n });\n }",
- "span": "L51-L60"
- }
- },
- {
- "id": "src/engine.ts#Graft.modelLabel",
- "name": "modelLabel",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L141-L145",
- "signature": "private modelLabel(): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "54b282db93470ea6937b432de6889d721755de5b7bd67bada35be5237b11021c",
- "summary_state": "ready",
- "summary": "Determines the human-readable label for the active model, which is recorded in the manifest for reference.",
- "crux": {
- "code": " private modelLabel(): string {\n if (this.cfg.chatModel) return this.cfg.chatModel.label;\n if (this.cfg.synthesizer || this.cfg.summarizer || this.cfg.cruxSummarizer) return \"custom\";\n return `${this.cfg.provider}:${this.cfg.model}`;\n }",
- "span": "L135-L139"
- }
- },
- {
- "id": "src/engine.ts#Graft.summarizer",
- "name": "summarizer",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L136-L138",
- "signature": "private summarizer(): Summarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "b1360c129530fa4de856caf6d8e6aa6479d7cad492fea9f5e93ee82becd9ac22",
- "summary_state": "ready",
- "summary": "Fetches the summarizer for generating summaries, defaulting to a chat summarizer if not explicitly set.",
- "crux": {
- "code": " private summarizer(): Summarizer {\n return this.cfg.summarizer ?? new ChatSummarizer(this.chatModel());\n }",
- "span": "L130-L132"
- }
- },
- {
- "id": "src/engine.ts#Graft.synthesizer",
- "name": "synthesizer",
- "kind": "method",
- "path": "src/engine.ts",
- "span": "L127-L129",
- "signature": "private synthesizer(): Synthesizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "5e3e4becf7575fbae3d5093185d5fcba1fcdc49ae45227c94a9c537a9ac61c5d",
- "summary_state": "ready",
- "summary": "Provides the synthesizer for generating responses, defaulting to a chat synthesizer if none is configured.",
- "crux": {
- "code": " private synthesizer(): Synthesizer {\n return this.cfg.synthesizer ?? new ChatSynthesizer(this.chatModel());\n }",
- "span": "L121-L123"
- }
- },
- {
- "id": "src/engine.ts#GraphRunOptions",
- "name": "GraphRunOptions",
- "kind": "interface",
- "path": "src/engine.ts",
- "span": "L39-L45",
- "signature": "interface GraphRunOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "424eba22dc93e6a1f2b948f40d738ef8dd9b0bf4d06d7a3d562c2c6d77443d73",
- "summary_state": "ready",
- "summary": "Defines options for running the graph building process, including LLM usage and concurrency settings.",
- "crux": null
- },
- {
- "id": "src/engine.ts#InitOptions",
- "name": "InitOptions",
- "kind": "interface",
- "path": "src/engine.ts",
- "span": "L28-L33",
- "signature": "interface InitOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "4a606cc2ac6df47d7b50de2a7ce33b2bd85e5dad93bea127871b9b952ddb0f8a",
- "summary_state": "ready",
- "summary": "Defines options for initializing the context graph build, including code extensions and a progress callback.",
- "crux": null
- },
- {
- "id": "src/graph/bindings.ts",
- "name": "bindings.ts",
- "kind": "file",
- "path": "src/graph/bindings.ts",
- "span": "L1-L323",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "5cfcbb66a1aa754f3b56d68c09d5bcf52f5002a67abd70cc8f1a8d0c1dddce6a",
- "chars": 14041,
- "summary_state": "ready",
- "summary": "This file implements a binding pass that resolves variable types in a parsed file, enabling accurate type lookups for local variables, parameters, and class fields during code analysis.",
- "crux": {
- "code": " set(scopePath: string, name: string, type: string): void {\n this.map.set(`${scopePath}|${name}`, type);\n }\n\n /** Innermost-first: for scope [\"a\",\"b\"] name \"x\", tries `a.b|x`, `a|x`, `|x`. */\n lookup(scope: string[], name: string): string | null {\n for (let i = scope.length; i >= 0; i--) {\n const hit = this.map.get(`${scope.slice(0, i).join(\".\")}|${name}`);\n if (hit) return hit;\n }\n return null;",
- "span": "L21-L31"
- }
- },
- {
- "id": "src/graph/bindings.ts#callTypeName",
- "name": "callTypeName",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L202-L207",
- "signature": "function callTypeName(node: Parser.SyntaxNode | null | undefined, aliases: Map<string, string>): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "1142e3a6b9cbf15363de7f4a6b63e29fcbda79257c58b9908e163cae86e1a0c2",
- "summary_state": "ready",
- "summary": "Determines the type name from a call expression, which is important for understanding the types of function calls in the code.",
- "crux": {
- "code": "function callTypeName(node: Parser.SyntaxNode | null | undefined, aliases: Map<string, string>): string | null {\n if (node?.type !== \"call\") return null;\n const fn = node.childForFieldName(\"function\");\n if (fn?.type !== \"identifier\") return null;\n return aliases.get(fn.text) ?? fn.text;\n}",
- "span": "L202-L207"
- }
- },
- {
- "id": "src/graph/bindings.ts#collectAliases",
- "name": "collectAliases",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L142-L156",
- "signature": "function collectAliases(node: Parser.SyntaxNode, lang: Language, aliases: Map<string, string>): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "4222a97dc61f81be4c7c795013ee09c14b2575fa0fd21dbb005a8e9e6b44513a",
- "summary_state": "ready",
- "summary": "Scans the syntax tree to collect import aliases, ensuring that type resolution accounts for aliased names in the code.",
- "crux": {
- "code": "function collectAliases(node: Parser.SyntaxNode, lang: Language, aliases: Map<string, string>): void {\n if (lang === \"python\" && node.type === \"aliased_import\") {\n const nameNode = node.childForFieldName(\"name\");\n const aliasNode = node.childForFieldName(\"alias\");\n if (nameNode && aliasNode) {\n const orig = nameNode.type === \"dotted_name\" ? (nameNode.namedChildren.at(-1)?.text ?? nameNode.text) : nameNode.text;\n aliases.set(aliasNode.text, orig);\n }\n } else if ((lang === \"typescript\" || lang === \"tsx\") && node.type === \"import_specifier\") {\n const nameNode = node.childForFieldName(\"name\");\n const aliasNode = node.childForFieldName(\"alias\");\n if (nameNode && aliasNode) aliases.set(aliasNode.text, nameNode.text);",
- "span": "L142-L153"
- }
- },
- {
- "id": "src/graph/bindings.ts#collectBindings",
- "name": "collectBindings",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L132-L138",
- "signature": "function collectBindings(root: Parser.SyntaxNode, lang: Language): FileBindings",
- "exported": true,
- "origin": "ast",
- "body_hash": "132de062858baae6517153462acf369bc86e13651952480acdbb253f07698f21",
- "summary_state": "ready",
- "summary": "Traverses a parsed syntax tree to gather variable-to-type bindings, which are essential for type resolution in the codebase.",
- "crux": {
- "code": "export function collectBindings(root: Parser.SyntaxNode, lang: Language): FileBindings {\n const bindings = new FileBindings();\n const aliases = new Map<string, string>();\n collectAliases(root, lang, aliases);\n visit(root, lang, [], null, bindings, aliases);\n return bindings;\n}",
- "span": "L132-L138"
- }
- },
- {
- "id": "src/graph/bindings.ts#defName",
- "name": "defName",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L45-L77",
- "signature": "function defName(node: Parser.SyntaxNode, lang: Language): string | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "dfc038207eec571860ec5f6c8900f00f453254c23b22fd3874921c3f71fd8317",
- "summary_state": "ready",
- "summary": "Determines the name of a definition node (like a function or class) based on its syntax, aiding in the identification of types during analysis.",
- "crux": {
- "code": "export function defName(node: Parser.SyntaxNode, lang: Language): string | null {\n if (lang === \"go\") {\n if (node.type === \"method_declaration\") {\n const name = node.childForFieldName(\"name\")?.text;\n if (!name) return null;\n const recv = goReceiverTypeOf(node);\n return recv ? `${recv}.${name}` : name;\n }\n if (node.type === \"function_declaration\" || node.type === \"type_spec\") {\n return node.childForFieldName(\"name\")?.text ?? null;\n }\n return null;",
- "span": "L45-L56"
- }
- },
- {
- "id": "src/graph/bindings.ts#FileBindings",
- "name": "FileBindings",
- "kind": "class",
- "path": "src/graph/bindings.ts",
- "span": "L18-L33",
- "signature": "class FileBindings",
- "exported": true,
- "origin": "ast",
- "body_hash": "19908ed6e06f561286fc85a8cac0c560d1babb4d856658f9783dc67c9c8c1679",
- "summary_state": "ready",
- "summary": "Manages the mapping of variable/field names to their types within different scopes, enabling type resolution during code analysis.",
- "crux": {
- "code": " set(scopePath: string, name: string, type: string): void {\n this.map.set(`${scopePath}|${name}`, type);\n }",
- "span": "L21-L23"
- }
- },
- {
- "id": "src/graph/bindings.ts#FileBindings.lookup",
- "name": "lookup",
- "kind": "method",
- "path": "src/graph/bindings.ts",
- "span": "L26-L32",
- "signature": "lookup(scope: string[], name: string): string | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "675fb0f092ed5acc91063e941c243037560f93003456d5a5a127112c5e7e12cd",
- "summary_state": "ready",
- "summary": "Retrieves the type associated with a variable or field name from the closest matching scope, facilitating type resolution in nested contexts.",
- "crux": {
- "code": " lookup(scope: string[], name: string): string | null {\n for (let i = scope.length; i >= 0; i--) {\n const hit = this.map.get(`${scope.slice(0, i).join(\".\")}|${name}`);\n if (hit) return hit;\n }\n return null;\n }",
- "span": "L26-L32"
- }
- },
- {
- "id": "src/graph/bindings.ts#FileBindings.set",
- "name": "set",
- "kind": "method",
- "path": "src/graph/bindings.ts",
- "span": "L21-L23",
- "signature": "set(scopePath: string, name: string, type: string): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "9027da9c550dcb7059bfabc81dfe561504b7b512caeb20631d0563463b5a7016",
- "summary_state": "ready",
- "summary": "Records the type of a variable or field in the specified scope, allowing for later retrieval during type resolution.",
- "crux": {
- "code": " set(scopePath: string, name: string, type: string): void {\n this.map.set(`${scopePath}|${name}`, type);\n }",
- "span": "L21-L23"
- }
- },
- {
- "id": "src/graph/bindings.ts#goReceiverTypeOf",
- "name": "goReceiverTypeOf",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L91-L97",
- "signature": "function goReceiverTypeOf(node: Parser.SyntaxNode): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "78374b16a5d2b5c21465a6a299cff5c422327d2c6402a03e88993526b69afe1a",
- "summary_state": "ready",
- "summary": "Determines the base type of a receiver in a Go method, which is crucial for type resolution in method calls.",
- "crux": {
- "code": "function goReceiverTypeOf(node: Parser.SyntaxNode): string | null {\n const recv = node.childForFieldName(\"receiver\");\n const param = recv?.namedChildren.find((c) => c.type === \"parameter_declaration\");\n let type = param?.childForFieldName(\"type\");\n if (type?.type === \"pointer_type\") type = type.namedChildren.at(-1) ?? null;\n return type?.type === \"type_identifier\" ? type.text : null;\n}",
- "span": "L91-L97"
- }
- },
- {
- "id": "src/graph/bindings.ts#goReceiverVarOf",
- "name": "goReceiverVarOf",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L81-L85",
- "signature": "function goReceiverVarOf(node: Parser.SyntaxNode): string | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "a824bc4cfb8364a115c60e40390e9abf6c580976177ee4b0fe5028f272175414",
- "summary_state": "ready",
- "summary": "Extracts the variable name of the receiver parameter from a Go method node, which is essential for understanding method context.",
- "crux": {
- "code": "export function goReceiverVarOf(node: Parser.SyntaxNode): string | null {\n const recv = node.childForFieldName(\"receiver\");\n const param = recv?.namedChildren.find((c) => c.type === \"parameter_declaration\");\n return param?.childForFieldName(\"name\")?.text ?? null;\n}",
- "span": "L81-L85"
- }
- },
- {
- "id": "src/graph/bindings.ts#handleGo",
- "name": "handleGo",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L287-L322",
- "signature": "function handleGo(node: Parser.SyntaxNode, scope: string[], bindings: FileBindings): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "f5f75a60c9e0b8689d2ad6bbe6dc12e6bf5ef88e7a1157b115d34a7cbd1846ac",
- "summary_state": "ready",
- "summary": "Handles the processing of Go nodes to extract type information, ensuring that type resolution is accurate for Go code.",
- "crux": {
- "code": "function handleGo(node: Parser.SyntaxNode, scope: string[], bindings: FileBindings): void {\n const scopePath = scope.join(\".\");\n if (node.type === \"var_spec\") {\n const name = node.childForFieldName(\"name\");\n let type = node.childForFieldName(\"type\");\n if (type?.type === \"pointer_type\") type = type.namedChildren.at(-1) ?? null;\n if (name?.type === \"identifier\" && type?.type === \"type_identifier\") {\n bindings.set(scopePath, name.text, type.text);\n }\n return;\n }\n if (node.type !== \"short_var_declaration\") return;",
- "span": "L287-L298"
- }
- },
- {
- "id": "src/graph/bindings.ts#handlePy",
- "name": "handlePy",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L209-L239",
- "signature": "function handlePy( node: Parser.SyntaxNode, scope: string[], classScope: string | null, bindings: FileBindings, aliases: Map<string, string>, ): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "1c564356d137b8086c52e38f67ff0ca1646212aeb89e93bbacb3282172cec8e1",
- "summary_state": "ready",
- "summary": "Handles the processing of Python nodes to extract type information, contributing to the overall type resolution process.",
- "crux": {
- "code": "function handlePy(\n node: Parser.SyntaxNode,\n scope: string[],\n classScope: string | null,\n bindings: FileBindings,\n aliases: Map<string, string>,\n): void {\n const scopePath = scope.join(\".\");\n if (node.type === \"typed_parameter\") {\n const nameNode = node.namedChildren.find((c) => c.type === \"identifier\");\n const typeName = pyTypeName(node.childForFieldName(\"type\"), aliases);\n if (nameNode && typeName) bindings.set(scopePath, nameNode.text, typeName);",
- "span": "L209-L220"
- }
- },
- {
- "id": "src/graph/bindings.ts#handleTs",
- "name": "handleTs",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L257-L285",
- "signature": "function handleTs( node: Parser.SyntaxNode, scope: string[], classScope: string | null, bindings: FileBindings, aliases: Map<string, string>, ): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "61f3e570f631fdbc6bb8bc3323b05e0062eeef973368cce674bc3a93644b8dba",
- "summary_state": "ready",
- "summary": "Processes TypeScript nodes to gather type information, which is essential for accurate type resolution in TypeScript code.",
- "crux": {
- "code": "function handleTs(\n node: Parser.SyntaxNode,\n scope: string[],\n classScope: string | null,\n bindings: FileBindings,\n aliases: Map<string, string>,\n): void {\n const scopePath = scope.join(\".\");\n if (node.type === \"variable_declarator\") {\n const value = node.childForFieldName(\"value\");\n if (value && FN_VALUE_TYPES.has(value.type)) return; // a function def, not a type binding\n const name = node.childForFieldName(\"name\");",
- "span": "L257-L268"
- }
- },
- {
- "id": "src/graph/bindings.ts#isClassNode",
- "name": "isClassNode",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L123-L129",
- "signature": "function isClassNode(node: Parser.SyntaxNode, lang: Language): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "c74d234cc18f7097a4f71d4ff572a8660c7003c82f7d0938f972564845864a32",
- "summary_state": "ready",
- "summary": "Checks if a given node represents a class definition, which is important for understanding the structure of the code being analyzed.",
- "crux": {
- "code": "function isClassNode(node: Parser.SyntaxNode, lang: Language): boolean {\n if (lang === \"python\") return node.type === \"class_definition\";\n if (lang === \"typescript\" || lang === \"tsx\") {\n return node.type === \"class_declaration\" || node.type === \"abstract_class_declaration\";\n }\n return false;\n}",
- "span": "L123-L129"
- }
- },
- {
- "id": "src/graph/bindings.ts#pyTypeName",
- "name": "pyTypeName",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L192-L200",
- "signature": "function pyTypeName(node: Parser.SyntaxNode | null | undefined, aliases: Map<string, string>): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "e3f0ef8b9205ddeb7f2bccc89c1100745b73301e6d65f4a5090ed43fef3ffd49",
- "summary_state": "ready",
- "summary": "Extracts and resolves the type name from a Python node, which is necessary for accurate type binding in Python code.",
- "crux": {
- "code": "function pyTypeName(node: Parser.SyntaxNode | null | undefined, aliases: Map<string, string>): string | null {\n if (!node) return null;\n if (node.type === \"identifier\") return resolveAlias(node.text, aliases);\n if (node.type === \"type\") {\n const inner = node.namedChildren[0];\n return inner?.type === \"identifier\" ? resolveAlias(inner.text, aliases) : null;\n }\n return null;\n}",
- "span": "L192-L200"
- }
- },
- {
- "id": "src/graph/bindings.ts#resolveAlias",
- "name": "resolveAlias",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L188-L190",
- "signature": "function resolveAlias(name: string, aliases: Map<string, string>): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "57147e33c3f450e825a480f2adb620f8c470472ee69afe5075f163e81752cf18",
- "summary_state": "ready",
- "summary": "Resolves a name through the collected aliases, ensuring that type lookups are accurate even when using aliased names.",
- "crux": {
- "code": "function resolveAlias(name: string, aliases: Map<string, string>): string {\n return aliases.get(name) ?? name;\n}",
- "span": "L188-L190"
- }
- },
- {
- "id": "src/graph/bindings.ts#resolveRecvType",
- "name": "resolveRecvType",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L103-L121",
- "signature": "function resolveRecvType( receiver: string | undefined, ctx: Pick<WalkCtx, \"scope\" | \"enclosingClass\" | \"goReceiverVar\" | \"lang\" | \"bindings\">, ): string | undefined",
- "exported": true,
- "origin": "ast",
- "body_hash": "fdc0ccb4d1186b98b4d805519bb3c23ecde386bdd78a6c0e3d5e421b63fe6594",
- "summary_state": "ready",
- "summary": "Resolves the type of a receiver in a method call based on the current context, ensuring accurate type information is used during analysis.",
- "crux": {
- "code": "export function resolveRecvType(\n receiver: string | undefined,\n ctx: Pick<WalkCtx, \"scope\" | \"enclosingClass\" | \"goReceiverVar\" | \"lang\" | \"bindings\">,\n): string | undefined {\n if (!receiver) return undefined;\n if (receiver === \"self\" || receiver === \"cls\" || receiver === \"this\") return ctx.enclosingClass ?? undefined;\n if (receiver.startsWith(\"self.\") || receiver.startsWith(\"this.\")) {\n return (\n ctx.bindings.lookup(ctx.scope, receiver) ??\n ctx.bindings.lookup(ctx.scope, receiver.replace(/^this\\./, \"self.\")) ??\n undefined\n );",
- "span": "L103-L114"
- }
- },
- {
- "id": "src/graph/bindings.ts#tsAnnotationTypeName",
- "name": "tsAnnotationTypeName",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L241-L248",
- "signature": "function tsAnnotationTypeName( typeAnn: Parser.SyntaxNode | null | undefined, aliases: Map<string, string>, ): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "6ab85b25d2211b7cce5a9901c7b450a1902ff95e5234b1119836a467d57c68ed",
- "summary_state": "ready",
- "summary": "Extracts the type name from TypeScript annotation nodes, which is crucial for type resolution in TypeScript code.",
- "crux": {
- "code": "function tsAnnotationTypeName(\n typeAnn: Parser.SyntaxNode | null | undefined,\n aliases: Map<string, string>,\n): string | null {\n if (!typeAnn || typeAnn.type !== \"type_annotation\") return null;\n const t = typeAnn.namedChildren[0];\n return t?.type === \"type_identifier\" ? resolveAlias(t.text, aliases) : null;\n}",
- "span": "L241-L248"
- }
- },
- {
- "id": "src/graph/bindings.ts#tsNewTypeName",
- "name": "tsNewTypeName",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L250-L255",
- "signature": "function tsNewTypeName(value: Parser.SyntaxNode | null | undefined, aliases: Map<string, string>): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "974b137011eeae18fd510c7ff38fd2bab7dee9d20ca1434ca492c38e369e203b",
- "summary_state": "ready",
- "summary": "Determines the type name from a TypeScript new expression, aiding in the resolution of types during analysis.",
- "crux": {
- "code": "function tsNewTypeName(value: Parser.SyntaxNode | null | undefined, aliases: Map<string, string>): string | null {\n if (value?.type !== \"new_expression\") return null;\n const ctor = value.childForFieldName(\"constructor\");\n if (ctor?.type !== \"identifier\") return null;\n return aliases.get(ctor.text) ?? ctor.text;\n}",
- "span": "L250-L255"
- }
- },
- {
- "id": "src/graph/bindings.ts#visit",
- "name": "visit",
- "kind": "function",
- "path": "src/graph/bindings.ts",
- "span": "L162-L182",
- "signature": "function visit( node: Parser.SyntaxNode, lang: Language, scope: string[], classScope: string | null, bindings: FileBindings, aliases: Map<string, string>, ): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "fdf216c190f3963b2a3f1d7e97be3a98709efedc167777ceb79abf31c0d078ce",
- "summary_state": "ready",
- "summary": "Recursively processes nodes in the syntax tree to build up type bindings and scopes, facilitating comprehensive type analysis.",
- "crux": {
- "code": "function visit(\n node: Parser.SyntaxNode,\n lang: Language,\n scope: string[],\n classScope: string | null,\n bindings: FileBindings,\n aliases: Map<string, string>,\n): void {\n if (lang === \"python\") handlePy(node, scope, classScope, bindings, aliases);\n else if (lang === \"go\") handleGo(node, scope, bindings);\n else handleTs(node, scope, classScope, bindings, aliases);\n",
- "span": "L162-L173"
- }
- },
- {
- "id": "src/graph/build.ts",
- "name": "build.ts",
- "kind": "file",
- "path": "src/graph/build.ts",
- "span": "L1-L216",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "fe97252d1fd39edda75b40124928d3b820b85f148d380790db92533e5f3ad13d",
- "chars": 8436,
- "summary_state": "stale",
- "summary": "This file defines the logic for building a graph representation of a code repository, including parsing source files and resolving dependencies.",
- "crux": null
- },
- {
- "id": "src/graph/build.ts#applyMinSubstanceGuard",
- "name": "applyMinSubstanceGuard",
- "kind": "function",
- "path": "src/graph/build.ts",
- "span": "L32-L47",
- "signature": "function applyMinSubstanceGuard(scopes: ScopeV1[], nodes: NodeV1[]): ScopeV1[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "ef7ca21fa81ef0b4227430f8b8310ffd8b4b056b13c21789f21461de81bfd36b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/build.ts#buildGraph",
- "name": "buildGraph",
- "kind": "function",
- "path": "src/graph/build.ts",
- "span": "L104-L215",
- "signature": "async function buildGraph( dir: string, opts: GraphBuildOptions = {}, ): Promise<GraphBuildResult>",
- "exported": true,
- "origin": "ast",
- "body_hash": "b8723ad9efae1fbdba009f24539b489eac1f9fa7f13848a46a828b9508cf7f20",
- "summary_state": "stale",
- "summary": "This function orchestrates the entire graph building process, from parsing source files to writing the final graph output.",
- "crux": {
- "code": "export async function buildGraph(\n dir: string,\n opts: GraphBuildOptions = {},\n): Promise<GraphBuildResult> {\n const root = resolve(dir);\n const outDir = contextDirFor(root, opts.contextDir);\n const files = listSourceFiles(root, outDir);\n\n const nodes: NodeV1[] = [];\n const rawEdges: RawEdge[] = [];\n const sources = new Map<string, string>();\n const langs = new Set<Language>();",
- "span": "L78-L89"
- }
- },
- {
- "id": "src/graph/build.ts#GraphBuildOptions",
- "name": "GraphBuildOptions",
- "kind": "interface",
- "path": "src/graph/build.ts",
- "span": "L49-L62",
- "signature": "interface GraphBuildOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "09dc36c486449d7e17f9fe9ddb0fbed6ba20104b28ff1ab6f38a1de344975ea8",
- "summary_state": "ready",
- "summary": "This interface specifies options for customizing the graph build process, including output directory and summarization settings.",
- "crux": null
- },
- {
- "id": "src/graph/build.ts#GraphBuildResult",
- "name": "GraphBuildResult",
- "kind": "interface",
- "path": "src/graph/build.ts",
- "span": "L64-L77",
- "signature": "interface GraphBuildResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "66898435298552c740219c8ca50f06d430551bf605b2903064a6459db0095ec3",
- "summary_state": "ready",
- "summary": "This interface outlines the structure of the result returned from the graph build process, detailing the generated graph's metadata and statistics.",
- "crux": null
- },
- {
- "id": "src/graph/build.ts#listSourceFiles",
- "name": "listSourceFiles",
- "kind": "function",
- "path": "src/graph/build.ts",
- "span": "L80-L82",
- "signature": "function listSourceFiles(root: string, outDir: string): string[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "09c58d7bb3b7c55ef5688af18f41e0d4eda5c4cb444a9ffb3290697794834ba0",
- "summary_state": "ready",
- "summary": "This function retrieves a list of source files from a given directory, excluding the output directory and unsupported languages.",
- "crux": {
- "code": " return walkDir(root).filter((f) => !f.startsWith(outDir) && languageOf(f) !== null);",
- "span": "L52-L52"
- }
- },
- {
- "id": "src/graph/build.ts#readGoModules",
- "name": "readGoModules",
- "kind": "function",
- "path": "src/graph/build.ts",
- "span": "L88-L102",
- "signature": "function readGoModules(root: string): GoModule[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "02cadfa0e94721ec1c8de1ff70b9b2b3e1ce1c54086c49d5163d3a7f3b266982",
- "summary_state": "ready",
- "summary": "This function identifies and reads Go modules from the repository to facilitate edge resolution for Go import paths.",
- "crux": {
- "code": "function readGoModules(root: string): GoModule[] {\n const mods: GoModule[] = [];\n for (const f of walkDir(root)) {\n if (basename(f) !== \"go.mod\") continue;\n try {\n const m = readFileSync(f, \"utf8\").match(/^\\s*module\\s+(\\S+)/m);\n if (!m) continue;\n const rel = relative(root, dirname(f)).split(sep).join(\"/\");\n mods.push({ module: m[1], dir: rel === \"\" ? \".\" : rel });\n } catch {\n /* unreadable go.mod — skip this module */\n }",
- "span": "L62-L73"
- }
- },
- {
- "id": "src/graph/cards.ts",
- "name": "cards.ts",
- "kind": "file",
- "path": "src/graph/cards.ts",
- "span": "L1-L282",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "c45f4bd1be271a9c5ff01c04bae2a2d4fd761eb85bd8d4a302738e6744e636b1",
- "chars": 10357,
- "summary_state": "ready",
- "summary": "This module generates markdown cards that summarize source files and their symbols, facilitating easier navigation and understanding of the codebase.",
- "crux": null
- },
- {
- "id": "src/graph/cards.ts#CardFileInfo",
- "name": "CardFileInfo",
- "kind": "interface",
- "path": "src/graph/cards.ts",
- "span": "L26-L32",
- "signature": "interface CardFileInfo",
- "exported": true,
- "origin": "ast",
- "body_hash": "bc918882882be5be102c1a9ff1127e100c3fe83f380828d8d62ad1063693d6db",
- "summary_state": "ready",
- "summary": "Holds information about a card's path, the source file it mirrors, and the number of symbols it contains.",
- "crux": null
- },
- {
- "id": "src/graph/cards.ts#cardPathFor",
- "name": "cardPathFor",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L41-L44",
- "signature": "function cardPathFor(outDir: string, sourcePath: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "af75114def2a26067a8f595c3937bb3e8aea6f257205de146b435f804729c1cc",
- "summary_state": "ready",
- "summary": "Constructs the markdown file path for a card by replacing the source file's extension with .md.",
- "crux": {
- "code": " const md = sourcePath.replace(/\\.[^./]+$/, \"\") + \".md\";\n return join(outDir, md);",
- "span": "L42-L43"
- }
- },
- {
- "id": "src/graph/cards.ts#CardStats",
- "name": "CardStats",
- "kind": "interface",
- "path": "src/graph/cards.ts",
- "span": "L34-L38",
- "signature": "interface CardStats",
- "exported": true,
- "origin": "ast",
- "body_hash": "1c3e57e9c5bf329c4248f01c551c6d0a2a9af394980dbe537f026c15c933fe58",
- "summary_state": "ready",
- "summary": "Tracks the statistics of card generation, including how many cards were written and pruned.",
- "crux": null
- },
- {
- "id": "src/graph/cards.ts#conceptsByPath",
- "name": "conceptsByPath",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L60-L70",
- "signature": "function conceptsByPath(outDir: string): Map<string, string[]>",
- "exported": false,
- "origin": "ast",
- "body_hash": "ea08d13224b288f66ba9378d392b955657db6661dee7d33b3c68ad04cf5594b1",
- "summary_state": "ready",
- "summary": "Maps source paths to their corresponding concept node slugs, facilitating the creation of up-links in cards.",
- "crux": {
- "code": " for (const node of readNodes(outDir)) {\n for (const src of node.sources) {\n const list = map.get(src.path) ?? [];\n list.push(node.slug);\n map.set(src.path, list);\n }\n }\n return map;",
- "span": "L62-L69"
- }
- },
- {
- "id": "src/graph/cards.ts#CoverRef",
- "name": "CoverRef",
- "kind": "interface",
- "path": "src/graph/cards.ts",
- "span": "L225-L230",
- "signature": "interface CoverRef",
- "exported": true,
- "origin": "ast",
- "body_hash": "b905acf1827c4b1c7b212eee322bfffb6ef0bea196277d5c20e66157c11ada8f",
- "summary_state": "ready",
- "summary": "Represents a symbol covered by a concept node, including its name, kind, and location.",
- "crux": null
- },
- {
- "id": "src/graph/cards.ts#listExistingCards",
- "name": "listExistingCards",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L102-L121",
- "signature": "function listExistingCards(outDir: string): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "8b1734950dc59ac84f5de645a42350d5024837fe4b4ace980c469f68649fd1a2",
- "summary_state": "ready",
- "summary": "Lists all existing markdown card files in the output directory, excluding concept nodes and specific top-level files.",
- "crux": {
- "code": "function listExistingCards(outDir: string): string[] {\n const out: string[] = [];\n const walk = (dir: string): void => {\n for (const e of readdirSync(dir, { withFileTypes: true })) {\n if (e.isDirectory()) {\n if (dir === outDir && (e.name === CACHE_DIR || e.name === GRAPH_DIR)) continue;\n walk(join(dir, e.name));\n } else if (e.isFile() && e.name.endsWith(\".md\")) {\n out.push(join(dir, e.name));\n }\n }\n };",
- "span": "L102-L113"
- }
- },
- {
- "id": "src/graph/cards.ts#listExistingCards.walk",
- "name": "walk",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L104-L113",
- "signature": "walk = (dir: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "ba6dde008e5cbd07399e992182055ae60636e68a4acfa2457d3cf8f317b1dc84",
- "summary_state": "ready",
- "summary": "Recursively traverses directories to find markdown files for existing cards.",
- "crux": {
- "code": " if (e.isDirectory()) {\n if (dir === outDir && (e.name === CACHE_DIR || e.name === GRAPH_DIR)) continue;\n walk(join(dir, e.name));\n } else if (e.isFile() && e.name.endsWith(\".md\")) {\n out.push(join(dir, e.name));\n }",
- "span": "L106-L111"
- }
- },
- {
- "id": "src/graph/cards.ts#oneLiner",
- "name": "oneLiner",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L53-L57",
- "signature": "function oneLiner(node: NodeV1): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "f164d443f9ca9ab5785a61f1cd21b9fee70b0d444dc9161f8f79b26dae28b571",
- "summary_state": "ready",
- "summary": "Retrieves a concise summary or signature of a node, prioritizing the summary if available.",
- "crux": {
- "code": " const s = node.summary?.trim();\n if (s) return s.split(\"\\n\")[0].trim();\n return node.signature?.trim() ?? \"\";",
- "span": "L54-L56"
- }
- },
- {
- "id": "src/graph/cards.ts#pruneEmptyDirs",
- "name": "pruneEmptyDirs",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L124-L144",
- "signature": "function pruneEmptyDirs(outDir: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "7c58c5eb58948bd353fa0eaf6db614a6f3a66943f10e422352dbb62a67308d46",
- "summary_state": "ready",
- "summary": "Removes empty directories from the output directory, ensuring a clean structure after card generation.",
- "crux": {
- "code": " // returns true if dir is empty after visiting children\n let empty = true;\n for (const e of readdirSync(dir, { withFileTypes: true })) {\n if (dir === outDir && (e.name === CACHE_DIR || e.name === GRAPH_DIR)) {\n empty = false;\n continue;\n }\n const child = join(dir, e.name);\n if (e.isDirectory()) {\n if (visit(child)) rmSync(child, { recursive: true, force: true });\n else empty = false;\n } else {",
- "span": "L126-L137"
- }
- },
- {
- "id": "src/graph/cards.ts#pruneEmptyDirs.visit",
- "name": "visit",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L125-L142",
- "signature": "visit = (dir: string): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "f92031cda975f10bd7b09706f2b6ad09399ac06897c6ed89afd114ccd1032e7e",
- "summary_state": "ready",
- "summary": "Visits directories to determine if they are empty after processing their contents.",
- "crux": {
- "code": " // returns true if dir is empty after visiting children\n let empty = true;\n for (const e of readdirSync(dir, { withFileTypes: true })) {\n if (dir === outDir && (e.name === CACHE_DIR || e.name === GRAPH_DIR)) {\n empty = false;\n continue;\n }\n const child = join(dir, e.name);\n if (e.isDirectory()) {\n if (visit(child)) rmSync(child, { recursive: true, force: true });\n else empty = false;\n } else {",
- "span": "L126-L137"
- }
- },
- {
- "id": "src/graph/cards.ts#renderCard",
- "name": "renderCard",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L73-L99",
- "signature": "function renderCard( sourcePath: string, fileNode: NodeV1 | undefined, symbols: NodeV1[], conceptSlugs: string[], ): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "6f1076c555ccd93979599e6ab7a7c3f5e7ec69f8dfc9c12893ed5caf0052cdf3",
- "summary_state": "ready",
- "summary": "Generates the markdown content for a card, including the source file's summary and its symbols.",
- "crux": {
- "code": " const fileSummary = fileNode ? oneLiner(fileNode) : \"\";\n if (fileSummary) lines.push(fileSummary, \"\");\n\n const sorted = [...symbols].sort(\n (a, b) => spanStart(a.span) - spanStart(b.span) || a.name.localeCompare(b.name),\n );\n for (const n of sorted) {\n const desc = oneLiner(n);\n const tail = desc ? ` — ${desc}` : \"\";\n lines.push(`- ${n.name} · ${n.kind} · ${n.span}${tail}`);\n }\n if (sorted.length === 0) lines.push(\"_No extracted symbols in this file._\");",
- "span": "L86-L97"
- }
- },
- {
- "id": "src/graph/cards.ts#spanStart",
- "name": "spanStart",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L47-L50",
- "signature": "function spanStart(span: string): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "c556d0ee70964557755678794a12cb22fe0f72f158ec186e32975ff01e8d44eb",
- "summary_state": "ready",
- "summary": "Extracts the starting line number from a given span string, returning 0 if the format is unparseable.",
- "crux": {
- "code": " const m = /^L(\\d+)/.exec(span);\n return m ? Number(m[1]) : 0;",
- "span": "L48-L49"
- }
- },
- {
- "id": "src/graph/cards.ts#writeCards",
- "name": "writeCards",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L150-L183",
- "signature": "function writeCards(graph: GraphV1, outDir: string): CardStats",
- "exported": true,
- "origin": "ast",
- "body_hash": "ef71834ba8bfb9f009b04afe5a3d63bb0d3a2e44384377cd02045a57c18e28c6",
- "summary_state": "ready",
- "summary": "Writes markdown cards for each source file, reflecting the source tree and pruning any outdated cards.",
- "crux": {
- "code": " for (const [sourcePath, group] of byPath) {\n const fileNode = group.find((n) => n.kind === \"file\");\n const symbols = group.filter((n) => n.kind !== \"file\");\n const cardPath = cardPathFor(outDir, sourcePath);\n mkdirSync(dirname(cardPath), { recursive: true });\n writeFileSync(cardPath, renderCard(sourcePath, fileNode, symbols, concepts.get(sourcePath) ?? []));\n written.add(cardPath);\n files.push({ card: relative(outDir, cardPath), path: sourcePath, symbols: symbols.length });\n }",
- "span": "L162-L170"
- }
- },
- {
- "id": "src/graph/cards.ts#writeCovers",
- "name": "writeCovers",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L245-L281",
- "signature": "function writeCovers(graph: GraphV1, outDir: string): number",
- "exported": true,
- "origin": "ast",
- "body_hash": "09f3d72e14a6ded303111818b4b4d8edce65b6f7e807e521001ca0b6eca973ba",
- "summary_state": "ready",
- "summary": "Backfills concept nodes with a list of symbols they cover, enhancing their metadata for better navigation.",
- "crux": {
- "code": " const covers: CoverRef[] = [];\n for (const path of [...new Set(sources.map((s) => s.path ?? \"\"))].sort()) {\n for (const n of symbolsByPath.get(path) ?? []) {\n covers.push({ symbol: n.name, kind: n.kind, at: `${n.path}:${n.span}` });\n }\n }\n\n // Re-stringify with covers appended last, so re-runs produce a stable diff.\n const { covers: _prev, ...rest } = parsed.data as Record<string, unknown>;\n writeFileSync(full, matter.stringify(parsed.content, { ...rest, covers }));\n enriched++;",
- "span": "L270-L280"
- }
- },
- {
- "id": "src/graph/cards.ts#writeIndex",
- "name": "writeIndex",
- "kind": "function",
- "path": "src/graph/cards.ts",
- "span": "L189-L222",
- "signature": "function writeIndex(outDir: string, files: CardFileInfo[]): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "e2e95c9595a5386036af4f9beeda3897fe1b22e53fcb5d79d2c07fa3276481c1",
- "summary_state": "ready",
- "summary": "This function creates an index markdown file that lists concept nodes and per-file cards, providing a quick reference for navigating the repository.",
- "crux": {
- "code": " \"# graft — repo map\",\n \"\",\n \"Small markdown nodes summarising this repo. `grep` any term, symbol, or\",\n 'filename here, or run `graft ask \"<task>\"`. Each node carries prose plus exact',\n \"`file:line`; open a source file only to edit the named span.\",\n \"\",\n ];\n\n const concepts = readNodes(outDir).sort((a, b) => a.slug.localeCompare(b.slug));\n if (concepts.length) {\n lines.push(\"## Concepts\", \"\");\n for (const c of concepts) {",
- "span": "L191-L202"
- }
- },
- {
- "id": "src/graph/check.ts",
- "name": "check.ts",
- "kind": "file",
- "path": "src/graph/check.ts",
- "span": "L1-L136",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "5358023fe498fb2878e3aa9b6756272c39926dda865c6495d8f33d13c5ceb376",
- "chars": 4952,
- "summary_state": "ready",
- "summary": "Ensures that the committed graph.json accurately reflects the current state of the codebase, identifying any discrepancies.",
- "crux": {
- "code": " const committed = readGraph(wiringPath(outDir));\n if (!committed) {\n result.missing = true;\n return result;\n }\n\n // Freshly extract Tier-1 nodes from the code on disk (same file set as build).\n const current = new Map<string, string>(); // id → body_hash\n for (const file of listSourceFiles(root, outDir)) {\n const lang = languageOf(file)!;\n let source: string;\n try {",
- "span": "L57-L68"
- }
- },
- {
- "id": "src/graph/check.ts#checkGraph",
- "name": "checkGraph",
- "kind": "function",
- "path": "src/graph/check.ts",
- "span": "L43-L101",
- "signature": "function checkGraph(dir: string, opts: GraphCheckOptions = {}): GraphCheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "992b2d4efeb36d881a5818fd98f1de4be119e1c5597e207578b55bbe40797aca",
- "summary_state": "ready",
- "summary": "This function checks if the current code's graph representation matches the committed graph, identifying any added, removed, or changed nodes.",
- "crux": {
- "code": " const committedById = new Map(committed.nodes.map((n) => [n.id, n]));\n for (const [id, node] of committedById) {\n const now = current.get(id);\n if (now === undefined) result.removed.push(id);\n else if (now !== node.body_hash) result.changed.push(id);\n if (node.summary_state === \"stale\") result.stale.push(id);\n if (node.summary_state === \"pending\") result.pending++;\n }\n for (const id of current.keys()) {\n if (!committedById.has(id)) result.added.push(id);\n }\n",
- "span": "L81-L92"
- }
- },
- {
- "id": "src/graph/check.ts#formatGraphCheckReport",
- "name": "formatGraphCheckReport",
- "kind": "function",
- "path": "src/graph/check.ts",
- "span": "L104-L135",
- "signature": "function formatGraphCheckReport(r: GraphCheckResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "a2489371664b6c2729925dffd9852c85aecbd21a019f72549435ce51a4113b86",
- "summary_state": "ready",
- "summary": "Generates a human-readable report summarizing the results of the graph check, indicating any issues found.",
- "crux": {
- "code": " const lines: string[] = [\"graph check: STALE\", \"\"];\n const structural = r.added.length + r.removed.length + r.changed.length;\n if (r.changed.length) {\n lines.push(`changed (${r.changed.length}):`);\n for (const id of r.changed) lines.push(` ~ ${id}`);\n }\n if (r.added.length) {\n lines.push(`added (${r.added.length}):`);\n for (const id of r.added) lines.push(` + ${id}`);\n }\n if (r.removed.length) {\n lines.push(`removed (${r.removed.length}):`);",
- "span": "L113-L124"
- }
- },
- {
- "id": "src/graph/check.ts#GraphCheckOptions",
- "name": "GraphCheckOptions",
- "kind": "interface",
- "path": "src/graph/check.ts",
- "span": "L39-L41",
- "signature": "interface GraphCheckOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "deb14aad6be2a49d6d6d059a64a4eb55a7041a039cbabf92c55222647c2b0679",
- "summary_state": "ready",
- "summary": "This interface provides optional parameters for configuring the context directory when performing a graph check.",
- "crux": null
- },
- {
- "id": "src/graph/check.ts#GraphCheckResult",
- "name": "GraphCheckResult",
- "kind": "interface",
- "path": "src/graph/check.ts",
- "span": "L27-L37",
- "signature": "interface GraphCheckResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "8b12129196b2a1b6d3c7a45a086708e123527cbc0417ce5db07a710a853719c0",
- "summary_state": "ready",
- "summary": "This interface defines the structure of the result returned by the graph check, detailing the state of the graph in relation to the code.",
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts",
- "name": "enrich.ts",
- "kind": "file",
- "path": "src/graph/enrich.ts",
- "span": "L1-L213",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "c15a0aef99e54d4c24ac748a9b33373512f1511b1f5bcd830f9d2e407ff47917",
- "chars": 8350,
- "summary_state": "ready",
- "summary": "This file implements a mechanism to enrich graph nodes with summaries and cruxes based on their state and prior computations.",
- "crux": {
- "code": " // Which nodes actually need an LLM call this run (after cache carry-over).\n const dirty: NodeV1[] = [];\n\n for (const node of nodes) {\n const was = prior.get(node.id);\n if (was?.summary_state === \"ready\" && was.body_hash === node.body_hash) {\n node.summary = was.summary;\n node.crux = was.crux;\n node.summary_state = \"ready\";\n stats.cached++;\n continue;\n }",
- "span": "L56-L67"
- }
- },
- {
- "id": "src/graph/enrich.ts#buildCrux",
- "name": "buildCrux",
- "kind": "function",
- "path": "src/graph/enrich.ts",
- "span": "L188-L203",
- "signature": "function buildCrux(r: NodeCrux, node: NodeV1, source: string, lineCount: number): Crux | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "b8e82b1a1f721cdba2a3ff1a6d46db8b30a0048178d7c7e7df0731e60c059a81",
- "summary_state": "ready",
- "summary": "Extracts and formats the crux text from a source file based on the model's provided line range.",
- "crux": {
- "code": "function buildCrux(r: NodeCrux, node: NodeV1, source: string, lineCount: number): Crux | null {\n // 0/0 (or an invalid range) is the model saying \"nothing to highlight here\".\n if (r.crux_start < 1 || r.crux_end < r.crux_start) return null;\n const [nodeStart, nodeEnd] = spanLines(node.span, lineCount);\n const start = Math.max(nodeStart, Math.min(r.crux_start, nodeEnd));\n let end = Math.max(start, Math.min(r.crux_end, nodeEnd));\n\n // Keep the crux readable: if the model pointed at a big region, store its\n // leading slice (the anchor it chose) rather than the whole blob — still the\n // most important part, and the full definition is reachable via node.span.\n if (end - start + 1 > MAX_CRUX_LINES) end = start + MAX_CRUX_LINES - 1;",
- "span": "L162-L172"
- }
- },
- {
- "id": "src/graph/enrich.ts#collectFileCrux",
- "name": "collectFileCrux",
- "kind": "function",
- "path": "src/graph/enrich.ts",
- "span": "L161-L181",
- "signature": "async function collectFileCrux( summarizer: CruxSummarizer, path: string, source: string, refs: NodeRef[], ): Promise<{ results: Map<string, NodeCrux>; error?: string }>",
- "exported": false,
- "origin": "ast",
- "body_hash": "e549b76d14ae5d596c084dd5f655bded2092a36e3505ff6135c054ccf043efda",
- "summary_state": "ready",
- "summary": "Collects crux information for nodes in a file, handling potential errors and ensuring partial results are returned.",
- "crux": {
- "code": " const list = await summarizer.describeFile({ path, source, nodes: missing });\n for (const r of list) if (!results.has(r.id)) results.set(r.id, r);\n missing = refs.filter((r) => !results.has(r.id));",
- "span": "L146-L148"
- }
- },
- {
- "id": "src/graph/enrich.ts#enrichGraph",
- "name": "enrichGraph",
- "kind": "function",
- "path": "src/graph/enrich.ts",
- "span": "L48-L136",
- "signature": "async function enrichGraph( nodes: NodeV1[], prior: Map<string, NodeV1>, sources: Map<string, string>, opts: EnrichOptions = {}, ): Promise<EnrichStats>",
- "exported": true,
- "origin": "ast",
- "body_hash": "f740a8a6957661bd4bedddbe0cbb0c5541e30a3b303cbd01830cf761644e0801",
- "summary_state": "ready",
- "summary": "This function processes graph nodes to update their summaries and cruxes based on their state and prior data, potentially invoking an LLM for new computations.",
- "crux": {
- "code": " // Which nodes actually need an LLM call this run (after cache carry-over).\n const dirty: NodeV1[] = [];\n\n for (const node of nodes) {\n const was = prior.get(node.id);\n if (was?.summary_state === \"ready\" && was.body_hash === node.body_hash) {\n node.summary = was.summary;\n node.crux = was.crux;\n node.summary_state = \"ready\";\n stats.cached++;\n continue;\n }",
- "span": "L56-L67"
- }
- },
- {
- "id": "src/graph/enrich.ts#EnrichOptions",
- "name": "EnrichOptions",
- "kind": "interface",
- "path": "src/graph/enrich.ts",
- "span": "L31-L38",
- "signature": "interface EnrichOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "a721d24d1e8ad1777bd74f54cdc1f4edcc55d3576b065557a0b10b3fe4b4a183",
- "summary_state": "ready",
- "summary": "This interface defines options for enriching graph nodes, including whether to compute new summaries and the level of concurrency for processing.",
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts#EnrichStats",
- "name": "EnrichStats",
- "kind": "interface",
- "path": "src/graph/enrich.ts",
- "span": "L40-L46",
- "signature": "interface EnrichStats",
- "exported": true,
- "origin": "ast",
- "body_hash": "63a93dfdf61c8da0d3a05c601b74619ad84942d37425b4391b8da2b01d2d694c",
- "summary_state": "ready",
- "summary": "Tracks the statistics of the enrichment process, including counts of cached, computed, stale, and pending nodes.",
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts#mapWithConcurrency",
- "name": "mapWithConcurrency",
- "kind": "function",
- "path": "src/graph/enrich.ts",
- "span": "L139-L154",
- "signature": "async function mapWithConcurrency<T, R>( items: T[], limit: number, fn: (item: T, index: number) => Promise<R>, ): Promise<R[]>",
- "exported": false,
- "origin": "ast",
- "body_hash": "a4c9438ba7cb397b91c5ab695f081e20db5678db9eea0be35a086fda1d9714e5",
- "summary_state": "ready",
- "summary": "This function executes a provided asynchronous function over a list of items with a specified limit on concurrent executions, preserving the order of results.",
- "crux": null
- },
- {
- "id": "src/graph/enrich.ts#spanLines",
- "name": "spanLines",
- "kind": "function",
- "path": "src/graph/enrich.ts",
- "span": "L206-L212",
- "signature": "function spanLines(span: string, fileLines: number): [number, number]",
- "exported": false,
- "origin": "ast",
- "body_hash": "d7f074949c35eaa3f883194e41cda61c34a624a66ec368ef352dc7f0b2e7e256",
- "summary_state": "ready",
- "summary": "Parses a line span string into a clamped range of line numbers, ensuring valid boundaries.",
- "crux": null
- },
- {
- "id": "src/graph/extract.ts",
- "name": "extract.ts",
- "kind": "file",
- "path": "src/graph/extract.ts",
- "span": "L1-L500",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "8449958d4b5fd74c8eafeb488ae16cb60dcaf3e5fcaf1e3069cebf4cf9ef48d9",
- "chars": 19990,
- "summary_state": "ready",
- "summary": "This file provides functionality to extract and represent code structure from source files into a standardized format for further processing.",
- "crux": {
- "code": "/**\n * Tier-1 extraction: source file → {@link NodeV1}[] + raw edges, via tree-sitter.\n *\n * Deterministic and dependency-only (no LLM, no network). Emits one node per\n * definition (file, class, function, method, interface, type, enum, and TS\n * arrow-function consts) plus unresolved edge intents. Edge *targets* are\n * resolved against the whole-repo node index later, in build.ts.\n */",
- "span": "L1-L8"
- }
- },
- {
- "id": "src/graph/extract.ts#calleeName",
- "name": "calleeName",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L405-L428",
- "signature": "function calleeName( node: Parser.SyntaxNode, lang: Language, ): { name: string; viaMember: boolean; receiver?: string } | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "9c911a104a07cec5e22e4448197a54939d77a9eda45a1a14c67a62a722f61de3",
- "summary_state": "ready",
- "summary": "Extracts the name and context of a function call from the syntax tree, including receiver information.",
- "crux": {
- "code": "function calleeName(\n node: Parser.SyntaxNode,\n lang: Language,\n): { name: string; viaMember: boolean; receiver?: string } | null {\n const fn = node.childForFieldName(\"function\");\n if (!fn) return null;\n if (fn.type === \"identifier\") return { name: fn.text, viaMember: false };\n if (lang === \"python\" && fn.type === \"attribute\") {\n const a = fn.childForFieldName(\"attribute\") ?? fn.namedChildren.at(-1);\n return a ? { name: a.text, viaMember: true, receiver: pyReceiver(fn) } : null;\n }\n if (lang === \"go\" && fn.type === \"selector_expression\") {",
- "span": "L405-L416"
- }
- },
- {
- "id": "src/graph/extract.ts#clean",
- "name": "clean",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L482-L489",
- "signature": "function clean(raw: string): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "38343faa35f42e41e98c93d6816454cfe294123505d2bae14f045624cf6d80e1",
- "summary_state": "ready",
- "summary": "Cleans and normalizes a function signature by removing unnecessary whitespace and punctuation.",
- "crux": {
- "code": "function clean(raw: string): string | null {\n const sig = raw\n .replace(/\\s+/g, \" \")\n .trim()\n .replace(/(=>|[{:=])\\s*$/, \"\")\n .trim();\n return sig || null;",
- "span": "L280-L286"
- }
- },
- {
- "id": "src/graph/extract.ts#DefDescriptor",
- "name": "DefDescriptor",
- "kind": "interface",
- "path": "src/graph/extract.ts",
- "span": "L150-L156",
- "signature": "interface DefDescriptor",
- "exported": false,
- "origin": "ast",
- "body_hash": "ed38eee7d2f573a31deea6ef15de2d05409f8ecf4f39ab4234c0bbcc14c66198",
- "summary_state": "ready",
- "summary": "Describes a code definition with its relevant metadata for extraction purposes.",
- "crux": {
- "code": "interface DefDescriptor {\n name: string; // the bare symbol name (used for the node's `name` and call resolution)\n idName?: string; // id-scope segment when it differs from `name` (Go: `Receiver.method`)\n kind: Kind;\n headerEnd: number; // char index where the signature ends (body starts)\n hashNode: Parser.SyntaxNode; // node whose text forms body_hash / span\n}",
- "span": "L150-L156"
- }
- },
- {
- "id": "src/graph/extract.ts#describe",
- "name": "describe",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L282-L313",
- "signature": "function describe(node: Parser.SyntaxNode, ctx: WalkCtx): DefDescriptor | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "724ba386be23031ee221f1721155296b86dce3c9908c26bdd68848e0e6a37a1b",
- "summary_state": "ready",
- "summary": "Identifies and describes the shape of code definitions based on their syntax tree representation.",
- "crux": {
- "code": "function describe(node: Parser.SyntaxNode, ctx: WalkCtx): DefDescriptor | null {\n if (ctx.lang === \"go\") return describeGo(node, ctx);\n\n const mapped = ctx.kinds[node.type];\n if (mapped) {\n const name = node.childForFieldName(\"name\")?.text;\n if (!name) return null;\n let kind = mapped;\n if (ctx.lang === \"python\" && mapped === \"function\" && ctx.enclosingKind === \"class\") {\n kind = \"method\";\n }\n const body = node.childForFieldName(\"body\");",
- "span": "L282-L293"
- }
- },
- {
- "id": "src/graph/extract.ts#describeGo",
- "name": "describeGo",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L318-L356",
- "signature": "function describeGo(node: Parser.SyntaxNode, _ctx: WalkCtx): DefDescriptor | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "4e7f1a5f6681729c6592b514762ab354ecf0bf9b2a8cd86bfea5415d75b6c56d",
- "summary_state": "ready",
- "summary": "Describes Go-specific code definitions, including functions and methods, from the syntax tree.",
- "crux": {
- "code": "function describeGo(node: Parser.SyntaxNode, _ctx: WalkCtx): DefDescriptor | null {\n if (node.type === \"function_declaration\") {\n const name = node.childForFieldName(\"name\")?.text;\n if (!name) return null;\n const body = node.childForFieldName(\"body\");\n return { name, kind: \"function\", headerEnd: body ? body.startIndex : node.endIndex, hashNode: node };\n }\n\n if (node.type === \"method_declaration\") {\n const name = node.childForFieldName(\"name\")?.text;\n if (!name) return null;\n const recv = goReceiverType(node);",
- "span": "L318-L329"
- }
- },
- {
- "id": "src/graph/extract.ts#extractFile",
- "name": "extractFile",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L168-L209",
- "signature": "function extractFile(rel: string, source: string, lang: Language): ExtractResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "5522857555c6dfaa28878349fb9388619fa166f997b7bb5b442ae6be1153a595",
- "summary_state": "ready",
- "summary": "Extracts nodes and edges from a source file, representing its structure in a standardized format.",
- "crux": {
- "code": "export function extractFile(rel: string, source: string, lang: Language): ExtractResult {\n parser.setLanguage(GRAMMARS[lang] as never);\n const root = parseSource(source);\n const bindings = collectBindings(root, lang);\n\n const nodes: NodeV1[] = [\n {\n id: rel,\n name: basename(rel),\n kind: \"file\",\n path: rel,\n span: `L1-L${root.endPosition.row + 1}`,",
- "span": "L168-L179"
- }
- },
- {
- "id": "src/graph/extract.ts#ExtractResult",
- "name": "ExtractResult",
- "kind": "interface",
- "path": "src/graph/extract.ts",
- "span": "L47-L50",
- "signature": "interface ExtractResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "7bef2217a3edd0ae64ae3585affe29e5bc0e0f471ca1d7901910fa737e4d01af",
- "summary_state": "ready",
- "summary": "Holds the result of the extraction process, containing nodes and raw edges.",
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#fileResidual",
- "name": "fileResidual",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L78-L89",
- "signature": "function fileResidual(source: string, symbols: NodeV1[]): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "fc01f952b2cff13ab8af6748f1ad94168e5cef0015a100f090331cd428d09f4b",
- "summary_state": "ready",
- "summary": "Extracts the module-level residual content from a source file that is not covered by any symbol definitions.",
- "crux": {
- "code": "function fileResidual(source: string, symbols: NodeV1[]): string {\n const lines = source.split(\"\\n\");\n const covered = new Uint8Array(lines.length + 2);\n for (const s of symbols) {\n const m = s.span.match(/^L(\\d+)-L(\\d+)$/);\n if (!m) continue;\n for (let r = Number(m[1]); r <= Number(m[2]) && r < covered.length; r++) covered[r] = 1;\n }\n const kept: string[] = [];\n for (let i = 0; i < lines.length; i++) if (!covered[i + 1]) kept.push(lines[i]);\n return searchBody(kept.join(\" \"), MAX_FILE_BODY_CHARS);\n}",
- "span": "L78-L89"
- }
- },
- {
- "id": "src/graph/extract.ts#goExported",
- "name": "goExported",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L370-L374",
- "signature": "function goExported(name: string): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "d63372a3436b530577ba2055e6ea2ba440d16206d299c19a81e6f9d11fbb857e",
- "summary_state": "ready",
- "summary": "Determines if a Go symbol is exported based on its naming convention.",
- "crux": {
- "code": "function goExported(name: string): boolean {\n const own = name.includes(\".\") ? name.slice(name.lastIndexOf(\".\") + 1) : name;\n const first = own[0] ?? \"\";\n return first !== first.toLowerCase() && first === first.toUpperCase();\n}",
- "span": "L370-L374"
- }
- },
- {
- "id": "src/graph/extract.ts#goReceiverType",
- "name": "goReceiverType",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L360-L366",
- "signature": "function goReceiverType(node: Parser.SyntaxNode): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "1487f5274066918e95fd92b382636fe3ead06f927349744bde2289a732c5c7ae",
- "summary_state": "ready",
- "summary": "Extracts the base type name of a receiver for Go methods, if applicable.",
- "crux": {
- "code": "function goReceiverType(node: Parser.SyntaxNode): string | null {\n const recv = node.childForFieldName(\"receiver\"); // parameter_list\n const param = recv?.namedChildren.find((c) => c.type === \"parameter_declaration\");\n let type = param?.childForFieldName(\"type\");\n if (type?.type === \"pointer_type\") type = type.namedChildren.at(-1) ?? null;\n return type?.type === \"type_identifier\" ? type.text : null;\n}",
- "span": "L360-L366"
- }
- },
- {
- "id": "src/graph/extract.ts#heritageEdges",
- "name": "heritageEdges",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L376-L403",
- "signature": "function heritageEdges(node: Parser.SyntaxNode, classId: string, ctx: WalkCtx): RawEdge[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "a73044fd4c3636db388dcd17dc5cebfa2090322501f2674989e892f89f2e1b03",
- "summary_state": "ready",
- "summary": "Generates edges representing class inheritance and implementation relationships.",
- "crux": {
- "code": "function heritageEdges(node: Parser.SyntaxNode, classId: string, ctx: WalkCtx): RawEdge[] {\n const edges: RawEdge[] = [];\n if (ctx.lang === \"python\") {\n const supers = node.childForFieldName(\"superclasses\"); // argument_list\n for (const c of supers?.namedChildren ?? []) {\n if (c.type === \"identifier\") {\n edges.push({ source: classId, relation: \"extends\", name: c.text, file: ctx.rel });\n }\n }\n return edges;\n }\n const heritage = node.namedChildren.find((c) => c.type === \"class_heritage\");",
- "span": "L215-L226"
- }
- },
- {
- "id": "src/graph/extract.ts#importSpecifier",
- "name": "importSpecifier",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L463-L479",
- "signature": "function importSpecifier(node: Parser.SyntaxNode, lang: Language): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "0a0b7079eca209656048651dc132aa4dd7ed735b2ee04bc63e3a887e5aa0a1e8",
- "summary_state": "ready",
- "summary": "Extracts the module path from an import statement in the syntax tree.",
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#isImport",
- "name": "isImport",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L456-L461",
- "signature": "function isImport(node: Parser.SyntaxNode, lang: Language): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "dd3cad276b6f4a2258722865073f7cde28f74612df009ea697b0ce6d599257b1",
- "summary_state": "ready",
- "summary": "Determines if a syntax node represents an import statement in the code.",
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#Language",
- "name": "Language",
- "kind": "type",
- "path": "src/graph/extract.ts",
- "span": "L18-L18",
- "signature": "type Language = \"typescript\" | \"tsx\" | \"python\" | \"go\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "4a8375e329e48af90b91a0dd802628af5549f46d771302e53de74dbde006ebc2",
- "summary_state": "ready",
- "summary": "Defines a type representing the supported programming languages for extraction.",
- "crux": null
- },
- {
- "id": "src/graph/extract.ts#languageOf",
- "name": "languageOf",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L21-L28",
- "signature": "function languageOf(path: string): Language | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "bee30bc0236b0322b93537a0f778f70b33a0fa9df86ad4413c6ef71ee088a733",
- "summary_state": "ready",
- "summary": "Determines the programming language of a given file path based on its extension.",
- "crux": {
- "code": " if (p.endsWith(\".tsx\") || p.endsWith(\".jsx\")) return \"tsx\";\n if (/\\.(ts|mts|cts|js|mjs|cjs)$/.test(p)) return \"typescript\";\n if (p.endsWith(\".py\") || p.endsWith(\".pyi\")) return \"python\";\n if (p.endsWith(\".go\")) return \"go\";\n return null;",
- "span": "L23-L27"
- }
- },
- {
- "id": "src/graph/extract.ts#parseSource",
- "name": "parseSource",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L164-L166",
- "signature": "function parseSource(source: string): Parser.SyntaxNode",
- "exported": false,
- "origin": "ast",
- "body_hash": "213c9aa0ad691d3ceb1ad5f59d083930b3db690225b344bb24cf024d96181cdb",
- "summary_state": "ready",
- "summary": "Parses the source code into a syntax tree while handling large files in manageable chunks.",
- "crux": {
- "code": "function parseSource(source: string): Parser.SyntaxNode {\n return parser.parse((index: number) => source.slice(index, index + PARSE_CHUNK)).rootNode;\n}",
- "span": "L164-L166"
- }
- },
- {
- "id": "src/graph/extract.ts#pyReceiver",
- "name": "pyReceiver",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L432-L441",
- "signature": "function pyReceiver(fn: Parser.SyntaxNode): string | undefined",
- "exported": false,
- "origin": "ast",
- "body_hash": "2b1521e31249912b974bf8cf1d5cc98a72b3a4ea8a1e2eec09552a96cb4c81eb",
- "summary_state": "ready",
- "summary": "Identifies the receiver of a Python method call from its syntax tree representation.",
- "crux": {
- "code": "function pyReceiver(fn: Parser.SyntaxNode): string | undefined {\n const obj = fn.childForFieldName(\"object\");\n if (obj?.type === \"identifier\") return obj.text;\n if (obj?.type === \"attribute\") {\n const innerObj = obj.childForFieldName(\"object\");\n const innerAttr = obj.childForFieldName(\"attribute\");\n if (innerObj?.type === \"identifier\" && innerObj.text === \"self\" && innerAttr) return `self.${innerAttr.text}`;\n }\n return undefined;\n}",
- "span": "L432-L441"
- }
- },
- {
- "id": "src/graph/extract.ts#RawEdge",
- "name": "RawEdge",
- "kind": "interface",
- "path": "src/graph/extract.ts",
- "span": "L34-L45",
- "signature": "interface RawEdge",
- "exported": true,
- "origin": "ast",
- "body_hash": "125f3fc1acb36f3855a6d3a1e320c3b1cfb1a7c9601004cd7fb6861458281026",
- "summary_state": "ready",
- "summary": "Represents an unresolved edge in the code structure that will be resolved later during processing.",
- "crux": {
- "code": "export interface RawEdge {\n source: string; // resolved node id\n relation: Relation;\n file: string; // the file this edge originates in (scopes name resolution)\n targetId?: string; // already-resolved target (contains)\n specifier?: string; // module path to resolve (imports)\n name?: string; // symbol name to resolve (extends/implements/calls)\n viaMember?: boolean; // calls: was it `obj.foo()` (→ prefer method targets)?\n /** calls with viaMember: the receiver's resolved type name (from bindings /\n * self / this / Go receiver), when a confident local clue exists. */\n recvType?: string;\n}",
- "span": "L34-L45"
- }
- },
- {
- "id": "src/graph/extract.ts#searchBody",
- "name": "searchBody",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L67-L70",
- "signature": "function searchBody(text: string, max = MAX_BODY_CHARS): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "8ec6ac10c60767f9a430043e8d62d03fa463664677d35afd08916c65aadd2ae7",
- "summary_state": "ready",
- "summary": "Normalizes and truncates the body of a code definition for efficient searching.",
- "crux": {
- "code": "function searchBody(text: string, max = MAX_BODY_CHARS): string {\n const norm = text.replace(/\\s+/g, \" \").trim();\n return norm.length > max ? norm.slice(0, max) : norm;\n}",
- "span": "L67-L70"
- }
- },
- {
- "id": "src/graph/extract.ts#tsExported",
- "name": "tsExported",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L492-L499",
- "signature": "function tsExported(node: Parser.SyntaxNode): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "dd6c141ae925e333baeebc3f3d19c3043670c76a4f32b711e8166ac6eb86f2f4",
- "summary_state": "ready",
- "summary": "Checks if a node is exported based on its ancestor nodes in the syntax tree.",
- "crux": {
- "code": "function tsExported(node: Parser.SyntaxNode): boolean {\n let p = node.parent;\n while (p) {\n if (p.type === \"export_statement\") return true;\n p = p.parent;\n }\n return false;",
- "span": "L290-L296"
- }
- },
- {
- "id": "src/graph/extract.ts#tsReceiver",
- "name": "tsReceiver",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L444-L454",
- "signature": "function tsReceiver(fn: Parser.SyntaxNode): string | undefined",
- "exported": false,
- "origin": "ast",
- "body_hash": "633ed0d3c059772fe3d875bcf394cac70e7cab8d7f76fc033ac16358fea1e073",
- "summary_state": "ready",
- "summary": "Identifies the receiver of a TypeScript method call from its syntax tree representation.",
- "crux": {
- "code": "function tsReceiver(fn: Parser.SyntaxNode): string | undefined {\n const obj = fn.childForFieldName(\"object\");\n if (obj?.type === \"this\") return \"this\";\n if (obj?.type === \"identifier\") return obj.text;\n if (obj?.type === \"member_expression\") {\n const innerObj = obj.childForFieldName(\"object\");\n const innerProp = obj.childForFieldName(\"property\");\n if (innerObj?.type === \"this\" && innerProp) return `this.${innerProp.text}`;\n }\n return undefined;\n}",
- "span": "L444-L454"
- }
- },
- {
- "id": "src/graph/extract.ts#walk",
- "name": "walk",
- "kind": "function",
- "path": "src/graph/extract.ts",
- "span": "L211-L278",
- "signature": "function walk(node: Parser.SyntaxNode, ctx: WalkCtx, out: NodeV1[], edges: RawEdge[]): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "aa75459c73b63a4c6489c7a1ea205af0552500aafa250eb055edebafbb84b671",
- "summary_state": "ready",
- "summary": "Recursively traverses the syntax tree to collect definitions and their relationships.",
- "crux": {
- "code": "function walk(node: Parser.SyntaxNode, ctx: WalkCtx, out: NodeV1[], edges: RawEdge[]): void {\n const desc = describe(node, ctx);\n if (desc) {\n // `idName` scopes the id (e.g. a Go method under its receiver: `#DB.Count`) while\n // `name` stays the bare symbol name so member-call resolution matches it.\n const idPart = desc.idName ?? desc.name;\n const id = `${ctx.rel}#${[...ctx.scope, idPart].join(\".\")}`;\n out.push({\n id,\n name: desc.name,\n kind: desc.kind,\n path: ctx.rel,",
- "span": "L211-L222"
- }
- },
- {
- "id": "src/graph/extract.ts#WalkCtx",
- "name": "WalkCtx",
- "kind": "interface",
- "path": "src/graph/extract.ts",
- "span": "L136-L147",
- "signature": "interface WalkCtx",
- "exported": true,
- "origin": "ast",
- "body_hash": "fea4ebb4bc9443534fb5fb32b3928c9ebb1a108f885567ae40ab831845f1a594",
- "summary_state": "ready",
- "summary": "Contextual information used during the traversal of the syntax tree for code extraction.",
- "crux": null
- },
- {
- "id": "src/graph/load.ts",
- "name": "load.ts",
- "kind": "file",
- "path": "src/graph/load.ts",
- "span": "L1-L101",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "115b75e947618be7755ac59310f898943cb4c1d8266bdf5a4a30fdca4956914a",
- "chars": 4000,
- "summary_state": "ready",
- "summary": "This module implements a caching mechanism to optimize the loading of graph and ask index data by avoiding unnecessary re-parsing of files when their metadata has not changed.",
- "crux": {
- "code": " * Keyed by `(path, mtimeMs, size)` from `statSync`, so a rebuild (`graft\n * build`) is picked up on the very next call with no polling and no TTL: the\n * stat is cheap relative to the parse it guards, and a changed mtime or size\n * invalidates the entry. A missing file returns null and is never cached — the\n * next call re-stats, so a file created after a prior miss is picked up\n * immediately (no negative caching).\n *\n * **Cache invalidation assumption:** This strategy assumes filesystem mtime\n * resolution is finer than build cadence. This is safe because `graft build`\n * rewrites the entire output file atomically, so same-size rewrites within a\n * single mtime tick (which would serve stale data) are infeasible in practice.\n * On APFS (macOS) mtime is nanosecond-granular and a build takes milliseconds,",
- "span": "L8-L19"
- }
- },
- {
- "id": "src/graph/load.ts#__resetParseCounts",
- "name": "__resetParseCounts",
- "kind": "function",
- "path": "src/graph/load.ts",
- "span": "L45-L48",
- "signature": "function __resetParseCounts(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "28ab92cf6abb38e1d4de7cc6ddc03e68cb6acb34aabc4d0553264118a856676f",
- "summary_state": "ready",
- "summary": "Resets the counters that track the number of cache misses for graph and ask index parsing, ensuring a clean state for tests.",
- "crux": {
- "code": " __parseCount.graph = 0;\n __parseCount.askIndex = 0;\n}",
- "span": "L46-L48"
- }
- },
- {
- "id": "src/graph/load.ts#CacheEntry",
- "name": "CacheEntry",
- "kind": "interface",
- "path": "src/graph/load.ts",
- "span": "L31-L35",
- "signature": "interface CacheEntry<T>",
- "exported": false,
- "origin": "ast",
- "body_hash": "7b772fc4a0a866aa5269e023f8eae6c328a7c3f2e6108c498c231326d7e344f7",
- "summary_state": "ready",
- "summary": "Defines the structure for cache entries, encapsulating the metadata and value of cached items to facilitate efficient cache management.",
- "crux": {
- "code": "interface CacheEntry<T> {\n mtimeMs: number;\n size: number;\n value: T | null;\n}",
- "span": "L31-L35"
- }
- },
- {
- "id": "src/graph/load.ts#loadAskIndexCached",
- "name": "loadAskIndexCached",
- "kind": "function",
- "path": "src/graph/load.ts",
- "span": "L95-L100",
- "signature": "function loadAskIndexCached(outDir: string): AskIndex | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "63af14b09b6d8f7534ccbb2eb58a5e80acfc526b67371bf46acad0de46aa6f07",
- "summary_state": "ready",
- "summary": "Caches the result of reading an ask index from a file, ensuring that it is only re-read when the file's metadata indicates a change.",
- "crux": {
- "code": " return loadCached(askIndexCache, path, () => readAskIndex(outDir), () => {\n __parseCount.askIndex++;\n });",
- "span": "L97-L99"
- }
- },
- {
- "id": "src/graph/load.ts#loadCached",
- "name": "loadCached",
- "kind": "function",
- "path": "src/graph/load.ts",
- "span": "L59-L81",
- "signature": "function loadCached<T>( cache: Map<string, CacheEntry<T>>, path: string, parse: () => T | null, onParse: () => void, ): T | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "68385d5b28bc28f8be320bc279f74823f8bba12c26c0938152ff332102572035",
- "summary_state": "ready",
- "summary": "Loads a cached value from a specified cache, re-parsing the value if the file's metadata has changed, thus ensuring up-to-date data retrieval.",
- "crux": {
- "code": " if (!st) {\n // Missing file: don't negatively cache, and drop any stale entry so a\n // subsequently-created file at the same path is re-parsed, not served\n // from a cache keyed to the old (mtime, size).\n cache.delete(path);\n return null;\n }\n const cached = cache.get(path);\n if (cached && cached.mtimeMs === st.mtimeMs && cached.size === st.size) {\n return cached.value;\n }\n onParse();",
- "span": "L66-L77"
- }
- },
- {
- "id": "src/graph/load.ts#loadGraphCached",
- "name": "loadGraphCached",
- "kind": "function",
- "path": "src/graph/load.ts",
- "span": "L86-L91",
- "signature": "function loadGraphCached(outDir: string): GraphV1 | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "d7c103b7e1115f04dcd8713d605dc9955ed0098e746f30bcd7f6f288e78ac257",
- "summary_state": "ready",
- "summary": "Caches the result of reading a graph from a file, ensuring that it is only re-read when the file's metadata indicates a change.",
- "crux": {
- "code": " return loadCached(graphCache, path, () => readGraph(path), () => {\n __parseCount.graph++;\n });",
- "span": "L88-L90"
- }
- },
- {
- "id": "src/graph/load.ts#statOf",
- "name": "statOf",
- "kind": "function",
- "path": "src/graph/load.ts",
- "span": "L50-L57",
- "signature": "function statOf(path: string): { mtimeMs: number; size: number } | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "acb9f673ef79f4c554be70b06fc65d7f2c7501eb029a590c4a0df65470d3677d",
- "summary_state": "ready",
- "summary": "Retrieves the metadata (mtime and size) of a file, returning null if the file does not exist, which is essential for cache validation.",
- "crux": {
- "code": " const s = statSync(path);\n return { mtimeMs: s.mtimeMs, size: s.size };",
- "span": "L52-L53"
- }
- },
- {
- "id": "src/graph/map.ts",
- "name": "map.ts",
- "kind": "file",
- "path": "src/graph/map.ts",
- "span": "L1-L349",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "ff983cae1ca4418ca34200cf6a3d073be3ca2bf281d6d0ce7db5d839c70724fc",
- "chars": 14233,
- "summary_state": "stale",
- "summary": "Builds a structured representation of a repository's file and symbol organization based on their relationships, facilitating easier navigation and understanding of the codebase.",
- "crux": {
- "code": "export function buildRepoMap(graph: GraphV1, opts: BuildRepoMapOptions = {}): RepoMap {\n const maxDirs = opts.maxDirs ?? DEFAULT_MAX_DIRS;\n const hubsPerDir = opts.hubsPerDir ?? DEFAULT_HUBS_PER_DIR;\n const hotspotsN = opts.hotspots ?? DEFAULT_HOTSPOTS;\n\n const fileNodes = graph.nodes.filter((n) => n.kind === \"file\");\n const totalFiles = fileNodes.length;\n\n // Pass 1: depth-1 file counts, to find (at most one) group over the\n // split threshold — two groups can't both exceed 60% of the same total.\n const depth1FileCounts = new Map<string, number>();\n for (const n of fileNodes) {",
- "span": "L112-L123"
- }
- },
- {
- "id": "src/graph/map.ts#basenameOf",
- "name": "basenameOf",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L287-L290",
- "signature": "function basenameOf(path: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "eec53beedb7464e5d97f487106cabdb9015de90a2378b2751fd4bb4087406ae6",
- "summary_state": "ready",
- "summary": "Extracts the base name from a file path, simplifying the representation of file names in the output.",
- "crux": {
- "code": "function basenameOf(path: string): string {\n const i = path.lastIndexOf(\"/\");\n return i >= 0 ? path.slice(i + 1) : path;\n}",
- "span": "L184-L187"
- }
- },
- {
- "id": "src/graph/map.ts#buildRepoMap",
- "name": "buildRepoMap",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L233-L283",
- "signature": "function buildRepoMap(graph: GraphV1, opts: BuildRepoMapOptions = {}): RepoMap",
- "exported": true,
- "origin": "ast",
- "body_hash": "c8f1d96ad188205e586437f2fef50e730b1dec47a96cea27413028a7e7953b38",
- "summary_state": "stale",
- "summary": "Constructs the repository map from a given graph, organizing files and symbols into a structured format for easy access.",
- "crux": {
- "code": "export function buildRepoMap(graph: GraphV1, opts: BuildRepoMapOptions = {}): RepoMap {\n const maxDirs = opts.maxDirs ?? DEFAULT_MAX_DIRS;\n const hubsPerDir = opts.hubsPerDir ?? DEFAULT_HUBS_PER_DIR;\n const hotspotsN = opts.hotspots ?? DEFAULT_HOTSPOTS;\n\n const fileNodes = graph.nodes.filter((n) => n.kind === \"file\");\n const totalFiles = fileNodes.length;\n\n // Pass 1: depth-1 file counts, to find (at most one) group over the\n // split threshold — two groups can't both exceed 60% of the same total.\n const depth1FileCounts = new Map<string, number>();\n for (const n of fileNodes) {",
- "span": "L112-L123"
- }
- },
- {
- "id": "src/graph/map.ts#BuildRepoMapOptions",
- "name": "BuildRepoMapOptions",
- "kind": "interface",
- "path": "src/graph/map.ts",
- "span": "L83-L90",
- "signature": "interface BuildRepoMapOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "270b8285c1189b3c2fcafcf501677802ec6efcc18d350c5dfa5a80e7df791512",
- "summary_state": "ready",
- "summary": "Specifies options for building the repository map, allowing customization of directory and hub limits.",
- "crux": {
- "code": "export interface BuildRepoMapOptions {\n /** Max directory entries kept (the rest are counted into `dropped`). Default 16. */\n maxDirs?: number;\n /** Max hubs listed per directory. Default 3. */\n hubsPerDir?: number;\n /** Max global hotspots. Default 12. */\n hotspots?: number;\n}",
- "span": "L51-L58"
- }
- },
- {
- "id": "src/graph/map.ts#computeDirEntries",
- "name": "computeDirEntries",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L150-L220",
- "signature": "function computeDirEntries( nodes: NodeV1[], inDegree: Map<string, number>, maxDirs: number, hubsPerDir: number, stripPrefix: string, ): { dirs: DirEntry[]; dropped: number }",
- "exported": false,
- "origin": "ast",
- "body_hash": "89ce156fc147c16ae2389d80a35f5c78bc15585be723b7f9be1375edddc08ccb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/map.ts#computeDirEntries.depthFor",
- "name": "depthFor",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L181-L181",
- "signature": "depthFor = (rp: string): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "fa8a0202ba4f055fc9faf17f63e03c4c664e188cde40e5a4b9d99073e69bf3c0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/map.ts#computeDirEntries.fullPath",
- "name": "fullPath",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L197-L198",
- "signature": "fullPath = (relKey: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "8a0ef0fac8fc38c066c8f07811812c74fe336f4f056ec1deac35cc2f8a7d4ee1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/map.ts#computeDirEntries.relPath",
- "name": "relPath",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L160-L161",
- "signature": "relPath = (path: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "e328c1f8cf98bcacb217917ad520408d106a6f55cc22ee8da7e284b120597e7e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/map.ts#computeInDegree",
- "name": "computeInDegree",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L110-L117",
- "signature": "function computeInDegree(graph: GraphV1): Map<string, number>",
- "exported": false,
- "origin": "ast",
- "body_hash": "614d2e67e179ee5a934d6c1b03134ca1e1c394d3036a1754bd41dd7ee8dcc1b7",
- "summary_state": "ready",
- "summary": "Calculates the in-degree of nodes in the graph, determining the number of incoming edges for each target, which is crucial for identifying hubs.",
- "crux": {
- "code": "function computeInDegree(graph: GraphV1): Map<string, number> {\n const deg = new Map<string, number>();\n for (const e of graph.edges) {\n if (!WALK_RELATIONS.has(e.relation)) continue;\n deg.set(e.target, (deg.get(e.target) ?? 0) + 1);\n }\n return deg;\n}",
- "span": "L78-L85"
- }
- },
- {
- "id": "src/graph/map.ts#DirEntry",
- "name": "DirEntry",
- "kind": "interface",
- "path": "src/graph/map.ts",
- "span": "L35-L47",
- "signature": "interface DirEntry",
- "exported": true,
- "origin": "ast",
- "body_hash": "158040217cb955840c0f2108e9ad39ee425c252f7c25a87f504f2c09c45d116f",
- "summary_state": "stale",
- "summary": "Represents a directory entry in the repository map, summarizing its contents and associated hubs for better navigation.",
- "crux": {
- "code": "export interface DirEntry {\n path: string;\n files: number;\n symbols: number;\n languages: string[];\n hubs: Hub[];\n}",
- "span": "L33-L39"
- }
- },
- {
- "id": "src/graph/map.ts#dirKey",
- "name": "dirKey",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L102-L105",
- "signature": "function dirKey(path: string, depth: number): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "8888f547f8daa2607546a3010a0af99b212d4c13618efa6140c60e3677d1ac85",
- "summary_state": "ready",
- "summary": "Generates a directory key based on the specified depth, facilitating the grouping of files in the repository map.",
- "crux": {
- "code": "function dirKey(path: string, depth: number): string {\n const segments = path.split(\"/\");\n return segments.slice(0, Math.min(depth, segments.length)).join(\"/\");\n}",
- "span": "L70-L73"
- }
- },
- {
- "id": "src/graph/map.ts#droppedNote",
- "name": "droppedNote",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L312-L315",
- "signature": "function droppedNote(dropped: number): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "be3ed5e5a2d742afb7bb6d4c59a9186617c0338d82c9fd2f34d1fa45e2996694",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/map.ts#formatDirHub",
- "name": "formatDirHub",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L292-L294",
- "signature": "function formatDirHub(h: Hub): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "7e92c9bff3f9e0cf1649150c2d86d768ec091f8cbf6f62000cc30e0aa22fd9eb",
- "summary_state": "ready",
- "summary": "Formats a hub's information for display, providing a user-friendly representation of its attributes.",
- "crux": {
- "code": "function formatDirHub(h: Hub): string {\n return `${h.name} (${basenameOf(h.path)}, ${h.inDegree}←)`;\n}",
- "span": "L189-L191"
- }
- },
- {
- "id": "src/graph/map.ts#formatDirLine",
- "name": "formatDirLine",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L296-L305",
- "signature": "function formatDirLine(d: DirEntry): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "0ec18de44fc444674ed72472aac2bbd15cc8c12ec3b8ed06014b58467bc487a6",
- "summary_state": "stale",
- "summary": "Formats a directory entry for display, summarizing its contents and associated hubs in a readable format.",
- "crux": {
- "code": "function formatDirLine(d: DirEntry): string {\n const label = `${d.path}/`.padEnd(DIR_COL_WIDTH);\n const counts = `${d.files} files · ${d.symbols} symbols`;\n const hubs = d.hubs.length ? ` hubs: ${d.hubs.map(formatDirHub).join(\", \")}` : \"\";\n return `${label}${counts}${hubs}`;\n}",
- "span": "L193-L198"
- }
- },
- {
- "id": "src/graph/map.ts#formatHotspot",
- "name": "formatHotspot",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L307-L309",
- "signature": "function formatHotspot(h: Hub): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "2b94aab983d26d13940a46012331d1b3c7254f92b56a9c3a19e7964efee38cd4",
- "summary_state": "ready",
- "summary": "Formats a hotspot's information for display, detailing its attributes in a clear manner.",
- "crux": {
- "code": "function formatHotspot(h: Hub): string {\n return `${h.name} · ${h.kind} · ${h.path}:${h.span} · ${h.inDegree}←`;\n}",
- "span": "L200-L202"
- }
- },
- {
- "id": "src/graph/map.ts#formatRepoMap",
- "name": "formatRepoMap",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L323-L348",
- "signature": "function formatRepoMap(map: RepoMap): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "31f3c7d36c8a1836355a5d7bf267ed4cad5bd0178e1d4961521b19bce1e0323e",
- "summary_state": "stale",
- "summary": "Renders the repository map as a human-readable string, summarizing its contents and structure for easy understanding.",
- "crux": {
- "code": "export function formatRepoMap(map: RepoMap): string {\n const { totals } = map;\n const header = `repo map — ${totals.files} files · ${totals.symbols} symbols · ${totals.edges} edges · ${totals.languages.join(\", \")}`;\n\n const lines: string[] = [header, \"\"];\n for (const d of map.dirs) lines.push(formatDirLine(d));\n if (map.dropped > 0) {\n lines.push(`… +${map.dropped} more director${map.dropped === 1 ? \"y\" : \"ies\"} not shown (raise max-dirs to see more)`);\n }\n lines.push(\"\");\n lines.push(`hotspots: ${map.hotspots.map(formatHotspot).join(\" \")}`);\n",
- "span": "L210-L221"
- }
- },
- {
- "id": "src/graph/map.ts#Hub",
- "name": "Hub",
- "kind": "interface",
- "path": "src/graph/map.ts",
- "span": "L27-L33",
- "signature": "interface Hub",
- "exported": true,
- "origin": "ast",
- "body_hash": "1419fd8f2dea589de852c5fc3df6a8ee92ee056d4b321c2bd7eb5e726d30620d",
- "summary_state": "ready",
- "summary": "Defines the structure of a hub in the repository map, capturing its essential attributes for identification and ranking.",
- "crux": {
- "code": "export interface Hub {\n name: string;\n kind: string;\n path: string;\n span: string;\n inDegree: number;\n}",
- "span": "L25-L31"
- }
- },
- {
- "id": "src/graph/map.ts#RepoMap",
- "name": "RepoMap",
- "kind": "interface",
- "path": "src/graph/map.ts",
- "span": "L61-L81",
- "signature": "interface RepoMap",
- "exported": true,
- "origin": "ast",
- "body_hash": "9f2d4fd1588f4915e91af0089849682d51c3b7567c2361b532bc98d735b05850",
- "summary_state": "stale",
- "summary": "Encapsulates the entire repository map structure, providing a comprehensive overview of files, symbols, and their relationships.",
- "crux": {
- "code": "export interface RepoMap {\n totals: { files: number; symbols: number; edges: number; languages: string[] };\n /** Sorted by symbol count desc (ties by path asc), capped at `maxDirs`. */\n dirs: DirEntry[];\n /** Global top hubs by inDegree, ties by name asc then path asc. */\n hotspots: Hub[];\n /** Directory groups beyond the `maxDirs` cap — never silently dropped. */\n dropped: number;\n}",
- "span": "L41-L49"
- }
- },
- {
- "id": "src/graph/map.ts#ScopeGroup",
- "name": "ScopeGroup",
- "kind": "interface",
- "path": "src/graph/map.ts",
- "span": "L52-L59",
- "signature": "interface ScopeGroup",
- "exported": true,
- "origin": "ast",
- "body_hash": "31a321d3eb0409fc1fa81bfe0c321b1554bb39b5f4872f4c998d6961c9d37b35",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/map.ts#sortedLanguages",
- "name": "sortedLanguages",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L130-L137",
- "signature": "function sortedLanguages(paths: string[]): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "30c69f26bce208536a33c802d04d52eff2107fba4ce07daf17849f4858cb83f3",
- "summary_state": "ready",
- "summary": "Sorts and deduplicates the programming languages used in the repository, enhancing the metadata of the repository map.",
- "crux": {
- "code": "function sortedLanguages(paths: string[]): string[] {\n const set = new Set<string>();\n for (const p of paths) {\n const lang = languageOf(p);\n if (lang) set.add(lang);\n }\n return [...set].sort();\n}",
- "span": "L98-L105"
- }
- },
- {
- "id": "src/graph/map.ts#topHubs",
- "name": "topHubs",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L122-L128",
- "signature": "function topHubs(nodes: NodeV1[], inDegree: Map<string, number>, cap: number): Hub[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "eef17e5cf1d97a53a78541847f1ded2d9a8fdaaeff5a240a2798f32debb14fba",
- "summary_state": "ready",
- "summary": "Identifies the top hubs based on in-degree, ensuring that only significant nodes are included in the repository map.",
- "crux": {
- "code": "function topHubs(nodes: NodeV1[], inDegree: Map<string, number>, cap: number): Hub[] {\n return nodes\n .map((n) => ({ name: n.name, kind: n.kind, path: n.path, span: n.span, inDegree: inDegree.get(n.id) ?? 0 }))\n .filter((h) => h.inDegree > 0)\n .sort((a, b) => b.inDegree - a.inDegree || a.name.localeCompare(b.name) || a.path.localeCompare(b.path))\n .slice(0, cap);\n}",
- "span": "L90-L96"
- }
- },
- {
- "id": "src/graph/relations.ts",
- "name": "relations.ts",
- "kind": "file",
- "path": "src/graph/relations.ts",
- "span": "L1-L21",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e62bc9934057bf232f86edcf942e71b0a2f4c44b57ffd78ddb935b85ab75aca8",
- "chars": 796,
- "summary_state": "ready",
- "summary": "Defines a set of dependency relations for graph traversal, ensuring accurate representation of connections between symbols.",
- "crux": {
- "code": "export const WALK_RELATIONS: ReadonlySet<Relation> = new Set<Relation>([\n \"calls\",\n \"references\",\n \"imports\",\n \"implements\",\n \"extends\",\n]);",
- "span": "L14-L20"
- }
- },
- {
- "id": "src/graph/resolve.ts",
- "name": "resolve.ts",
- "kind": "file",
- "path": "src/graph/resolve.ts",
- "span": "L1-L259",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "23e2e29f6e907f079f0d214ac6ce24b6105c403a51da30c2f4d39494f4b6b110",
- "chars": 11721,
- "summary_state": "ready",
- "summary": "This module resolves various types of edges between nodes in a codebase, ensuring accurate connections based on defined relationships and confidence levels.",
- "crux": {
- "code": "export function resolveEdges(\n nodes: NodeV1[],\n rawEdges: RawEdge[],\n opts: ResolveOptions = {},\n): EdgeV1[] {\n const byId = new Map(nodes.map((n) => [n.id, n]));\n const globalName = new Map<string, NodeV1[]>();\n const perFileName = new Map<string, Map<string, NodeV1[]>>();\n // Owner-qualified method index: \"Owner.method\" → candidate method nodes, for\n // typed member-call resolution (recvType + name → a specific class's method).\n const ownerMethod = new Map<string, NodeV1[]>();\n // Go package resolution: dir (posix) → its `.go` file node ids, for import mapping.",
- "span": "L51-L62"
- }
- },
- {
- "id": "src/graph/resolve.ts#GoModule",
- "name": "GoModule",
- "kind": "interface",
- "path": "src/graph/resolve.ts",
- "span": "L39-L42",
- "signature": "interface GoModule",
- "exported": true,
- "origin": "ast",
- "body_hash": "52dff1265ffff874843c00b1425c7af639b28683dd0866e48a25e8b406543ec5",
- "summary_state": "ready",
- "summary": "Defines the structure for a Go module, enabling the mapping of Go import paths to their corresponding directories in the repository.",
- "crux": {
- "code": "export interface GoModule {\n module: string;\n dir: string;\n}",
- "span": "L39-L42"
- }
- },
- {
- "id": "src/graph/resolve.ts#push",
- "name": "push",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L142-L146",
- "signature": "function push<T>(map: Map<string, T[]>, key: string, val: T): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "0f349e9ed1ee9ef1c7695b65c3f3948140eb20a60f36ba9d915a79e92eed7391",
- "summary_state": "ready",
- "summary": "This function adds a value to an array in a map, creating the array if it doesn't exist, facilitating grouped storage of nodes.",
- "crux": null
- },
- {
- "id": "src/graph/resolve.ts#resolveEdges",
- "name": "resolveEdges",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L51-L140",
- "signature": "function resolveEdges( nodes: NodeV1[], rawEdges: RawEdge[], opts: ResolveOptions = {}, ): EdgeV1[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "0faf60f3424e744ecbd1e58dfe31e4afc1760c28211d27754f87cc308984b472",
- "summary_state": "ready",
- "summary": "Processes nodes and raw edges to create a list of resolved edges, ensuring accurate relationships based on various resolution strategies.",
- "crux": {
- "code": "export function resolveEdges(\n nodes: NodeV1[],\n rawEdges: RawEdge[],\n opts: ResolveOptions = {},\n): EdgeV1[] {\n const byId = new Map(nodes.map((n) => [n.id, n]));\n const globalName = new Map<string, NodeV1[]>();\n const perFileName = new Map<string, Map<string, NodeV1[]>>();\n // Owner-qualified method index: \"Owner.method\" → candidate method nodes, for\n // typed member-call resolution (recvType + name → a specific class's method).\n const ownerMethod = new Map<string, NodeV1[]>();\n // Go package resolution: dir (posix) → its `.go` file node ids, for import mapping.",
- "span": "L51-L62"
- }
- },
- {
- "id": "src/graph/resolve.ts#resolveEdges.add",
- "name": "add",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L97-L102",
- "signature": "add = (source: string, target: string, relation: Relation, confidence: EdgeV1[\"confidence\"])",
- "exported": true,
- "origin": "ast",
- "body_hash": "d56a5f75ce46c0a907240751e35c16d07beec97e4a61a83cf77cccfc9fea0d03",
- "summary_state": "ready",
- "summary": "Adds a new edge to the output if it hasn't been seen before, preventing duplicates in the resolved edges list.",
- "crux": {
- "code": " const add = (source: string, target: string, relation: Relation, confidence: EdgeV1[\"confidence\"]) => {\n const key = `${source}\\0${relation}\\0${target}`;\n if (seen.has(key)) return;\n seen.add(key);\n out.push({ source, target, relation, confidence });\n };",
- "span": "L97-L102"
- }
- },
- {
- "id": "src/graph/resolve.ts#resolveGoImport",
- "name": "resolveGoImport",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L243-L258",
- "signature": "function resolveGoImport(spec: string, modules: GoModule[], filesByDir: Map<string, string[]>): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c23e15aab9607316b1fe167acca80ba6c6fe19fc0b1fcd01f37000b7e8d20635",
- "summary_state": "ready",
- "summary": "Maps a Go import package path to an in-repo file node, handling module paths and ensuring correct resolution within the repository structure.",
- "crux": {
- "code": "function resolveGoImport(spec: string, modules: GoModule[], filesByDir: Map<string, string[]>): string {\n let best: { mod: GoModule; subpath: string } | null = null;\n for (const mod of modules) {\n let subpath: string | null = null;\n if (spec === mod.module) subpath = \"\";\n else if (spec.startsWith(mod.module + \"/\")) subpath = spec.slice(mod.module.length + 1);\n if (subpath === null) continue;\n if (!best || mod.module.length > best.mod.module.length) best = { mod, subpath };\n }\n if (!best) return spec; // stdlib / third-party — keep the package path\n\n const dir = posix.normalize(posix.join(best.mod.dir, best.subpath));",
- "span": "L243-L254"
- }
- },
- {
- "id": "src/graph/resolve.ts#resolveImport",
- "name": "resolveImport",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L219-L231",
- "signature": "function resolveImport(spec: string, file: string, byId: Map<string, NodeV1>): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "5dcee73ae49d61baf6cba0f1430bcc799975d19b6d72ac0a6da911e14fafa955",
- "summary_state": "ready",
- "summary": "This function resolves a module specifier to a file node ID if it points within the repository, ensuring correct imports.",
- "crux": {
- "code": "function resolveImport(spec: string, file: string, byId: Map<string, NodeV1>): string {\n if (!spec.startsWith(\".\")) return spec;\n const dir = posix.dirname(file.split(sep).join(\"/\"));\n const base = posix.normalize(posix.join(dir, spec));\n const noExt = base.replace(/\\.(js|jsx|mjs|cjs|ts|tsx|py)$/, \"\");\n const candidates = [\n base,\n ...IMPORT_EXTS.map((e) => noExt + e),\n ...IMPORT_EXTS.map((e) => `${noExt}/index${e}`),\n ];\n for (const c of candidates) if (byId.has(c)) return c;",
- "span": "L88-L98"
- }
- },
- {
- "id": "src/graph/resolve.ts#resolveName",
- "name": "resolveName",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L152-L164",
- "signature": "function resolveName( name: string, file: string, kinds: Kind[], perFileName: Map<string, Map<string, NodeV1[]>>, globalName: Map<string, NodeV1[]>, ): { id: string; confidence: EdgeV1[\"confidence\"] } | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "612a086f93eb383b759795d9e5b93d6f429bd4a17c22c9b3e65fcf7d79e0e6f0",
- "summary_state": "ready",
- "summary": "This function resolves a symbol name to its corresponding node ID, prioritizing local matches and handling ambiguities appropriately.",
- "crux": {
- "code": " if (local.length) return { id: local[0].id, confidence: \"extracted\" };\n const global = (globalName.get(name) ?? []).filter((n) => kinds.includes(n.kind));\n if (global.length === 1) return { id: global[0].id, confidence: \"inferred\" };",
- "span": "L78-L80"
- }
- },
- {
- "id": "src/graph/resolve.ts#ResolveOptions",
- "name": "ResolveOptions",
- "kind": "interface",
- "path": "src/graph/resolve.ts",
- "span": "L44-L49",
- "signature": "interface ResolveOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "e17c6299def742bdf54acc75fc234fd89ca3ae31fd45bf599cbe5a928a9af359",
- "summary_state": "ready",
- "summary": "Specifies options for resolving edges, including the Go modules present in the repository for accurate import path mapping.",
- "crux": {
- "code": "export interface ResolveOptions {\n /** The Go modules found in the repo. Enables mapping Go import package paths\n * (`example.com/app/pkg/util`) to the in-repo directory they name, relative to the\n * owning module's `go.mod` location. Empty/absent → Go imports stay external strings. */\n goModules?: GoModule[];\n}",
- "span": "L44-L49"
- }
- },
- {
- "id": "src/graph/resolve.ts#resolveTypedMember",
- "name": "resolveTypedMember",
- "kind": "function",
- "path": "src/graph/resolve.ts",
- "span": "L180-L213",
- "signature": "function resolveTypedMember( recvType: string, name: string, file: string, ownerMethod: Map<string, NodeV1[]>, classParents: Map<string, string[]>, ): { id: string; confidence: EdgeV1[\"confidence\"] } | \"ambiguous\" | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "8000e044cb5b139df44e3da0b2597da034e3325265e40670bb77b1ded16ead26",
- "summary_state": "ready",
- "summary": "Resolves a typed member call against a method index, traversing the inheritance chain to find the appropriate method or returning ambiguity if necessary.",
- "crux": {
- "code": "function resolveTypedMember(\n recvType: string,\n name: string,\n file: string,\n ownerMethod: Map<string, NodeV1[]>,\n classParents: Map<string, string[]>,\n): { id: string; confidence: EdgeV1[\"confidence\"] } | \"ambiguous\" | null {\n const MAX_DEPTH = 3;\n const visited = new Set<string>([recvType]);\n let frontier = [recvType];\n for (let depth = 0; depth <= MAX_DEPTH && frontier.length; depth++) {\n for (const type of frontier) {",
- "span": "L180-L191"
- }
- },
- {
- "id": "src/graph/scopes.ts",
- "name": "scopes.ts",
- "kind": "file",
- "path": "src/graph/scopes.ts",
- "span": "L1-L372",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a47e2a9da9c40f42134609f13edfefd91e9d0968787b2a3972fa6d6018f840e3",
- "chars": 15844,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#Candidate",
- "name": "Candidate",
- "kind": "interface",
- "path": "src/graph/scopes.ts",
- "span": "L168-L171",
- "signature": "interface Candidate",
- "exported": false,
- "origin": "ast",
- "body_hash": "920700cef1ecb9fbded680bf0681df3b552cdb08a50afc945cdd6acfb06e9e3f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#collectDirs",
- "name": "collectDirs",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L37-L56",
- "signature": "function collectDirs(root: string): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "478b43f13596223e67fc3f2c5b066cc5600316cdc4de6e221357326b4fdd5268",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#collectDirs.walk",
- "name": "walk",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L39-L53",
- "signature": "walk = (absDir: string, relDir: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "d26aac00009e7f76f7a7e1958f56bb969b377ef8c652b66dc68fc71d7cff8558",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#discoverScopes",
- "name": "discoverScopes",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L174-L307",
- "signature": "function discoverScopes(root: string): ScopeV1[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "fc453ac1d5073a3b586e525cbc660a729877e5c647b68b686c1cea8cc27d54d4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#discoverScopes.findNearestAncestorCandidate",
- "name": "findNearestAncestorCandidate",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L254-L264",
- "signature": "findNearestAncestorCandidate = ( prefix: string, set: ReadonlyMap<string, Candidate>, ): string | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "4464e314cca7c830c5dc94dc606b8cc97716610b8bd749a852f644bc639155bc",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#discoverWorkspaceChildren",
- "name": "discoverWorkspaceChildren",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L347-L364",
- "signature": "function discoverWorkspaceChildren(root: string): string[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "ad5224035ad5f438b40bc9fc34568618b42c75024d1340fbd41641b5e15488ea",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#parsePnpmPackagesList",
- "name": "parsePnpmPackagesList",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L60-L73",
- "signature": "function parsePnpmPackagesList(text: string): string[] | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "497850dd39cb4720ad3f6b0382182385c977c2178be815689d0b09eba7b3124b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#pathUnderPrefix",
- "name": "pathUnderPrefix",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L341-L343",
- "signature": "function pathUnderPrefix(path: string, prefix: string): boolean",
- "exported": true,
- "origin": "ast",
- "body_hash": "8ebed46dc3e14a70b8b67191511101e049c50147e543447e6c767de9d0d17665",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#readWorkspaceGlobs",
- "name": "readWorkspaceGlobs",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L78-L100",
- "signature": "function readWorkspaceGlobs(root: string): string[] | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "a9e6972a267d58908ccacb9ef1ce561ec1954bf860ac26b1f57a733920402267",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#resolveGlob",
- "name": "resolveGlob",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L105-L166",
- "signature": "function resolveGlob(root: string, pattern: string): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "910ede99c36cde0402153047838f72bdc950ecffd69af1c8dcc52dfc814f5c4d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#resolveGlob.listDirs",
- "name": "listDirs",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L140-L150",
- "signature": "listDirs = (absDir: string, relDir: string): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "c3df203af729650356a4e79472e0151bad1f5d5dc4dbb43016411c8e3c3c4ecf",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#scopeLabel",
- "name": "scopeLabel",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L323-L325",
- "signature": "function scopeLabel(prefix: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "9db6c83369a7345b2ce41c3541ed789ed91b628118ad0a2bd273a5fa6577e953",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#scopeOf",
- "name": "scopeOf",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L312-L318",
- "signature": "function scopeOf(path: string, scopes: ScopeV1[]): ScopeV1",
- "exported": true,
- "origin": "ast",
- "body_hash": "f022d55c61cb3099f89f4a71a90e41b7227e0ad6b697dd099c5bb25d30f0d349",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#scopesHereClause",
- "name": "scopesHereClause",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L331-L334",
- "signature": "function scopesHereClause(scopes: ScopeV1[]): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "8613ad77e3818712539ed410cac6a50fa428b86c7c4463bdee0709dcba65cac8",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/scopes.ts#scopesOfGraph",
- "name": "scopesOfGraph",
- "kind": "function",
- "path": "src/graph/scopes.ts",
- "span": "L369-L371",
- "signature": "function scopesOfGraph(graph: GraphV1): ScopeV1[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "f304cd86aef7ba19e8af9543afcc01dc714d92a64570c6207f005aa1a1ddb2d9",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/traverse-cli.ts",
- "name": "traverse-cli.ts",
- "kind": "file",
- "path": "src/graph/traverse-cli.ts",
- "span": "L1-L183",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "679656c15592b5abec15c01cfedb3f640b1366309724946b30a772b8753b32e5",
- "chars": 6675,
- "summary_state": "stale",
- "summary": "This file implements CLI commands for traversing a graph to find callers, callees, and impact of symbols, ensuring a consistent user experience across different commands.",
- "crux": {
- "code": "function edgesFor(kind: TraverseKind, graph: GraphV1, node: NodeV1, depth: number): EdgeHit[] {\n if (kind === \"callers\") return callersOf(graph, node);\n if (kind === \"callees\") return calleesOf(graph, node);\n return impactOf(graph, node, depth);\n}",
- "span": "L31-L35"
- }
- },
- {
- "id": "src/graph/traverse-cli.ts#CallersCliOptions",
- "name": "CallersCliOptions",
- "kind": "interface",
- "path": "src/graph/traverse-cli.ts",
- "span": "L21-L30",
- "signature": "interface CallersCliOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "b9bdee3683e8728ac1c920a050958fd8c63c7b7dc64ae1a59ceb3b31bcfd62c6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/traverse-cli.ts#callersSavings",
- "name": "callersSavings",
- "kind": "function",
- "path": "src/graph/traverse-cli.ts",
- "span": "L55-L65",
- "signature": "function callersSavings( graph: GraphV1, results: { symbol: NodeV1; hits: EdgeHit[] }[], ): Savings | undefined",
- "exported": true,
- "origin": "ast",
- "body_hash": "ebeebed400044ce3b14a43e1e5160325046e715b0e460c97510c0ebab593f5df",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/traverse-cli.ts#headerOf",
- "name": "headerOf",
- "kind": "function",
- "path": "src/graph/traverse-cli.ts",
- "span": "L38-L40",
- "signature": "function headerOf(n: NodeV1): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "cf66c3da70d4f8f16119a88148580dc66acba7d47a6c37e24480581733e44f48",
- "summary_state": "ready",
- "summary": "Generates a formatted header string for a node, providing essential information for display in CLI output.",
- "crux": {
- "code": "export function headerOf(n: NodeV1): string {\n return `${n.name} · ${n.kind} · ${n.path}:${n.span}`;\n}",
- "span": "L41-L43"
- }
- },
- {
- "id": "src/graph/traverse-cli.ts#hitJson",
- "name": "hitJson",
- "kind": "function",
- "path": "src/graph/traverse-cli.ts",
- "span": "L102-L111",
- "signature": "function hitJson(hit: EdgeHit): HitJson",
- "exported": false,
- "origin": "ast",
- "body_hash": "aeb2e815cc9892b59d1d815123cf824d7a3d11ccd4a031b92a779047885c70c7",
- "summary_state": "ready",
- "summary": "Transforms an EdgeHit into a JSON format, ensuring structured output for hits in the traversal results.",
- "crux": {
- "code": "function hitJson(hit: EdgeHit): HitJson {\n const out: HitJson = { id: hit.id, relation: hit.relation, depth: hit.depth };\n if (hit.node) {\n out.name = hit.node.name;\n out.kind = hit.node.kind;\n out.path = hit.node.path;\n out.span = hit.node.span;\n }\n return out;\n}",
- "span": "L88-L97"
- }
- },
- {
- "id": "src/graph/traverse-cli.ts#HitJson",
- "name": "HitJson",
- "kind": "interface",
- "path": "src/graph/traverse-cli.ts",
- "span": "L88-L96",
- "signature": "interface HitJson",
- "exported": false,
- "origin": "ast",
- "body_hash": "e30ba67c87b04404964f6fc197fbe1a5f31f00a74662498406e311388b72e416",
- "summary_state": "ready",
- "summary": "Defines the structure for hit details in JSON format, providing information about the relationship and depth of hits.",
- "crux": null
- },
- {
- "id": "src/graph/traverse-cli.ts#hitLine",
- "name": "hitLine",
- "kind": "function",
- "path": "src/graph/traverse-cli.ts",
- "span": "L44-L49",
- "signature": "function hitLine(direction: Direction, hit: EdgeHit, showDepth: boolean): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "a87b7edebb9ea1bb174c1439e0de0d80e9f56d692bd54f9a313cb27521abbfec",
- "summary_state": "stale",
- "summary": "Formats a single hit line for display, showing the relationship and details of a node in the context of the traversal.",
- "crux": {
- "code": "export function hitLine(kind: TraverseKind, hit: EdgeHit): string {\n const arrow = ARROW[kind];\n const depthTag = kind === \"impact\" ? ` [depth ${hit.depth}]` : \"\";\n const label = hit.node ? `${hit.node.name} (${hit.node.path}:${hit.node.span})` : `${hit.id} (unresolved import)`;\n return ` ${hit.relation} ${arrow} ${label}${depthTag}`;\n}",
- "span": "L45-L50"
- }
- },
- {
- "id": "src/graph/traverse-cli.ts#looseNoteFor",
- "name": "looseNoteFor",
- "kind": "function",
- "path": "src/graph/traverse-cli.ts",
- "span": "L68-L72",
- "signature": "function looseNoteFor(direction: Direction, name: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "99056d32295a0aae85f994c7a4c161a7978cde0784d02f1b5fe71fed4b1d5534",
- "summary_state": "stale",
- "summary": "Creates a user-friendly message when no edges are found for a symbol, guiding users on next steps.",
- "crux": {
- "code": "export function looseNoteFor(kind: TraverseKind, name: string): string {\n const label = kind === \"callees\" ? \"callees\" : \"callers\";\n const direction = kind === \"callees\" ? \"outgoing\" : \"incoming\";\n return ` no indexed ${label} — the graph has no ${direction} call/reference edges for this symbol; try grep -rn \"${name}\"`;\n}",
- "span": "L54-L58"
- }
- },
- {
- "id": "src/graph/traverse-cli.ts#MatchJson",
- "name": "MatchJson",
- "kind": "interface",
- "path": "src/graph/traverse-cli.ts",
- "span": "L82-L86",
- "signature": "interface MatchJson",
- "exported": false,
- "origin": "ast",
- "body_hash": "6d323182fe81c0462020fa7bbb67d2feb5a214b25ec176e5d2f109106079d09a",
- "summary_state": "ready",
- "summary": "Defines the structure for matching results in JSON format, encapsulating symbol information and associated hits.",
- "crux": null
- },
- {
- "id": "src/graph/traverse-cli.ts#resolveDirection",
- "name": "resolveDirection",
- "kind": "function",
- "path": "src/graph/traverse-cli.ts",
- "span": "L114-L119",
- "signature": "function resolveDirection(raw: string | undefined): Direction",
- "exported": false,
- "origin": "ast",
- "body_hash": "807b24d3052edc03c2f217c2a11927bc76a3e1f6000ae35d5fd85f53bb1ee1a0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/traverse-cli.ts#runCallersCommand",
- "name": "runCallersCommand",
- "kind": "function",
- "path": "src/graph/traverse-cli.ts",
- "span": "L127-L182",
- "signature": "function runCallersCommand(query: string, dir: string, opts: CallersCliOptions): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "b2c975fdf09ac0c9efac3210c1d8b8e8a36f598ee0b94a5b278f56cd9e369daa",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/traverse-cli.ts#symbolJson",
- "name": "symbolJson",
- "kind": "function",
- "path": "src/graph/traverse-cli.ts",
- "span": "L98-L100",
- "signature": "function symbolJson(n: NodeV1): SymbolJson",
- "exported": false,
- "origin": "ast",
- "body_hash": "8ae58a388e66eb07e52378d530705f1f2c7f5bfcec085c17480cbde4170ef689",
- "summary_state": "ready",
- "summary": "Converts a node into a standardized JSON format, facilitating consistent output for symbol information.",
- "crux": {
- "code": "function symbolJson(n: NodeV1): SymbolJson {\n return { id: n.id, name: n.name, kind: n.kind, path: n.path, span: n.span };\n}",
- "span": "L84-L86"
- }
- },
- {
- "id": "src/graph/traverse-cli.ts#SymbolJson",
- "name": "SymbolJson",
- "kind": "interface",
- "path": "src/graph/traverse-cli.ts",
- "span": "L74-L80",
- "signature": "interface SymbolJson",
- "exported": false,
- "origin": "ast",
- "body_hash": "576f5963f808dc7657213b6d61ed08efff33b0e48aef2b768986e1e9dff85c00",
- "summary_state": "ready",
- "summary": "Defines the structure for symbol metadata in JSON format, ensuring consistent representation of symbols in output.",
- "crux": null
- },
- {
- "id": "src/graph/traverse.ts",
- "name": "traverse.ts",
- "kind": "file",
- "path": "src/graph/traverse.ts",
- "span": "L1-L223",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "cf349716f93ae52c79c61935dea060babe111216563d7c308c8375a8aaed698e",
- "chars": 9750,
- "summary_state": "stale",
- "summary": "Centralizes the logic for resolving symbol queries in a graph, enabling consistent identification of nodes based on various naming conventions and paths.",
- "crux": {
- "code": " */\nexport function resolveSymbol(graph: GraphV1, query: string, opts: ResolveSymbolOptions = {}): NodeV1[] {\n const lowerQuery = query.toLowerCase();\n const looksLikeFilename = query.includes(\".\") && !query.includes(\"#\");\n\n let matches = symbolMatches(graph.nodes, lowerQuery);\n\n if (matches.length === 0 && query.includes(\".\")) {\n const lastSegment = query.slice(query.lastIndexOf(\".\") + 1).toLowerCase();\n if (lastSegment) {\n matches = graph.nodes.filter((n) => n.kind !== \"file\" && n.name.toLowerCase() === lastSegment);\n }",
- "span": "L46-L57"
- }
- },
- {
- "id": "src/graph/traverse.ts#calleesOf",
- "name": "calleesOf",
- "kind": "function",
- "path": "src/graph/traverse.ts",
- "span": "L113-L121",
- "signature": "function calleesOf(graph: GraphV1, symbol: NodeV1): EdgeHit[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "001e16cf23b57798f48070d4e11375c2810748138337667eb68dea5926d076c2",
- "summary_state": "ready",
- "summary": "Identifies all edges originating from a specified symbol, showing which nodes it directly calls.",
- "crux": {
- "code": "export function calleesOf(graph: GraphV1, symbol: NodeV1): EdgeHit[] {\n const byId = new Map(graph.nodes.map((n) => [n.id, n]));\n const hits: EdgeHit[] = [];\n for (const e of graph.edges as EdgeV1[]) {\n if (!WALK_RELATIONS.has(e.relation) || e.source !== symbol.id) continue;\n hits.push({ node: byId.get(e.target) ?? null, id: e.target, relation: e.relation, depth: 1 });\n }",
- "span": "L107-L113"
- }
- },
- {
- "id": "src/graph/traverse.ts#callersOf",
- "name": "callersOf",
- "kind": "function",
- "path": "src/graph/traverse.ts",
- "span": "L102-L110",
- "signature": "function callersOf(graph: GraphV1, symbol: NodeV1): EdgeHit[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "777f6d8e8beaf3605809ad8a9622b1b232531ac27b729fb1f210ea28f24729f9",
- "summary_state": "ready",
- "summary": "Finds all edges leading to a specified symbol, indicating which nodes directly call it.",
- "crux": {
- "code": "export function callersOf(graph: GraphV1, symbol: NodeV1): EdgeHit[] {\n const byId = new Map(graph.nodes.map((n) => [n.id, n]));\n const hits: EdgeHit[] = [];\n for (const e of graph.edges as EdgeV1[]) {\n if (!WALK_RELATIONS.has(e.relation) || e.target !== symbol.id) continue;\n hits.push({ node: byId.get(e.source) ?? null, id: e.source, relation: e.relation, depth: 1 });\n }\n return hits;",
- "span": "L96-L103"
- }
- },
- {
- "id": "src/graph/traverse.ts#Direction",
- "name": "Direction",
- "kind": "type",
- "path": "src/graph/traverse.ts",
- "span": "L21-L21",
- "signature": "type Direction = \"in\" | \"out\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "48667bce4f305c7050d7914dd04e31e7db5fd8cbf7e79d19e426f7a8db04c886",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/traverse.ts#EdgeHit",
- "name": "EdgeHit",
- "kind": "interface",
- "path": "src/graph/traverse.ts",
- "span": "L94-L99",
- "signature": "interface EdgeHit",
- "exported": true,
- "origin": "ast",
- "body_hash": "73c31bb7b1eb001536307926e08135697bac347ffb2d3444d5e8d6b0aac7d538",
- "summary_state": "ready",
- "summary": "Represents a traversed edge in the graph, capturing the relationship and depth of the connection to a node.",
- "crux": {
- "code": "export interface EdgeHit {\n node: NodeV1 | null;\n id: string;\n relation: Relation;\n depth: number;\n}",
- "span": "L88-L93"
- }
- },
- {
- "id": "src/graph/traverse.ts#edgeWalk",
- "name": "edgeWalk",
- "kind": "function",
- "path": "src/graph/traverse.ts",
- "span": "L218-L222",
- "signature": "function edgeWalk(graph: GraphV1, node: NodeV1, direction: Direction, depth: number): EdgeHit[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "28792965a036b184ee16e13d0f5dcd144afd62f7e4cb35d7004e86cf58a475b4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/traverse.ts#impactOf",
- "name": "impactOf",
- "kind": "function",
- "path": "src/graph/traverse.ts",
- "span": "L129-L131",
- "signature": "function impactOf(graph: GraphV1, symbol: NodeV1, maxDepth = 2): EdgeHit[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "45561c34c5e0037acb3147d064ca3097df2bfd0da1bf34603b30ae61f00ac590",
- "summary_state": "ready",
- "summary": "Performs a breadth-first search to determine the impact of changes to a symbol, identifying affected nodes up to a specified depth.",
- "crux": {
- "code": "export function impactOf(graph: GraphV1, symbol: NodeV1, maxDepth = 2): EdgeHit[] {\n return impactOfMany(graph, [symbol], maxDepth);\n}",
- "span": "L123-L125"
- }
- },
- {
- "id": "src/graph/traverse.ts#impactOfFile",
- "name": "impactOfFile",
- "kind": "function",
- "path": "src/graph/traverse.ts",
- "span": "L201-L203",
- "signature": "function impactOfFile(graph: GraphV1, fileNode: NodeV1, maxDepth = 2, direction: Direction = \"in\"): EdgeHit[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "eafa282969956ae0ecae5ba75238424a8b3e7c91e3d45ce6cf1b8f1c43380829",
- "summary_state": "stale",
- "summary": "Aggregates the impact analysis for a file node and its defined symbols, ensuring all dependents are considered.",
- "crux": {
- "code": "export function impactOfFile(graph: GraphV1, fileNode: NodeV1, maxDepth = 2): EdgeHit[] {\n return impactOfMany(graph, [fileNode, ...symbolsInFile(graph, fileNode)], maxDepth);\n}",
- "span": "L189-L191"
- }
- },
- {
- "id": "src/graph/traverse.ts#impactOfMany",
- "name": "impactOfMany",
- "kind": "function",
- "path": "src/graph/traverse.ts",
- "span": "L149-L184",
- "signature": "function impactOfMany(graph: GraphV1, seeds: NodeV1[], maxDepth = 2, direction: Direction = \"in\"): EdgeHit[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "ed0429a5e6283a3a65470de4599a5b11ee48fbc54e8a63c3e8bef942d5e75c40",
- "summary_state": "stale",
- "summary": "Generalizes the impact analysis to multiple seed nodes, aggregating the results of their incoming edges.",
- "crux": {
- "code": "export function impactOfMany(graph: GraphV1, seeds: NodeV1[], maxDepth = 2): EdgeHit[] {\n const byId = new Map(graph.nodes.map((n) => [n.id, n]));\n\n // target id → incoming {source, relation} pairs, restricted to walk relations.\n const incoming = new Map<string, { source: string; relation: Relation }[]>();\n for (const e of graph.edges as EdgeV1[]) {\n if (!WALK_RELATIONS.has(e.relation)) continue;\n const arr = incoming.get(e.target);\n const entry = { source: e.source, relation: e.relation };\n if (arr) arr.push(entry);\n else incoming.set(e.target, [entry]);\n }",
- "span": "L141-L152"
- }
- },
- {
- "id": "src/graph/traverse.ts#resolveSymbol",
- "name": "resolveSymbol",
- "kind": "function",
- "path": "src/graph/traverse.ts",
- "span": "L53-L78",
- "signature": "function resolveSymbol(graph: GraphV1, query: string, opts: ResolveSymbolOptions = {}): NodeV1[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "16417bb8ff31274a793c3224197aa5fde4299a18bc9b7bb26f950cb326a86978",
- "summary_state": "ready",
- "summary": "Resolves a query string to all matching nodes in the graph, handling various naming conventions and fallbacks.",
- "crux": {
- "code": "export function resolveSymbol(graph: GraphV1, query: string, opts: ResolveSymbolOptions = {}): NodeV1[] {\n const lowerQuery = query.toLowerCase();\n const looksLikeFilename = query.includes(\".\") && !query.includes(\"#\");\n\n let matches = symbolMatches(graph.nodes, lowerQuery);\n\n if (matches.length === 0 && query.includes(\".\")) {\n const lastSegment = query.slice(query.lastIndexOf(\".\") + 1).toLowerCase();\n if (lastSegment) {\n matches = graph.nodes.filter((n) => n.kind !== \"file\" && n.name.toLowerCase() === lastSegment);\n }\n }",
- "span": "L47-L58"
- }
- },
- {
- "id": "src/graph/traverse.ts#ResolveSymbolOptions",
- "name": "ResolveSymbolOptions",
- "kind": "interface",
- "path": "src/graph/traverse.ts",
- "span": "L29-L32",
- "signature": "interface ResolveSymbolOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "96b7318d8119016aed9f8227251f25db2278e7a943d3b1eb2fe9a0c934f09004",
- "summary_state": "ready",
- "summary": "Defines options for narrowing down symbol resolution candidates based on path substring filtering.",
- "crux": {
- "code": "export interface ResolveSymbolOptions {\n /** Narrow candidates to nodes whose `path` contains this substring. */\n in?: string;\n}",
- "span": "L23-L26"
- }
- },
- {
- "id": "src/graph/traverse.ts#SymbolMatch",
- "name": "SymbolMatch",
- "kind": "interface",
- "path": "src/graph/traverse.ts",
- "span": "L25-L27",
- "signature": "interface SymbolMatch",
- "exported": true,
- "origin": "ast",
- "body_hash": "e5aecaaa624e92197121baf03e995fd17c765a9d5aa9ebf5d0b5720ad07cc57f",
- "summary_state": "ready",
- "summary": "Represents a resolved match for a symbol search in the graph, allowing for future disambiguation of metadata.",
- "crux": {
- "code": "export interface SymbolMatch {\n node: NodeV1;\n}",
- "span": "L19-L21"
- }
- },
- {
- "id": "src/graph/traverse.ts#symbolMatches",
- "name": "symbolMatches",
- "kind": "function",
- "path": "src/graph/traverse.ts",
- "span": "L80-L89",
- "signature": "function symbolMatches(nodes: NodeV1[], lowerQuery: string): NodeV1[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "d579fefa0302961e7b0bc5935016c6ab9f9f39da13d4f05667820ec0e33955d0",
- "summary_state": "ready",
- "summary": "Filters nodes in the graph to find matches based on a case-insensitive query, considering both name and id suffixes.",
- "crux": {
- "code": "function symbolMatches(nodes: NodeV1[], lowerQuery: string): NodeV1[] {\n const suffixHash = \"#\" + lowerQuery;\n const suffixDot = \".\" + lowerQuery;\n return nodes.filter((n) => {\n if (n.kind === \"file\") return false;\n if (n.name.toLowerCase() === lowerQuery) return true;\n const lowerId = n.id.toLowerCase();\n return lowerId.endsWith(suffixHash) || lowerId.endsWith(suffixDot);\n });",
- "span": "L74-L82"
- }
- },
- {
- "id": "src/graph/traverse.ts#symbolsInFile",
- "name": "symbolsInFile",
- "kind": "function",
- "path": "src/graph/traverse.ts",
- "span": "L188-L190",
- "signature": "function symbolsInFile(graph: GraphV1, fileNode: NodeV1): NodeV1[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "ff4bea79b1a8c5565a8d6de8abcaa08f594400577551fe1fa3c7ed2b73142249",
- "summary_state": "ready",
- "summary": "Retrieves all symbols defined in a specific file, filtering out file nodes.",
- "crux": {
- "code": "function symbolsInFile(graph: GraphV1, fileNode: NodeV1): NodeV1[] {\n return graph.nodes.filter((n) => n.kind !== \"file\" && n.path === fileNode.path);\n}",
- "span": "L176-L178"
- }
- },
- {
- "id": "src/graph/types.ts",
- "name": "types.ts",
- "kind": "file",
- "path": "src/graph/types.ts",
- "span": "L1-L103",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "745855a49536d9dac6a755a03cde0edff96f2acb089d14c8e4c9f2b415fc1d2e",
- "chars": 3789,
- "summary_state": "stale",
- "summary": "Defines the structure and relationships of a code graph schema, facilitating the representation of code elements and their interactions.",
- "crux": {
- "code": "/**\n * `graph.json` — the code graph schema (v1).\n *\n * One node per definition (file, class, function, method, interface, type, enum),\n * wired by edges (contains, imports, calls, ...). Field names follow the LSP /\n * SCIP vocabulary (`name`, `kind`, ...) rather than any one tool's conventions.\n *\n * Two tiers of data live on a node:\n * - Tier-1 (deterministic, $0): everything from the AST. Rebuilt on every run.\n * - Tier-2 (one LLM call, cached on `body_hash`): `summary` + `crux`.\n * M1 populates Tier-1 only; Tier-2 fields ship as `pending`/null.\n */",
- "span": "L1-L12"
- }
- },
- {
- "id": "src/graph/types.ts#Confidence",
- "name": "Confidence",
- "kind": "type",
- "path": "src/graph/types.ts",
- "span": "L26-L26",
- "signature": "type Confidence = \"extracted\" | \"inferred\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "305d107dc8cea0d8fcf2e42c13eef23345a53cd6a24672d8a017d5c8d393d46c",
- "summary_state": "ready",
- "summary": "Specifies the confidence levels for the truth of edges in the graph, aiding in the assessment of relationships.",
- "crux": {
- "code": "export type Confidence = \"extracted\" | \"inferred\";",
- "span": "L25-L25"
- }
- },
- {
- "id": "src/graph/types.ts#Crux",
- "name": "Crux",
- "kind": "interface",
- "path": "src/graph/types.ts",
- "span": "L33-L36",
- "signature": "interface Crux",
- "exported": true,
- "origin": "ast",
- "body_hash": "157f97611f592b25b78af3bd626d10c866b4aa23344a96823de466eb1ecbe28d",
- "summary_state": "ready",
- "summary": "Holds the LLM-chosen business-logic excerpt for a node, providing a source of truth for code interpretation.",
- "crux": {
- "code": "export interface Crux {\n code: string;\n span: string; // e.g. \"L189-L196\"\n}",
- "span": "L32-L35"
- }
- },
- {
- "id": "src/graph/types.ts#EdgeV1",
- "name": "EdgeV1",
- "kind": "interface",
- "path": "src/graph/types.ts",
- "span": "L73-L78",
- "signature": "interface EdgeV1",
- "exported": true,
- "origin": "ast",
- "body_hash": "ab2ffb1ba27a286985e517d71d7866d2d389e585d1584647a90fb520b4d92628",
- "summary_state": "ready",
- "summary": "Describes the edges connecting nodes in the graph, detailing the source, target, and relationship type.",
- "crux": {
- "code": "export interface EdgeV1 {\n source: string; // node id\n target: string; // node id, or an unresolved module string for imports\n relation: Relation;\n confidence: Confidence;\n}",
- "span": "L65-L70"
- }
- },
- {
- "id": "src/graph/types.ts#GraphV1",
- "name": "GraphV1",
- "kind": "interface",
- "path": "src/graph/types.ts",
- "span": "L90-L102",
- "signature": "interface GraphV1",
- "exported": true,
- "origin": "ast",
- "body_hash": "369c9f71b71b2f6f38cfd27efd98311d1231bec2990215a97e776d9f84281f27",
- "summary_state": "stale",
- "summary": "Encapsulates the entire graph structure, including metadata and collections of nodes and edges.",
- "crux": {
- "code": "export interface GraphV1 {\n meta: {\n version: 1;\n nodeCount: number;\n edgeCount: number;\n languages: string[];\n };\n nodes: NodeV1[];\n edges: EdgeV1[];\n}",
- "span": "L72-L81"
- }
- },
- {
- "id": "src/graph/types.ts#Kind",
- "name": "Kind",
- "kind": "type",
- "path": "src/graph/types.ts",
- "span": "L15-L23",
- "signature": "type Kind = | \"file\" | \"class\" | \"function\" | \"method\" | \"interface\" // TS + Go | \"type\" // TS + Go (type alias / named type) | \"enum\" // TS only | \"struct\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "cbc16d65aefa07ebb6e28cd90ff587681249a4762ab8d10fcb56788adc902a97",
- "summary_state": "ready",
- "summary": "Enumerates the various types of nodes in the code graph, ensuring consistent categorization of code elements across different languages.",
- "crux": {
- "code": "export type Kind =\n | \"file\"\n | \"class\"\n | \"function\"\n | \"method\"\n | \"interface\" // TS + Go\n | \"type\" // TS + Go (type alias / named type)\n | \"enum\" // TS only\n | \"struct\"; // Go only",
- "span": "L15-L23"
- }
- },
- {
- "id": "src/graph/types.ts#NodeV1",
- "name": "NodeV1",
- "kind": "interface",
- "path": "src/graph/types.ts",
- "span": "L38-L63",
- "signature": "interface NodeV1",
- "exported": true,
- "origin": "ast",
- "body_hash": "6b0321068a3be9495509962011da101ea4730e74376e2568a237d4d6d736f1fc",
- "summary_state": "ready",
- "summary": "Describes the properties of a node in the code graph, encapsulating its identity, location, and meaning for effective graph representation.",
- "crux": {
- "code": "export interface NodeV1 {\n // identity\n id: string; // path-scoped: \"src/cache.ts#Cache.get\"\n name: string; // the symbol's own name: \"get\"\n kind: Kind;\n\n // location (Tier-1, deterministic)\n path: string; // repo-relative: \"src/cache.ts\"\n span: string; // whole definition: \"L165-L222\"\n signature: string | null; // \"get(k: string): number\" — null for kind:\"file\"\n exported: boolean;\n origin: \"ast\";",
- "span": "L38-L49"
- }
- },
- {
- "id": "src/graph/types.ts#Relation",
- "name": "Relation",
- "kind": "type",
- "path": "src/graph/types.ts",
- "span": "L65-L71",
- "signature": "type Relation = | \"contains\" // file → symbol, class → method (structural) | \"calls\" // function → function it invokes | \"imports\" // file → module | \"references\" // symbol → symbol it names but doesn't call | \"implements\" // TS: class → interface | \"extends\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "226fd93c673f4bfa583e44e3be8c2ca8e0957bf1b95771f067e4999b1e89d145",
- "summary_state": "ready",
- "summary": "Defines the types of relationships between nodes in the graph, clarifying how symbols interact.",
- "crux": {
- "code": "export type Relation =\n | \"contains\" // file → symbol, class → method (structural)\n | \"calls\" // function → function it invokes\n | \"imports\" // file → module\n | \"references\" // symbol → symbol it names but doesn't call\n | \"implements\" // TS: class → interface\n | \"extends\"; // class → base class",
- "span": "L57-L63"
- }
- },
- {
- "id": "src/graph/types.ts#ScopeV1",
- "name": "ScopeV1",
- "kind": "interface",
- "path": "src/graph/types.ts",
- "span": "L84-L88",
- "signature": "interface ScopeV1",
- "exported": true,
- "origin": "ast",
- "body_hash": "e9815468264f0035da829ebd87cd5b705e7bbdcccaba90ba7d9be8e0c14dc7e4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/types.ts#SummaryState",
- "name": "SummaryState",
- "kind": "type",
- "path": "src/graph/types.ts",
- "span": "L29-L29",
- "signature": "type SummaryState = \"pending\" | \"ready\" | \"stale\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "0689b3a76aa3ee3553bec1bccff2817cac613e747d317688f296748e8c929e0e",
- "summary_state": "ready",
- "summary": "Indicates whether the meaning-layer has been computed for a node, managing the state of node summaries.",
- "crux": {
- "code": "export type SummaryState = \"pending\" | \"ready\" | \"stale\";",
- "span": "L28-L28"
- }
- },
- {
- "id": "src/graph/workspace-cli.ts",
- "name": "workspace-cli.ts",
- "kind": "file",
- "path": "src/graph/workspace-cli.ts",
- "span": "L1-L116",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "b114890c823d767b08af64b76534441b9498d9bf3c9a61c3b004475f8734982b",
- "chars": 4170,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace-cli.ts#runWorkspaceAsk",
- "name": "runWorkspaceAsk",
- "kind": "function",
- "path": "src/graph/workspace-cli.ts",
- "span": "L59-L68",
- "signature": "function runWorkspaceAsk( root: string, override: string | undefined, query: string, opts: { limit?: number; source?: boolean; full?: boolean; in?: string; json?: boolean }, ): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "592fa7cdceb730c2985a4e09ab41a7e226209aa33f3b436c38eae257efb9e2c9",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace-cli.ts#runWorkspaceBuild",
- "name": "runWorkspaceBuild",
- "kind": "function",
- "path": "src/graph/workspace-cli.ts",
- "span": "L37-L57",
- "signature": "async function runWorkspaceBuild(root: string, opts: WorkspaceBuildOptions): Promise<void>",
- "exported": true,
- "origin": "ast",
- "body_hash": "5678bc06f3b0eafddfcb6ccf50d3e1938ed0e6d0c5e537fe927571343736e25f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace-cli.ts#runWorkspaceBuild.buildChild",
- "name": "buildChild",
- "kind": "function",
- "path": "src/graph/workspace-cli.ts",
- "span": "L38-L44",
- "signature": "buildChild = async (childDir: string, childName: string): Promise<void>",
- "exported": true,
- "origin": "ast",
- "body_hash": "95429a624b74f8415b633c802f1e642815319c2c35718ff05fc445cab112be1e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace-cli.ts#runWorkspaceCallers",
- "name": "runWorkspaceCallers",
- "kind": "function",
- "path": "src/graph/workspace-cli.ts",
- "span": "L103-L115",
- "signature": "function runWorkspaceCallers( root: string, override: string | undefined, symbol: string, opts: { direction?: Direction; depth?: number; in?: string }, ): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "051bf3398a6a6c073d29e09d7bbef96786dcc846f2b0290ff9bf8f00ad708917",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace-cli.ts#runWorkspaceCheck",
- "name": "runWorkspaceCheck",
- "kind": "function",
- "path": "src/graph/workspace-cli.ts",
- "span": "L97-L101",
- "signature": "function runWorkspaceCheck(root: string, override?: string): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "a18a698fe304fcf9aecc781de87d83450721c22d16f6f7f44e53c45a1dfcf1aa",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace-cli.ts#runWorkspaceGrep",
- "name": "runWorkspaceGrep",
- "kind": "function",
- "path": "src/graph/workspace-cli.ts",
- "span": "L70-L87",
- "signature": "function runWorkspaceGrep( root: string, override: string | undefined, pattern: string, opts: { ignoreCase?: boolean; fixed?: boolean; json?: boolean }, ): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "bd14b5d2169943e0f2d2f019f153010fb6609d1049d4f80ef790658ae3ca1612",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace-cli.ts#runWorkspaceMap",
- "name": "runWorkspaceMap",
- "kind": "function",
- "path": "src/graph/workspace-cli.ts",
- "span": "L89-L95",
- "signature": "function runWorkspaceMap( root: string, override: string | undefined, opts: { maxDirs?: number }, ): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "e25e10b17a54f652f6e995b485677a1298e990074055d6fa8697d81fc037d343",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace-cli.ts#WorkspaceBuildOptions",
- "name": "WorkspaceBuildOptions",
- "kind": "interface",
- "path": "src/graph/workspace-cli.ts",
- "span": "L24-L32",
- "signature": "interface WorkspaceBuildOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "9d07849eb635ed6bdc370c2a701b966fd2b71b5a5e37076b134623fc9c74a062",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts",
- "name": "workspace.ts",
- "kind": "file",
- "path": "src/graph/workspace.ts",
- "span": "L1-L473",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "d15077d0e2844137b447a6e2771fac249351c259d8aad393a281ccb302fb8054",
- "chars": 20560,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#ChildRun",
- "name": "ChildRun",
- "kind": "interface",
- "path": "src/graph/workspace.ts",
- "span": "L177-L186",
- "signature": "interface ChildRun",
- "exported": false,
- "origin": "ast",
- "body_hash": "49aaad3d8807fe07a7f88d8b4cb9fc8bda0e6437284dd682cfaddfe65aab419a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#clearParentGraft",
- "name": "clearParentGraft",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L111-L113",
- "signature": "function clearParentGraft(root: string, override?: string): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "bb27946f81b69d8ea8f3c163aaca0b15d3c7dd20138d16c4b6903575e2fe6992",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#coverageNote",
- "name": "coverageNote",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L148-L152",
- "signature": "function coverageNote(g: WorkspaceGraphs): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "52f80ec25210adc44938aef49b5e1dc008dfce002ae9b3d5b18b78b612716880",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#federateAsk",
- "name": "federateAsk",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L207-L306",
- "signature": "function federateAsk( root: string, override: string | undefined, query: string, opts: FederateAskOptions = {}, ): AskResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "99457ed331a29ea9e4568b61ca67e83de53072c7f7217212c7acf5daf369b454",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#FederateAskOptions",
- "name": "FederateAskOptions",
- "kind": "interface",
- "path": "src/graph/workspace.ts",
- "span": "L167-L175",
- "signature": "interface FederateAskOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "6d1ccfe40dfe46d2e2fc4c7d0485c8c872c8008d276311c8297d9304d9f48628",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#federateCallers",
- "name": "federateCallers",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L407-L443",
- "signature": "function federateCallers( root: string, override: string | undefined, symbol: string, opts: { direction?: Direction; depth?: number; in?: string } = {}, ): { text: string; found: boolean }",
- "exported": true,
- "origin": "ast",
- "body_hash": "6e93e06ac3efd73a1bb538066e826234d20d15cbb237949b613cd8ed559936a0",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#federateCheck",
- "name": "federateCheck",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L378-L403",
- "signature": "function federateCheck( root: string, override?: string, ): { text: string; ok: boolean }",
- "exported": true,
- "origin": "ast",
- "body_hash": "d3366015f7761bbcf8a7ae05b32b775e1b950fc7065978dcb4b81c35081b89be",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#federateGrep",
- "name": "federateGrep",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L311-L351",
- "signature": "function federateGrep( root: string, override: string | undefined, pattern: string, opts: { ignoreCase?: boolean; fixed?: boolean } = {}, ): { result: GrepResult; coverage: string }",
- "exported": true,
- "origin": "ast",
- "body_hash": "ba60a8d390debaab2a2f154a6a8548121ed68e676ba8777feefe35419997cd8b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#federateMap",
- "name": "federateMap",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L355-L374",
- "signature": "function federateMap( root: string, override: string | undefined, opts: { maxDirs?: number } = {}, ): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "e047e94f1604db5cec20ef415f95ec04a5a8c44482264d78e24f62420a227bd5",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#hasMegaGraph",
- "name": "hasMegaGraph",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L92-L94",
- "signature": "function hasMegaGraph(root: string, override?: string): boolean",
- "exported": true,
- "origin": "ast",
- "body_hash": "c50ff73e08252dcd9dad4aff8edb4fb9c6dfcded76332f8fb28e0ec1cdebebb1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#isWorkspaceBuildRoot",
- "name": "isWorkspaceBuildRoot",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L84-L88",
- "signature": "function isWorkspaceBuildRoot(root: string, override?: string): boolean",
- "exported": true,
- "origin": "ast",
- "body_hash": "6b938713206ba439e30a10400533a9c242fb1447044cd3ecadef05b4dc3b2509",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#LoadedChild",
- "name": "LoadedChild",
- "kind": "interface",
- "path": "src/graph/workspace.ts",
- "span": "L115-L118",
- "signature": "interface LoadedChild",
- "exported": true,
- "origin": "ast",
- "body_hash": "57af051725a42c92f83b5688788c8cdb8e54be71ef9e17c198c9e1f2ae7fa66b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "name": "loadWorkspaceGraphs",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L132-L143",
- "signature": "function loadWorkspaceGraphs(root: string, override?: string): WorkspaceGraphs",
- "exported": true,
- "origin": "ast",
- "body_hash": "ab814e286ef7eff17061679139c02d01e026fd1939b205196ab9f68521ec5dac",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#migrationNote",
- "name": "migrationNote",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L98-L105",
- "signature": "function migrationNote(children: string[]): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "c38151c635b45ddbbc4d7ffc9e6ff9d456cebdf6cb256fb44b293b724469ccd5",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#prefixPointer",
- "name": "prefixPointer",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L156-L165",
- "signature": "function prefixPointer(child: string, pointer: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c24b3d3709332b3eff6ef53d7beaba32d2b326da963acea0f6f776571c08db6f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#readWorkspace",
- "name": "readWorkspace",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L59-L68",
- "signature": "function readWorkspace(root: string, override?: string): WorkspaceV1 | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "78512a46e95680674c28f70a745bfef8d99104f4c857fbac30c5792d1e2eb54c",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#splitWorkspace",
- "name": "splitWorkspace",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L457-L470",
- "signature": "async function splitWorkspace( root: string, override: string | undefined, buildChild: (childDir: string, childName: string) => Promise<void>, onStart?: (info: { children: string[]; migrated: boolean }) => void, ): Promise<{ children: string[]; migrated: boolean }>",
- "exported": true,
- "origin": "ast",
- "body_hash": "007290df69b1efa3b7253cb55990676e696fdfc3b1cee88dc69a189755651a65",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#WorkspaceGraphs",
- "name": "WorkspaceGraphs",
- "kind": "interface",
- "path": "src/graph/workspace.ts",
- "span": "L120-L126",
- "signature": "interface WorkspaceGraphs",
- "exported": true,
- "origin": "ast",
- "body_hash": "db2280242057b9a48c2d83510b2ccd0a55c065e4e3b5f6f493d5c1487654fe96",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#workspacePath",
- "name": "workspacePath",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L53-L55",
- "signature": "function workspacePath(root: string, override?: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "c09f27e2379ad5fd35bd5f8566c4c1cbc05db431daa9fab6327515ffc2dca4b1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#WorkspaceV1",
- "name": "WorkspaceV1",
- "kind": "interface",
- "path": "src/graph/workspace.ts",
- "span": "L44-L48",
- "signature": "interface WorkspaceV1",
- "exported": true,
- "origin": "ast",
- "body_hash": "89ff7a6fb5777575c9b525a0ca000b2835ed428e98e8ff02c0a5ff520c4c9cce",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/workspace.ts#writeWorkspace",
- "name": "writeWorkspace",
- "kind": "function",
- "path": "src/graph/workspace.ts",
- "span": "L71-L78",
- "signature": "function writeWorkspace(root: string, ws: WorkspaceV1, override?: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "d9ddfb271875484ab5a85c86d62d8ad8867ef77eb45b5104fae9e1df2e7555e3",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/graph/write.ts",
- "name": "write.ts",
- "kind": "file",
- "path": "src/graph/write.ts",
- "span": "L1-L70",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a8f0d1b3efed9ca1ac3c22175c46c7a737b91bf632930ebb4437ebf52326ed69",
- "chars": 2665,
- "summary_state": "ready",
- "summary": "This file manages the serialization and deserialization of a wiring graph, ensuring efficient storage and retrieval of graph data for further processing.",
- "crux": {
- "code": "export function writeGraph(graph: GraphV1, outDir: string): string {\n const sorted: GraphV1 = {\n ...graph,\n nodes: [...graph.nodes].sort((a, b) => a.id.localeCompare(b.id)).map(stripBodyText),\n edges: [...graph.edges].sort(edgeOrder),\n };\n const path = wiringPath(outDir);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, JSON.stringify(sorted, null, 2) + \"\\n\");\n return path;\n}",
- "span": "L36-L46"
- }
- },
- {
- "id": "src/graph/write.ts#edgeOrder",
- "name": "edgeOrder",
- "kind": "function",
- "path": "src/graph/write.ts",
- "span": "L63-L69",
- "signature": "function edgeOrder(a: EdgeV1, b: EdgeV1): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "1c2665c44f094c37f510a0ca5befc63bf67ae59c52d77dfdcbe15611d2e5abbe",
- "summary_state": "ready",
- "summary": "Defines the sorting order for edges in the wiring graph based on source, relation, and target.",
- "crux": {
- "code": " a.source.localeCompare(b.source) ||\n a.relation.localeCompare(b.relation) ||\n a.target.localeCompare(b.target)",
- "span": "L50-L52"
- }
- },
- {
- "id": "src/graph/write.ts#readGraph",
- "name": "readGraph",
- "kind": "function",
- "path": "src/graph/write.ts",
- "span": "L28-L34",
- "signature": "function readGraph(path: string): GraphV1 | null",
- "exported": true,
- "origin": "ast",
- "body_hash": "a68ca7cd48652a99a350b76c387a19462cc984c42bbc9b00a30e629af5fda52e",
- "summary_state": "ready",
- "summary": "Reads and parses an existing wiring graph from a file, returning null if the file is absent or unparseable.",
- "crux": {
- "code": " return JSON.parse(readFileSync(path, \"utf8\")) as GraphV1;\n } catch {\n return null;",
- "span": "L30-L32"
- }
- },
- {
- "id": "src/graph/write.ts#stripBodyText",
- "name": "stripBodyText",
- "kind": "function",
- "path": "src/graph/write.ts",
- "span": "L57-L61",
- "signature": "function stripBodyText(node: NodeV1): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "066abd2d7e9f13c6df67c4ba9100acdba5518e271bbc326536475e8610ae24cf",
- "summary_state": "ready",
- "summary": "Removes the body_text property from a node to reduce the size of the serialized graph, avoiding duplication of data already stored elsewhere.",
- "crux": {
- "code": "function stripBodyText(node: NodeV1): NodeV1 {\n if (node.body_text === undefined) return node;\n const { body_text: _body_text, ...rest } = node;\n return rest as NodeV1;\n}",
- "span": "L57-L61"
- }
- },
- {
- "id": "src/graph/write.ts#wiringPath",
- "name": "wiringPath",
- "kind": "function",
- "path": "src/graph/write.ts",
- "span": "L20-L22",
- "signature": "function wiringPath(outDir: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "4a454f03e0aa7289fbc47e6493079ab7f8b353b6133b4362158857eda98bb544",
- "summary_state": "ready",
- "summary": "Generates the absolute path for the wiring graph file in a specified output directory.",
- "crux": {
- "code": " return join(outDir, GRAPH_DIR, GRAPH_FILE);",
- "span": "L21-L21"
- }
- },
- {
- "id": "src/graph/write.ts#writeGraph",
- "name": "writeGraph",
- "kind": "function",
- "path": "src/graph/write.ts",
- "span": "L36-L46",
- "signature": "function writeGraph(graph: GraphV1, outDir: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "13647ca6eab5d041c45b3ef6efb6b851a3991c63742c94c88f4d05ecfc944354",
- "summary_state": "ready",
- "summary": "Writes a serialized and sorted representation of the graph to a JSON file, optimizing for size by stripping unnecessary data.",
- "crux": {
- "code": "export function writeGraph(graph: GraphV1, outDir: string): string {\n const sorted: GraphV1 = {\n ...graph,\n nodes: [...graph.nodes].sort((a, b) => a.id.localeCompare(b.id)).map(stripBodyText),\n edges: [...graph.edges].sort(edgeOrder),\n };\n const path = wiringPath(outDir);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, JSON.stringify(sorted, null, 2) + \"\\n\");\n return path;\n}",
- "span": "L36-L46"
- }
- },
- {
- "id": "src/hosts/codex-hooks.ts",
- "name": "codex-hooks.ts",
- "kind": "file",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L1-L75",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "0b9ba9ba677876d1adf4ce8d05aa534cddfbdeb7060ed11a92111a41a76d1512",
- "chars": 3168,
- "summary_state": "ready",
- "summary": "Facilitates the installation and management of user-level hooks for CLI agents, ensuring that hooks are correctly written and updated in the hooks.json configuration file after file edits.",
- "crux": {
- "code": "export function installCodexHooks(home: string): HookWrite[] {\n const base = join(home, '.codex');\n if (!dirExists(base)) return [];\n\n const shimPath = join(base, 'hooks', 'graft', 'graft-hooks.cjs');\n const shimWrite = writeOwned('codex-hook-shim', shimPath, hooksShim(claudeDistDir()), 0o755);\n\n const cfgPath = join(base, 'hooks.json');\n let root: Record<string, any> = {};\n const existed = existsSync(cfgPath);\n if (existed) {\n try { root = JSON.parse(readFileSync(cfgPath, 'utf8')); } catch {",
- "span": "L37-L48"
- }
- },
- {
- "id": "src/hosts/codex-hooks.ts#dirExists",
- "name": "dirExists",
- "kind": "function",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L17-L19",
- "signature": "function dirExists(p: string): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "3cb56ff33de328b88ab53b8b869149394e3f46919184cc3d9c7bebed9fb4dcc7",
- "summary_state": "ready",
- "summary": "Checks if a given directory path exists, returning a boolean value to indicate its existence.",
- "crux": {
- "code": " try { return statSync(p).isDirectory(); } catch { return false; }\n}",
- "span": "L18-L19"
- }
- },
- {
- "id": "src/hosts/codex-hooks.ts#HookWrite",
- "name": "HookWrite",
- "kind": "interface",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L11-L15",
- "signature": "interface HookWrite",
- "exported": true,
- "origin": "ast",
- "body_hash": "87f37fccd34dabd662b284ad06e364c60173827b1eef5170714b232943a22693",
- "summary_state": "ready",
- "summary": "Defines the structure for hook write operations, encapsulating the ID, path, and action taken during the write process.",
- "crux": null
- },
- {
- "id": "src/hosts/codex-hooks.ts#installCodexHooks",
- "name": "installCodexHooks",
- "kind": "function",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L37-L74",
- "signature": "function installCodexHooks(home: string): HookWrite[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "ed7ea45d024b73cc41550f0b5f3edcebc2555fbc1db0aba5437ded0b2c869d52",
- "summary_state": "ready",
- "summary": "Installs codex hooks by writing a shim and updating the hooks configuration based on the provided home directory.",
- "crux": {
- "code": " const shimPath = join(base, 'hooks', 'graft', 'graft-hooks.cjs');\n const shimWrite = writeOwned('codex-hook-shim', shimPath, hooksShim(claudeDistDir()), 0o755);\n\n const cfgPath = join(base, 'hooks.json');\n let root: Record<string, any> = {};\n const existed = existsSync(cfgPath);\n if (existed) {\n try { root = JSON.parse(readFileSync(cfgPath, 'utf8')); } catch {\n return [shimWrite, { id: 'codex-hooks', path: cfgPath, action: 'skipped-unparseable' }];\n }\n }\n if (typeof root !== 'object' || root === null || Array.isArray(root)) {",
- "span": "L41-L52"
- }
- },
- {
- "id": "src/hosts/codex-hooks.ts#isGraftEntry",
- "name": "isGraftEntry",
- "kind": "function",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L33-L35",
- "signature": "function isGraftEntry(entry: unknown): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "628b0f417080f2b63d9928d37116e818fc0d2c50c5d1319fdf1cb4ec7ef6e9f3",
- "summary_state": "ready",
- "summary": "Determines if a given entry is a graft entry by checking for a specific string in its JSON representation.",
- "crux": {
- "code": " return JSON.stringify(entry).includes('graft-hooks.cjs');\n}",
- "span": "L34-L35"
- }
- },
- {
- "id": "src/hosts/codex-hooks.ts#writeOwned",
- "name": "writeOwned",
- "kind": "function",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L21-L31",
- "signature": "function writeOwned(id: string, path: string, content: string, mode?: number): HookWrite",
- "exported": false,
- "origin": "ast",
- "body_hash": "0e2c5fcb677016e7114466756f114b05de75fd91cca3829607c528461e02edb1",
- "summary_state": "ready",
- "summary": "Handles the creation or updating of a file with specific content and permissions, returning the action taken.",
- "crux": {
- "code": " const existed = existsSync(path);\n if (existed && readFileSync(path, 'utf8') === content) {\n if (mode !== undefined && (statSync(path).mode & 0o777) !== mode) chmodSync(path, mode);\n return { id, path, action: 'unchanged' };\n }\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, content);\n if (mode !== undefined) chmodSync(path, mode);\n return { id, path, action: existed ? 'updated' : 'created' };",
- "span": "L22-L30"
- }
- },
- {
- "id": "src/hosts/init.ts",
- "name": "init.ts",
- "kind": "file",
- "path": "src/hosts/init.ts",
- "span": "L1-L73",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "cd3ef307f207a48b82fa81ea55e34fdc97b8663612ad639a3256336d5531afa0",
- "chars": 2627,
- "summary_state": "ready",
- "summary": "Initializes host configurations by writing instruction files based on selected hosts, ensuring that the correct files are created or updated as needed.",
- "crux": {
- "code": "export function runHostsInit(\n repo: string,\n opts: { agents?: string[]; all?: boolean; home?: string; mcp?: boolean; hooks?: boolean } = {},\n): HostsInitResult {\n const home = opts.home ?? homedir();\n const probe = probeFor(home, repo);\n\n let selected: HostTarget[];\n let unknown: string[] = [];\n if (opts.agents !== undefined) {\n const byId = new Map(HOSTS.map((h) => [h.id, h]));\n selected = opts.agents.flatMap((id) => byId.get(id) ?? []);",
- "span": "L37-L48"
- }
- },
- {
- "id": "src/hosts/init.ts#HostsInitResult",
- "name": "HostsInitResult",
- "kind": "interface",
- "path": "src/hosts/init.ts",
- "span": "L14-L20",
- "signature": "interface HostsInitResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "c643482048fe39520f2fc0aaee0c8761e9f13ed7f7bf5fcfc8ef404cd2f0e98f",
- "summary_state": "ready",
- "summary": "Defines the structure of the result returned by the host initialization process, capturing written, skipped, and unknown hosts along with MCP and hooks data.",
- "crux": null
- },
- {
- "id": "src/hosts/init.ts#probeFor",
- "name": "probeFor",
- "kind": "function",
- "path": "src/hosts/init.ts",
- "span": "L22-L27",
- "signature": "function probeFor(home: string, repo: string): DetectProbe",
- "exported": false,
- "origin": "ast",
- "body_hash": "7653739002fda057d1517f18bfe77dfb0dcf78ab6cb9716ceb7624601eec1f7f",
- "summary_state": "ready",
- "summary": "Creates a probe object to check for the existence of directories in a specified repository, facilitating host detection.",
- "crux": {
- "code": " home, repo,\n dirExists: (p) => { try { return statSync(p).isDirectory(); } catch { return false; } },\n };",
- "span": "L24-L26"
- }
- },
- {
- "id": "src/hosts/init.ts#runHostsInit",
- "name": "runHostsInit",
- "kind": "function",
- "path": "src/hosts/init.ts",
- "span": "L37-L72",
- "signature": "function runHostsInit( repo: string, opts: { agents?: string[]; all?: boolean; home?: string; mcp?: boolean; hooks?: boolean } = {}, ): HostsInitResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "8b9a15d05dcd9a43c414b8c27e34f565538950d578ed452568d9c61f08bb9dbd",
- "summary_state": "ready",
- "summary": "Initializes hosts by selecting them based on provided options and writing their instruction files, while also handling MCP configurations and hooks.",
- "crux": {
- "code": " const path = join(repo, host.relPath);\n const action =\n host.kind === 'owned'\n ? writeOwned(path, host.content())\n : upsertSection(path, host.content()).action;\n written.push({ id: host.id, path, action });\n }\n const skipped = HOSTS.filter((h) => !selected.includes(h)).map((h) => h.id);\n const mcp = opts.mcp === false ? [] : registerMcpConfigs(repo, selected.map((h) => h.id), { home });\n const hooks =\n opts.hooks === false || !selected.some((h) => h.id === 'agents')\n ? []",
- "span": "L58-L69"
- }
- },
- {
- "id": "src/hosts/init.ts#writeOwned",
- "name": "writeOwned",
- "kind": "function",
- "path": "src/hosts/init.ts",
- "span": "L29-L35",
- "signature": "function writeOwned(path: string, content: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "f25633ece4c0cfb7a956003dd26ad8e1b095e7955d13d796c24ac389d75a4f09",
- "summary_state": "ready",
- "summary": "Writes content to a specified path, creating or replacing the file as necessary, and returns the action taken.",
- "crux": {
- "code": " if (existsSync(path) && readFileSync(path, 'utf8') === content) return 'unchanged';\n mkdirSync(dirname(path), { recursive: true });\n const existed = existsSync(path);\n writeFileSync(path, content);\n return existed ? 'replaced' : 'created';",
- "span": "L30-L34"
- }
- },
- {
- "id": "src/hosts/instructions.ts",
- "name": "instructions.ts",
- "kind": "file",
- "path": "src/hosts/instructions.ts",
- "span": "L1-L69",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "b23c5baa1a99cc31c37f126df518c725d1d6c815020ec89cafe7b88b9842acb0",
- "chars": 2874,
- "summary_state": "stale",
- "summary": "This file provides Graft instructions for navigating and utilizing the context graph effectively.",
- "crux": null
- },
- {
- "id": "src/hosts/instructions.ts#cursorRule",
- "name": "cursorRule",
- "kind": "function",
- "path": "src/hosts/instructions.ts",
- "span": "L48-L55",
- "signature": "function cursorRule(): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "697397dc5e04836b10f9f9b6c4dfb5df6d95c5f89317ce9a77bb838a7e71e929",
- "summary_state": "ready",
- "summary": "Defines a rule to always apply the Graft context graph before exploring source code.",
- "crux": {
- "code": "export function cursorRule(): string {\n return `---\ndescription: Use the Graft context graph in graft/ before exploring source\nalwaysApply: true\n---\n${instructionBody()}",
- "span": "L44-L49"
- }
- },
- {
- "id": "src/hosts/instructions.ts#instructionBody",
- "name": "instructionBody",
- "kind": "function",
- "path": "src/hosts/instructions.ts",
- "span": "L6-L46",
- "signature": "function instructionBody(): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "1cdbe5890911cefd6a73c00da582ed94105b4da0facb3a45de53d5d5e79e2afd",
- "summary_state": "stale",
- "summary": "Generates the main instructional content for using the Graft context graph.",
- "crux": {
- "code": "export function instructionBody(): string {\n return `## Graft — repo context graph\n\nThis repo is indexed in \\`graft/\\`: small linked markdown nodes that explain each\nsystem and carry exact file:line spans, kept in sync with the code through git.\n\nFor ANY task here — understanding how something works, finding where code lives,\nor scoping a change — get context from the graph before grepping or opening\nsource files. Re-ask freely (it's cheap) and reuse literal identifiers you\nalready have (symbol, error string, file name) as the query. New to this repo?\nRun \\`graft map\\` first — a token-budgeted orientation (dir clusters, hubs,\nhotspots), no LLM, no key.",
- "span": "L6-L17"
- }
- },
- {
- "id": "src/hosts/instructions.ts#kiroSteering",
- "name": "kiroSteering",
- "kind": "function",
- "path": "src/hosts/instructions.ts",
- "span": "L57-L63",
- "signature": "function kiroSteering(): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "a3fea9a2ad9ee6488338f60825284e55bc5cd09cee354e9554efb2d90e2be20f",
- "summary_state": "ready",
- "summary": "Specifies a rule for always including the Graft context graph in the workflow.",
- "crux": {
- "code": "export function kiroSteering(): string {\n return `---\ninclusion: always\n---\n${instructionBody()}",
- "span": "L53-L57"
- }
- },
- {
- "id": "src/hosts/instructions.ts#windsurfRule",
- "name": "windsurfRule",
- "kind": "function",
- "path": "src/hosts/instructions.ts",
- "span": "L65-L68",
- "signature": "function windsurfRule(): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "a30d7b9ed58bdcfc402576d4a79e3643691145a92c521402e594243533cb4aed",
- "summary_state": "ready",
- "summary": "Provides a rule that incorporates the Graft context graph into its logic.",
- "crux": {
- "code": "export function windsurfRule(): string {\n return `${instructionBody()}",
- "span": "L61-L62"
- }
- },
- {
- "id": "src/hosts/mcp-config.ts",
- "name": "mcp-config.ts",
- "kind": "file",
- "path": "src/hosts/mcp-config.ts",
- "span": "L1-L88",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a449aa6fea8dc1b842e565d9c60fb61e46343effe69c1064a758c31d30cd5329",
- "chars": 3352,
- "summary_state": "stale",
- "summary": "Facilitates the registration and configuration of multiple MCP servers in specified host configurations, ensuring proper JSON and TOML formatting.",
- "crux": {
- "code": "export function registerMcpConfigs(\n repo: string,\n ids: string[],\n opts: { home?: string } = {},\n): McpWrite[] {\n const home = opts.home ?? homedir();\n const out: McpWrite[] = [];\n for (const id of ids) {\n switch (id) {\n case 'cursor':\n out.push(mergeJsonKey(id, join(repo, '.cursor', 'mcp.json'), 'mcpServers', SERVER_ENTRY));\n break;",
- "span": "L56-L67"
- }
- },
- {
- "id": "src/hosts/mcp-config.ts#dirExists",
- "name": "dirExists",
- "kind": "function",
- "path": "src/hosts/mcp-config.ts",
- "span": "L19-L21",
- "signature": "function dirExists(p: string): boolean",
- "exported": false,
- "origin": "ast",
- "body_hash": "3cb56ff33de328b88ab53b8b869149394e3f46919184cc3d9c7bebed9fb4dcc7",
- "summary_state": "ready",
- "summary": "Checks if a given directory path exists, returning a boolean value.",
- "crux": {
- "code": "function dirExists(p: string): boolean {\n try { return statSync(p).isDirectory(); } catch { return false; }\n}",
- "span": "L19-L21"
- }
- },
- {
- "id": "src/hosts/mcp-config.ts#McpWrite",
- "name": "McpWrite",
- "kind": "interface",
- "path": "src/hosts/mcp-config.ts",
- "span": "L10-L14",
- "signature": "interface McpWrite",
- "exported": true,
- "origin": "ast",
- "body_hash": "9c185f100ff537beef3b464e5c8969c84b257c9897a30596b210f5534c8173c7",
- "summary_state": "ready",
- "summary": "Defines the structure for writing MCP configuration results, indicating the operation performed on the configuration file.",
- "crux": {
- "code": "export interface McpWrite {\n id: string;\n path: string;\n action: 'created' | 'updated' | 'unchanged' | 'skipped-unparseable';\n}",
- "span": "L10-L14"
- }
- },
- {
- "id": "src/hosts/mcp-config.ts#mergeJsonKey",
- "name": "mergeJsonKey",
- "kind": "function",
- "path": "src/hosts/mcp-config.ts",
- "span": "L23-L43",
- "signature": "function mergeJsonKey(id: string, path: string, topKey: string, entry: object): McpWrite",
- "exported": true,
- "origin": "ast",
- "body_hash": "e399dc21ae5ece8ec15889555e73360fb028691ac71f96255de36ae942b6707d",
- "summary_state": "ready",
- "summary": "Merges a JSON entry into a specified key of a JSON file, creating or updating the file as necessary.",
- "crux": {
- "code": "function mergeJsonKey(id: string, path: string, topKey: string, entry: object): McpWrite {\n let root: Record<string, any> = {};\n const existed = existsSync(path);\n if (existed) {\n try {\n root = JSON.parse(readFileSync(path, 'utf8'));\n } catch {\n return { id, path, action: 'skipped-unparseable' };\n }\n }\n const bucket = (root[topKey] ??= {});\n if (typeof bucket !== 'object' || bucket === null || Array.isArray(bucket)) {",
- "span": "L23-L34"
- }
- },
- {
- "id": "src/hosts/mcp-config.ts#registerMcpConfigs",
- "name": "registerMcpConfigs",
- "kind": "function",
- "path": "src/hosts/mcp-config.ts",
- "span": "L56-L87",
- "signature": "function registerMcpConfigs( repo: string, ids: string[], opts: { home?: string } = {}, ): McpWrite[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "13f7e325e26de9e426d475d1ff63fe06af411ca36b4d3c0fca7b2c2eb11fb45f",
- "summary_state": "ready",
- "summary": "Registers MCP configurations for multiple IDs, handling different file types and structures based on the ID.",
- "crux": {
- "code": "export function registerMcpConfigs(\n repo: string,\n ids: string[],\n opts: { home?: string } = {},\n): McpWrite[] {\n const home = opts.home ?? homedir();\n const out: McpWrite[] = [];\n for (const id of ids) {\n switch (id) {\n case 'cursor':\n out.push(mergeJsonKey(id, join(repo, '.cursor', 'mcp.json'), 'mcpServers', SERVER_ENTRY));\n break;",
- "span": "L56-L67"
- }
- },
- {
- "id": "src/hosts/mcp-config.ts#upsertCodexToml",
- "name": "upsertCodexToml",
- "kind": "function",
- "path": "src/hosts/mcp-config.ts",
- "span": "L45-L54",
- "signature": "function upsertCodexToml(id: string, path: string): McpWrite",
- "exported": false,
- "origin": "ast",
- "body_hash": "2dd6f4be2733f7bbd211b3ba2c6a8ceda215a135a9606a33fb7b1654ab320f9a",
- "summary_state": "ready",
- "summary": "Inserts or updates a section in a TOML configuration file for the codex, ensuring the section exists.",
- "crux": {
- "code": "function upsertCodexToml(id: string, path: string): McpWrite {\n const existed = existsSync(path);\n const text = existed ? readFileSync(path, 'utf8') : '';\n if (/^\\[mcp_servers\\.graft\\]$/m.test(text)) return { id, path, action: 'unchanged' };\n const section = `[mcp_servers.graft]\\ncommand = \"npx\"\\nargs = [\"-y\", \"@nanonets/graft\", \"mcp\"]\\n`;\n const sep = text.length === 0 ? '' : text.endsWith('\\n') ? '\\n' : '\\n\\n';\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, `${text}${sep}${section}`);\n return { id, path, action: existed ? 'updated' : 'created' };\n}",
- "span": "L45-L54"
- }
- },
- {
- "id": "src/hosts/registry.ts",
- "name": "registry.ts",
- "kind": "file",
- "path": "src/hosts/registry.ts",
- "span": "L1-L89",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "0a8a2b82f0e4e1010943eb69d2eee7d9c4549f884967d5af1b8317c38ef99c18",
- "chars": 2496,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/hosts/registry.ts#detectHosts",
- "name": "detectHosts",
- "kind": "function",
- "path": "src/hosts/registry.ts",
- "span": "L86-L88",
- "signature": "function detectHosts(probe: DetectProbe): HostTarget[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "3e698dbf2457932d7a8713477813adac3b143152cafeb164aef5daf4fce398e5",
- "summary_state": "ready",
- "summary": "Filters and returns host targets that are detected based on the provided probing information.",
- "crux": {
- "code": "export function detectHosts(probe: DetectProbe): HostTarget[] {\n return HOSTS.filter((h) => h.detect(probe));\n}",
- "span": "L86-L88"
- }
- },
- {
- "id": "src/hosts/registry.ts#DetectProbe",
- "name": "DetectProbe",
- "kind": "interface",
- "path": "src/hosts/registry.ts",
- "span": "L12-L16",
- "signature": "interface DetectProbe",
- "exported": true,
- "origin": "ast",
- "body_hash": "b9f830f4861e96bdce7f7bf638175022642738bd7155f68167eb50a879f7a525",
- "summary_state": "ready",
- "summary": "Defines the structure for probing the existence of directories related to AI coding hosts.",
- "crux": null
- },
- {
- "id": "src/hosts/registry.ts#hostIds",
- "name": "hostIds",
- "kind": "function",
- "path": "src/hosts/registry.ts",
- "span": "L82-L84",
- "signature": "function hostIds(): string[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "4f4ec61bb5cdc94d5a40965c4bd6757b2e888811bb63fba7368f5f606d055ada",
- "summary_state": "ready",
- "summary": "Retrieves a list of identifiers for all defined host targets.",
- "crux": {
- "code": "export function hostIds(): string[] {\n return HOSTS.map((h) => h.id);\n}",
- "span": "L82-L84"
- }
- },
- {
- "id": "src/hosts/registry.ts#HostTarget",
- "name": "HostTarget",
- "kind": "interface",
- "path": "src/hosts/registry.ts",
- "span": "L18-L26",
- "signature": "interface HostTarget",
- "exported": true,
- "origin": "ast",
- "body_hash": "061c7862838ab4494e485220f52fea2202e0db5be2d2ff0e34d8e5fba4bb4b14",
- "summary_state": "ready",
- "summary": "Represents a target host with its identification, type, and detection logic for AI coding environments.",
- "crux": null
- },
- {
- "id": "src/hosts/sections.ts",
- "name": "sections.ts",
- "kind": "file",
- "path": "src/hosts/sections.ts",
- "span": "L1-L68",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "f172618889d5a02683032df8c69dd85b71c00c72a8b76958305ade22d6cda714",
- "chars": 2879,
- "summary_state": "ready",
- "summary": "This file provides functionality to manage sections of text within files, specifically for inserting and updating content between defined markers.",
- "crux": {
- "code": "export function upsertSection(filePath: string, body: string): { action: UpsertAction } {\n if (!existsSync(filePath)) {\n const block = fencedBlock(body);\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${block}\\n`);\n return { action: 'created' };\n }\n const text = readFileSync(filePath, 'utf8');\n const eol = detectEol(text);\n // Split on either eol so lines never carry an embedded '\\r' — that keeps\n // the marker/content comparison clean and lets us rejoin deliberately with\n // the detected eol instead of relying on '\\r' characters riding along",
- "span": "L36-L47"
- }
- },
- {
- "id": "src/hosts/sections.ts#detectEol",
- "name": "detectEol",
- "kind": "function",
- "path": "src/hosts/sections.ts",
- "span": "L24-L26",
- "signature": "function detectEol(text: string): LineEnding",
- "exported": false,
- "origin": "ast",
- "body_hash": "902fbd2b08830cb32450b0a84ba8f76f1fd34d4fe8345b28fadba29a682c4b43",
- "summary_state": "ready",
- "summary": "Determines the dominant line ending used in a given text, facilitating consistent handling of line breaks.",
- "crux": {
- "code": "function detectEol(text: string): LineEnding {\n return text.includes('\\r\\n') ? '\\r\\n' : '\\n';\n}",
- "span": "L24-L26"
- }
- },
- {
- "id": "src/hosts/sections.ts#fencedBlock",
- "name": "fencedBlock",
- "kind": "function",
- "path": "src/hosts/sections.ts",
- "span": "L15-L21",
- "signature": "function fencedBlock(body: string, eol: LineEnding = '\\n'): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "cfc11a2e95b5d0866b455dfff3cd2e1f98f13e3dc5dad5fe47b8f624cb93b6bd",
- "summary_state": "ready",
- "summary": "Creates a formatted block of text enclosed by specific markers, ensuring proper line endings and normalization of input.",
- "crux": {
- "code": " const normalizedBody = body.replace(/\\r/g, '');\n const block = `${START}\\n${normalizedBody.replace(/\\s+$/, '')}\\n${END}`;\n return eol === '\\n' ? block : block.replace(/\\n/g, '\\r\\n');",
- "span": "L18-L20"
- }
- },
- {
- "id": "src/hosts/sections.ts#LineEnding",
- "name": "LineEnding",
- "kind": "type",
- "path": "src/hosts/sections.ts",
- "span": "L13-L13",
- "signature": "type LineEnding = '\\n' | '\\r\\n';",
- "exported": false,
- "origin": "ast",
- "body_hash": "e49b9a5218efdfb100f47552da255afff2e24a84ab10c02564adb1e72892a229",
- "summary_state": "ready",
- "summary": "Specifies the types of line endings that can be used in the text, ensuring compatibility with different operating systems.",
- "crux": null
- },
- {
- "id": "src/hosts/sections.ts#markerLineIndex",
- "name": "markerLineIndex",
- "kind": "function",
- "path": "src/hosts/sections.ts",
- "span": "L29-L34",
- "signature": "function markerLineIndex(lines: string[], marker: string, from = 0): number",
- "exported": false,
- "origin": "ast",
- "body_hash": "b090a3b83b05f46da8f10b2c37a8f0a5c1522280f786fe4263f161294e0ffbd3",
- "summary_state": "ready",
- "summary": "Finds the index of a specified marker in an array of lines, helping to locate the start and end of sections within the text.",
- "crux": {
- "code": " for (let i = from; i < lines.length; i++) {\n if (lines[i].trim() === marker) return i;\n }\n return -1;",
- "span": "L30-L33"
- }
- },
- {
- "id": "src/hosts/sections.ts#UpsertAction",
- "name": "UpsertAction",
- "kind": "type",
- "path": "src/hosts/sections.ts",
- "span": "L11-L11",
- "signature": "type UpsertAction = 'created' | 'appended' | 'replaced' | 'unchanged';",
- "exported": true,
- "origin": "ast",
- "body_hash": "53d24b330d60564589d8a07882c099e9fc964a43b0523536ea03cc430551452f",
- "summary_state": "ready",
- "summary": "Defines the possible outcomes of an upsert operation on a section, indicating whether it was created, appended, replaced, or unchanged.",
- "crux": null
- },
- {
- "id": "src/hosts/sections.ts#upsertSection",
- "name": "upsertSection",
- "kind": "function",
- "path": "src/hosts/sections.ts",
- "span": "L36-L67",
- "signature": "function upsertSection(filePath: string, body: string): { action: UpsertAction }",
- "exported": true,
- "origin": "ast",
- "body_hash": "552b5cf28b36f1e019f183739f266aa59b8af6bbf691056507639ce5633c2dd0",
- "summary_state": "ready",
- "summary": "Handles the logic for inserting or updating a section of text in a file, managing file creation, content comparison, and writing operations.",
- "crux": {
- "code": "export function upsertSection(filePath: string, body: string): { action: UpsertAction } {\n if (!existsSync(filePath)) {\n const block = fencedBlock(body);\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${block}\\n`);\n return { action: 'created' };\n }\n const text = readFileSync(filePath, 'utf8');\n const eol = detectEol(text);\n // Split on either eol so lines never carry an embedded '\\r' — that keeps\n // the marker/content comparison clean and lets us rejoin deliberately with\n // the detected eol instead of relying on '\\r' characters riding along",
- "span": "L36-L47"
- }
- },
- {
- "id": "src/index.ts",
- "name": "index.ts",
- "kind": "file",
- "path": "src/index.ts",
- "span": "L1-L45",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "f66577d7952e061dd28f782e39f572fe9421a52758e9151f2620739894dd006d",
- "chars": 2061,
- "summary_state": "ready",
- "summary": "This module serves as the public API for the Graft library, facilitating the building and checking of a graph of linked markdown files.",
- "crux": {
- "code": " * await engine.init(\".\"); // writes .context/*.md + manifest.json\n *\n * const result = engine.check(\".\"); // { ok: boolean, ...drift }\n * if (!result.ok) process.exitCode = 1;",
- "span": "L12-L15"
- }
- },
- {
- "id": "src/ingest/fs.ts",
- "name": "fs.ts",
- "kind": "file",
- "path": "src/ingest/fs.ts",
- "span": "L1-L46",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a8339532da34b44d35eb9ad16e7106adb1262d73d9895b1bd94574337fb2019f",
- "chars": 1218,
- "summary_state": "ready",
- "summary": "This file provides utilities for walking through a filesystem to identify source files while excluding certain directories and large files.",
- "crux": null
- },
- {
- "id": "src/ingest/fs.ts#walkDir",
- "name": "walkDir",
- "kind": "function",
- "path": "src/ingest/fs.ts",
- "span": "L27-L45",
- "signature": "function walkDir(dir: string): string[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "001f6c9f648af0620ed90c55a132464ab87da3ad74b6711df716e9f9493333c4",
- "summary_state": "ready",
- "summary": "The walkDir function recursively collects paths of files in a directory while skipping specified directories and files larger than 1 MB.",
- "crux": {
- "code": " if (entry.name.startsWith(\".\")) continue;\n const full = join(dir, entry.name);\n if (entry.isDirectory()) {\n if (SKIP_DIRS.has(entry.name)) continue;\n out.push(...walkDir(full));\n } else if (entry.isFile()) {\n try {\n if (statSync(full).size > MAX_FILE_BYTES) continue;\n } catch {\n continue;\n }\n out.push(full);",
- "span": "L30-L41"
- }
- },
- {
- "id": "src/mcp/server.ts",
- "name": "server.ts",
- "kind": "file",
- "path": "src/mcp/server.ts",
- "span": "L1-L67",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "0bdeba850ab62132a01b683cd2db7ee36a7509a67ebd58e73887a22a611ce100",
- "chars": 2258,
- "summary_state": "ready",
- "summary": "Defines a minimal JSON-RPC 2.0 server for handling protocol messages and tool calls.",
- "crux": {
- "code": "export function startMcpServer(root: string, dirOverride?: string): void {\n const rl = createInterface({ input: process.stdin, crlfDelay: Infinity });\n rl.on('line', (line) => {\n const text = line.trim();\n if (!text) return;\n let msg: { id?: unknown; method?: string; params?: Record<string, any> };\n try {\n msg = JSON.parse(text);\n } catch {\n replyError(null, -32700, 'parse error');\n return;\n }",
- "span": "L20-L31"
- }
- },
- {
- "id": "src/mcp/server.ts#reply",
- "name": "reply",
- "kind": "function",
- "path": "src/mcp/server.ts",
- "span": "L12-L14",
- "signature": "function reply(id: unknown, result: object): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "ebf863d2db4e0898846deff35e6a0d581dae06f6e402592309f8c6742a3abe59",
- "summary_state": "ready",
- "summary": "Constructs and sends a successful JSON-RPC response message.",
- "crux": {
- "code": "function reply(id: unknown, result: object): void {\n send({ jsonrpc: '2.0', id, result });\n}",
- "span": "L12-L14"
- }
- },
- {
- "id": "src/mcp/server.ts#replyError",
- "name": "replyError",
- "kind": "function",
- "path": "src/mcp/server.ts",
- "span": "L16-L18",
- "signature": "function replyError(id: unknown, code: number, message: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "540611464bba68e3e678870e748cde38aa6790c52ca10dfda8f891dcf0d59717",
- "summary_state": "ready",
- "summary": "Constructs and sends a JSON-RPC error response message.",
- "crux": {
- "code": "function replyError(id: unknown, code: number, message: string): void {\n send({ jsonrpc: '2.0', id, error: { code, message } });\n}",
- "span": "L16-L18"
- }
- },
- {
- "id": "src/mcp/server.ts#send",
- "name": "send",
- "kind": "function",
- "path": "src/mcp/server.ts",
- "span": "L8-L10",
- "signature": "function send(msg: object): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "7446435a2fc268ad8d76124c2e66f957d5de51730babfc38d8cb4dff5fc80c58",
- "summary_state": "ready",
- "summary": "Sends a JSON-RPC message to the standard output stream.",
- "crux": {
- "code": "function send(msg: object): void {\n process.stdout.write(`${JSON.stringify(msg)}\\n`);\n}",
- "span": "L8-L10"
- }
- },
- {
- "id": "src/mcp/server.ts#startMcpServer",
- "name": "startMcpServer",
- "kind": "function",
- "path": "src/mcp/server.ts",
- "span": "L20-L66",
- "signature": "function startMcpServer(root: string, dirOverride?: string): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "bbf674f912399a59d133f52a0d975069c215acfb0cc62b5f6ffc3d15ef92acbd",
- "summary_state": "ready",
- "summary": "Initializes the server to listen for incoming JSON-RPC messages and handle them appropriately.",
- "crux": {
- "code": "export function startMcpServer(root: string, dirOverride?: string): void {\n const rl = createInterface({ input: process.stdin, crlfDelay: Infinity });\n rl.on('line', (line) => {\n const text = line.trim();\n if (!text) return;\n let msg: { id?: unknown; method?: string; params?: Record<string, any> };\n try {\n msg = JSON.parse(text);\n } catch {\n replyError(null, -32700, 'parse error');\n return;\n }",
- "span": "L20-L31"
- }
- },
- {
- "id": "src/mcp/tools.ts",
- "name": "tools.ts",
- "kind": "file",
- "path": "src/mcp/tools.ts",
- "span": "L1-L285",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "8963bbe2ae9a8e8633c3c3469ef2e3efbbcf8790ab869c83ba60c1f59fd9d523",
- "chars": 12817,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/mcp/tools.ts#callTool",
- "name": "callTool",
- "kind": "function",
- "path": "src/mcp/tools.ts",
- "span": "L198-L284",
- "signature": "function callTool( root: string, name: string, args: Record<string, unknown>, dirOverride?: string, ): { text: string; isError: boolean }",
- "exported": true,
- "origin": "ast",
- "body_hash": "4b3d5bde8c61bc126761f0bea87a022e6671b52fb4b579138cd54aec020d7208",
- "summary_state": "stale",
- "summary": "Handles the invocation of various tools based on user input, managing errors and returning formatted results for different graph operations.",
- "crux": {
- "code": "export function callTool(\n root: string,\n name: string,\n args: Record<string, unknown>,\n dirOverride?: string,\n): { text: string; isError: boolean } {\n try {\n switch (name) {\n case 'graft_ask': {\n const query = String(args.query ?? '');\n if (!query) return { text: 'graft_ask requires a query', isError: true };\n const limit = typeof args.limit === 'number' ? args.limit : 5;",
- "span": "L149-L160"
- }
- },
- {
- "id": "src/mcp/tools.ts#callWorkspaceTool",
- "name": "callWorkspaceTool",
- "kind": "function",
- "path": "src/mcp/tools.ts",
- "span": "L150-L196",
- "signature": "function callWorkspaceTool( root: string, dirOverride: string | undefined, name: string, args: Record<string, unknown>, ): { text: string; isError: boolean } | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "1bfb8d0365cb4ba9352ba67e63e57be51e0c7479da98915643d164a4d738a022",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "src/mcp/tools.ts#renderMatches",
- "name": "renderMatches",
- "kind": "function",
- "path": "src/mcp/tools.ts",
- "span": "L129-L144",
- "signature": "function renderMatches( direction: Direction, showDepth: boolean, matches: NodeV1[], hitsFor: (n: NodeV1) => EdgeHit[], ): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "7059bf338ce7e9e88b1ab4bfc452b62fb489c56239322352f8c07b2b2bb42ebc",
- "summary_state": "stale",
- "summary": "Formats and renders the results of graph traversal matches, providing a structured output for users to understand symbol relationships.",
- "crux": {
- "code": "function renderMatches(kind: TraverseKind, matches: NodeV1[], hitsFor: (n: NodeV1) => EdgeHit[]): string {\n return matches\n .map((m) => {\n const hits = hitsFor(m);\n const lines = [headerOf(m)];\n if (hits.length === 0) lines.push(looseNoteFor(kind, m.name));\n else for (const h of hits) lines.push(hitLine(kind, h));\n return lines.join('\\n');\n })\n .join('\\n\\n');\n}",
- "span": "L137-L147"
- }
- },
- {
- "id": "src/mcp/tools.ts#ToolDef",
- "name": "ToolDef",
- "kind": "interface",
- "path": "src/mcp/tools.ts",
- "span": "L27-L31",
- "signature": "interface ToolDef",
- "exported": true,
- "origin": "ast",
- "body_hash": "66213a2ab8c0b58ddbf6e632f4ac26e643f00ff02eef696f9b321c2236b45365",
- "summary_state": "ready",
- "summary": "Defines the structure for tool definitions used in the MCP tools, ensuring consistent input schema and metadata for each tool.",
- "crux": {
- "code": "export interface ToolDef {\n name: string;\n description: string;\n inputSchema: object;\n}",
- "span": "L18-L22"
- }
- },
- {
- "id": "src/mcp/tools.ts#unknownSymbolText",
- "name": "unknownSymbolText",
- "kind": "function",
- "path": "src/mcp/tools.ts",
- "span": "L35-L37",
- "signature": "function unknownSymbolText(query: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "ea43b6a930c9fe3d67aa2e40b6d1d7dc2ebdb0e55a23c1f42047c0089bc2917e",
- "summary_state": "ready",
- "summary": "Generates an error message for an unknown symbol query, guiding users to check their input or build the graph.",
- "crux": {
- "code": "function unknownSymbolText(query: string): string {\n return `no symbol \"${query}\" in the graph — check spelling or run \\`graft build\\``;\n}",
- "span": "L29-L31"
- }
- },
- {
- "id": "src/search/grep-cli.ts",
- "name": "grep-cli.ts",
- "kind": "file",
- "path": "src/search/grep-cli.ts",
- "span": "L1-L116",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "64dc983c11be49dc755c21f1eb6420adb1ef016077d5e3cc3fe7d5ad82baee78",
- "chars": 4921,
- "summary_state": "stale",
- "summary": "This file provides the command-line interface for the grep functionality, formatting results for user-friendly output.",
- "crux": {
- "code": "export function formatGrepResult(result: GrepResult): string {\n const blocks = [formatGrepHeader(result), \"\", ...result.groups.map((g) => formatGroup(g) + \"\\n\")];\n let out = blocks.join(\"\\n\").replace(/\\n+$/, \"\\n\");\n const note = truncationNote(result);\n if (note) out += note + \"\\n\";\n return out;\n}",
- "span": "L53-L59"
- }
- },
- {
- "id": "src/search/grep-cli.ts#formatGrepHeader",
- "name": "formatGrepHeader",
- "kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L37-L40",
- "signature": "function formatGrepHeader(result: GrepResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "eb6324d18b820f95e0423005738f3a8ec5da095849e5934e82ca512c75f1e4f4",
- "summary_state": "ready",
- "summary": "Creates a header for the grep results, summarizing the total hits and files searched.",
- "crux": {
- "code": "export function formatGrepHeader(result: GrepResult): string {\n const filesHit = new Set(result.groups.map((g) => g.path)).size;\n return `\"${result.pattern}\" — ${result.totalHits} hits in ${result.groups.length} symbols across ${filesHit} files (searched ${result.filesSearched} indexed files)`;\n}",
- "span": "L36-L39"
- }
- },
- {
- "id": "src/search/grep-cli.ts#formatGrepResult",
- "name": "formatGrepResult",
- "kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L54-L62",
- "signature": "function formatGrepResult(result: GrepResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "f8a8198261b13ec5667805d4024024a19adf344fb6a4af500e19bf884e7c6b44",
- "summary_state": "stale",
- "summary": "Compiles the full human-readable report of grep results, including headers and formatted groups.",
- "crux": {
- "code": "export function formatGrepResult(result: GrepResult): string {\n const blocks = [formatGrepHeader(result), \"\", ...result.groups.map((g) => formatGroup(g) + \"\\n\")];\n let out = blocks.join(\"\\n\").replace(/\\n+$/, \"\\n\");\n const note = truncationNote(result);\n if (note) out += note + \"\\n\";\n return out;\n}",
- "span": "L53-L59"
- }
- },
- {
- "id": "src/search/grep-cli.ts#formatGroup",
- "name": "formatGroup",
- "kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L30-L34",
- "signature": "function formatGroup(g: GrepGroup): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c6901df49ecdcf11c258a32a5e8acf90c887eee405673b9877f0d241ddd7d24d",
- "summary_state": "ready",
- "summary": "Formats a group of grep results into a human-readable string, including hit lines.",
- "crux": {
- "code": "function formatGroup(g: GrepGroup): string {\n const lines = [groupHeader(g)];\n for (const h of g.hits) lines.push(` L${h.line}: ${h.text}`);\n return lines.join(\"\\n\");\n}",
- "span": "L29-L33"
- }
- },
- {
- "id": "src/search/grep-cli.ts#GrepCliOptions",
- "name": "GrepCliOptions",
- "kind": "interface",
- "path": "src/search/grep-cli.ts",
- "span": "L16-L23",
- "signature": "interface GrepCliOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "45fbe9e85b94fe0054f047d74a5888cadb3c80836e3f9be8fe9e3074f3efdc5a",
- "summary_state": "ready",
- "summary": "Defines options for the grep command-line interface, allowing customization of search behavior.",
- "crux": null
- },
- {
- "id": "src/search/grep-cli.ts#groupHeader",
- "name": "groupHeader",
- "kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L25-L28",
- "signature": "function groupHeader(g: GrepGroup): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "49c6bc64382bd6a38a856a25d53b4f14ce0cb771fe4e9a34acfb07a6a2a85d46",
- "summary_state": "ready",
- "summary": "Generates a header string for a group of grep results, summarizing the group's metadata.",
- "crux": {
- "code": "function groupHeader(g: GrepGroup): string {\n if (g.symbol) return `${g.symbol.name} · ${g.symbol.kind} · ${g.symbol.path}:${g.symbol.span} · ${g.inDegree} in-edges`;\n return `${g.path} (module level) · ${g.inDegree} in-edges`;\n}",
- "span": "L24-L27"
- }
- },
- {
- "id": "src/search/grep-cli.ts#runGrepCommand",
- "name": "runGrepCommand",
- "kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L86-L115",
- "signature": "function runGrepCommand(pattern: string, dir: string, opts: GrepCliOptions): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "3161968bd9ae55839fa14ad57a480382b2251ce81b5efd31822247079b3759bc",
- "summary_state": "ready",
- "summary": "Executes the grep command, handling graph resolution, pattern searching, and output formatting.",
- "crux": {
- "code": "export function runGrepCommand(pattern: string, dir: string, opts: GrepCliOptions): void {\n const root = resolve(dir);\n const contextDir = contextDirFor(root, opts.globalDir);\n const graph = loadGraphCached(contextDir);\n if (!graph) {\n console.error(\"✗ no graph — run graft build first\");\n process.exit(1);\n }\n\n let result: GrepResult;\n try {\n result = grepGraph(graph, root, pattern, { ignoreCase: opts.ignoreCase, fixed: opts.fixed, in: opts.in });",
- "span": "L83-L94"
- }
- },
- {
- "id": "src/search/grep-cli.ts#truncationNote",
- "name": "truncationNote",
- "kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L43-L50",
- "signature": "function truncationNote(result: GrepResult): string | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "9cbadb17b0273dea383d0ef0676d8477d369fc7a2231c5b379039c3a96b46517",
- "summary_state": "ready",
- "summary": "Generates a note about any truncation in the grep results, indicating unreadable files or additional hits beyond the cap.",
- "crux": {
- "code": "function truncationNote(result: GrepResult): string | null {\n const { files, hits } = result.truncated;\n if (files === 0 && hits === 0) return null;\n const parts: string[] = [];\n if (hits > 0) parts.push(`${hits} more hit${hits === 1 ? \"\" : \"s\"} beyond the cap`);\n if (files > 0) parts.push(`${files} indexed file${files === 1 ? \"\" : \"s\"} unreadable`);\n return `(truncated: ${parts.join(\", \")} — narrow with --in or refine the pattern)`;\n}",
- "span": "L42-L49"
- }
- },
- {
- "id": "src/search/grep-cli.ts#zeroHitNote",
- "name": "zeroHitNote",
- "kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L72-L77",
- "signature": "function zeroHitNote(result: GrepResult): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "358cfca22f9a047a4df8b6e452ca54936ac672908468fba2a3dddd7017505cce",
- "summary_state": "ready",
- "summary": "Provides a detailed message for zero-hit results, explaining the absence of matches and potential issues.",
- "crux": {
- "code": "export function zeroHitNote(result: GrepResult): string {\n const base = `no hits for \"${result.pattern}\" in ${result.filesSearched} indexed files — unindexed files (docs, configs, new files) aren't searched; try grep -rn \"${result.pattern}\" for those`;\n const { files } = result.truncated;\n if (files === 0) return base;\n return `${base} — note: ${files} indexed file${files === 1 ? \"\" : \"s\"} could not be read (stale graph? run graft build)`;\n}",
- "span": "L69-L74"
- }
- },
- {
- "id": "src/search/grep.ts",
- "name": "grep.ts",
- "kind": "file",
- "path": "src/search/grep.ts",
- "span": "L1-L201",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "f3405967f0d2e4aba158b720188369dbe913c6c12955aa1511cabed498fddaf9",
- "chars": 6816,
- "summary_state": "stale",
- "summary": "This file implements a regex search over indexed files in a graph, grouping results by their enclosing symbols and ranking them by their importance based on incoming edges.",
- "crux": {
- "code": " * `graft grep` core: regex search over the graph's indexed files, with hits\n * grouped by their innermost enclosing symbol and ranked by incoming-edge\n * count (coupling) — a grep that answers \"which of these hits matters\",\n * because plain `grep -rn` gives no way to tell a hit inside a\n * heavily-depended-on function from one inside dead code.",
- "span": "L2-L6"
- }
- },
- {
- "id": "src/search/grep.ts#computeInDegree",
- "name": "computeInDegree",
- "kind": "function",
- "path": "src/search/grep.ts",
- "span": "L123-L130",
- "signature": "function computeInDegree(graph: GraphV1): Map<string, number>",
- "exported": false,
- "origin": "ast",
- "body_hash": "614d2e67e179ee5a934d6c1b03134ca1e1c394d3036a1754bd41dd7ee8dcc1b7",
- "summary_state": "ready",
- "summary": "Calculates the incoming edge count for each symbol in the graph, which is used to rank grep hits by importance.",
- "crux": {
- "code": "function computeInDegree(graph: GraphV1): Map<string, number> {\n const deg = new Map<string, number>();\n for (const e of graph.edges) {\n if (!WALK_RELATIONS.has(e.relation)) continue;\n deg.set(e.target, (deg.get(e.target) ?? 0) + 1);\n }\n return deg;\n}",
- "span": "L119-L126"
- }
- },
- {
- "id": "src/search/grep.ts#enclosingSymbol",
- "name": "enclosingSymbol",
- "kind": "function",
- "path": "src/search/grep.ts",
- "span": "L112-L119",
- "signature": "function enclosingSymbol(symbols: SymbolSpan[], line: number): NodeV1 | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "980763724d7cfb9637d1a82b38f90ee4c1659a6ad4e06eb8b42ce19d6df771b0",
- "summary_state": "ready",
- "summary": "Finds the innermost symbol that contains a specified line number, returning the corresponding node from the graph.",
- "crux": {
- "code": "function enclosingSymbol(symbols: SymbolSpan[], line: number): NodeV1 | null {\n let found: NodeV1 | null = null;\n for (const s of symbols) {\n if (s.start > line) break;\n if (line <= s.end) found = s.node;\n }\n return found;\n}",
- "span": "L108-L115"
- }
- },
- {
- "id": "src/search/grep.ts#escapeRegExp",
- "name": "escapeRegExp",
- "kind": "function",
- "path": "src/search/grep.ts",
- "span": "L79-L81",
- "signature": "function escapeRegExp(s: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "4c6310d2cd2f62c68b872392c4843cb011bea7ced8f1ff4db8c010c952f60ba7",
- "summary_state": "ready",
- "summary": "Escapes special characters in a string to create a safe regex pattern for searching.",
- "crux": {
- "code": "function escapeRegExp(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}",
- "span": "L75-L77"
- }
- },
- {
- "id": "src/search/grep.ts#grepGraph",
- "name": "grepGraph",
- "kind": "function",
- "path": "src/search/grep.ts",
- "span": "L137-L200",
- "signature": "function grepGraph(graph: GraphV1, repoRoot: string, pattern: string, opts: GrepOptions = {}): GrepResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "468a117edd348b57d625a7e44c9b15ad2e67c220296b40961aa6903eefacef76",
- "summary_state": "stale",
- "summary": "Performs the grep search on the graph, collecting and returning results based on the specified pattern and options.",
- "crux": {
- "code": "export function grepGraph(graph: GraphV1, repoRoot: string, pattern: string, opts: GrepOptions = {}): GrepResult {\n const maxHits = opts.maxHits ?? DEFAULT_MAX_HITS;\n const source = opts.fixed ? escapeRegExp(pattern) : pattern;\n const regex = new RegExp(source, opts.ignoreCase ? \"i\" : \"\");\n\n const inDegree = computeInDegree(graph);\n const fileNodes = graph.nodes.filter((n) => n.kind === \"file\" && (!opts.in || n.path.includes(opts.in)));\n\n const groups = new Map<string, GrepGroup>();\n let collected = 0;\n let truncatedHits = 0;\n let truncatedFiles = 0;",
- "span": "L133-L144"
- }
- },
- {
- "id": "src/search/grep.ts#GrepGroup",
- "name": "GrepGroup",
- "kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L34-L43",
- "signature": "interface GrepGroup",
- "exported": true,
- "origin": "ast",
- "body_hash": "f6498adee93c3a0c7386dd6fd4ffb9ad0e73c2ce5fc6e13c041cdc1c495bdf1d",
- "summary_state": "ready",
- "summary": "Groups grep hits by their enclosing symbol, providing context such as the symbol's in-degree and the path of the file.",
- "crux": {
- "code": " /** null → file-level: the hit lies outside every indexed symbol's span\n * (module-level code — imports, top-level statements, module constants). */\n symbol: GrepSymbolRef | null;\n path: string;\n /** Incoming WALK_RELATIONS edges targeting the symbol — always 0 for\n * file-level groups (there's no single symbol id to count edges against). */\n inDegree: number;\n hits: GrepHit[];\n}",
- "span": "L34-L42"
- }
- },
- {
- "id": "src/search/grep.ts#GrepHit",
- "name": "GrepHit",
- "kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L18-L22",
- "signature": "interface GrepHit",
- "exported": true,
- "origin": "ast",
- "body_hash": "5a03009952d496614e173831d994debd5b88d66861aa8b4ebb0617e5fb792a5f",
- "summary_state": "ready",
- "summary": "Represents a single hit found during the grep search, including the line number and trimmed text of the line.",
- "crux": {
- "code": " line: number;\n /** Trimmed line text, capped at 160 chars. */\n text: string;",
- "span": "L18-L20"
- }
- },
- {
- "id": "src/search/grep.ts#GrepOptions",
- "name": "GrepOptions",
- "kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L64-L73",
- "signature": "interface GrepOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "0d3f66c959733069e27d33cb53e110dd9f6606d3e77b71362b3c95e9c5a86646",
- "summary_state": "ready",
- "summary": "Holds options for configuring the grep search, such as case sensitivity and maximum hits to collect.",
- "crux": {
- "code": "export interface GrepOptions {\n ignoreCase?: boolean;\n /** Treat `pattern` as a literal string (regex-escaped), not a regex. */\n fixed?: boolean;\n /** Narrow to file nodes whose path contains this substring. */\n in?: string;\n /** Stop collecting hits after this many; the rest are tallied into\n * `truncated.hits`. Default 300. */\n maxHits?: number;\n}",
- "span": "L60-L69"
- }
- },
- {
- "id": "src/search/grep.ts#GrepResult",
- "name": "GrepResult",
- "kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L45-L62",
- "signature": "interface GrepResult",
- "exported": true,
- "origin": "ast",
- "body_hash": "3c2826b6ccea2928580aa2a73561f99a6a0aae6b12bf84274c90a1b2fb8a72ab",
- "summary_state": "stale",
- "summary": "Encapsulates the results of a grep operation, including the pattern searched, total hits, and grouped results.",
- "crux": {
- "code": "export interface GrepResult {\n pattern: string;\n /** Indexed file nodes considered (after the `in` filter), whether or not\n * each was actually readable — matches the CLI's \"searched N indexed\n * files\" wording. */\n filesSearched: number;\n /** Hits actually collected (<= maxHits). */\n totalHits: number;\n /** Sorted: inDegree desc, then path asc. */\n groups: GrepGroup[];\n /** Dropped counts — never silent. `files`: indexed file nodes that\n * couldn't be read from disk. `hits`: matches found beyond `maxHits`,",
- "span": "L44-L55"
- }
- },
- {
- "id": "src/search/grep.ts#GrepSymbolRef",
- "name": "GrepSymbolRef",
- "kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L24-L32",
- "signature": "interface GrepSymbolRef",
- "exported": true,
- "origin": "ast",
- "body_hash": "021dcfb0dffc4d64379a0dd13b7f8ba1c31d66ed199cd35a08b0d877fa39e0e4",
- "summary_state": "ready",
- "summary": "Defines a reference to a symbol in the graph, including its qualified name and span, to facilitate grouping grep hits by their enclosing symbols.",
- "crux": {
- "code": " id: string;\n /** Qualified scope-joined name (e.g. `FastAPI.include_router`), not just\n * the bare symbol name — the id's segment after the file-path `#`. */\n name: string;\n kind: string;\n path: string;\n span: string;",
- "span": "L24-L30"
- }
- },
- {
- "id": "src/search/grep.ts#spanBounds",
- "name": "spanBounds",
- "kind": "function",
- "path": "src/search/grep.ts",
- "span": "L83-L87",
- "signature": "function spanBounds(span: string): { start: number; end: number } | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "07501d016c2decb33d98ef556db8322d35e7753945a15803d9579b03bd80d5a1",
- "summary_state": "ready",
- "summary": "Extracts the start and end line numbers from a span string, returning null if the format is invalid.",
- "crux": {
- "code": "function spanBounds(span: string): { start: number; end: number } | null {\n const m = SPAN_RE.exec(span);\n if (!m) return null;\n return { start: Number(m[1]), end: Number(m[2]) };\n}",
- "span": "L79-L83"
- }
- },
- {
- "id": "src/search/grep.ts#symbolsOf",
- "name": "symbolsOf",
- "kind": "function",
- "path": "src/search/grep.ts",
- "span": "L97-L106",
- "signature": "function symbolsOf(graph: GraphV1, path: string): SymbolSpan[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "26481c2032801b2e8e12980416a4d10b1a1bddb66c0d6d4bfa97cb918c94f0c4",
- "summary_state": "ready",
- "summary": "Retrieves and sorts the symbols of a given file in the graph, based on their span start lines.",
- "crux": {
- "code": "function symbolsOf(graph: GraphV1, path: string): SymbolSpan[] {\n const out: SymbolSpan[] = [];\n for (const n of graph.nodes) {\n if (n.kind === \"file\" || n.path !== path) continue;\n const b = spanBounds(n.span);\n if (b) out.push({ node: n, start: b.start, end: b.end });\n }\n out.sort((a, b) => a.start - b.start);\n return out;\n}",
- "span": "L93-L102"
- }
- },
- {
- "id": "src/search/grep.ts#SymbolSpan",
- "name": "SymbolSpan",
- "kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L89-L93",
- "signature": "interface SymbolSpan",
- "exported": false,
- "origin": "ast",
- "body_hash": "ed659214924ee7e720952748e5e217835cb3988e58c0a840f85800c1207cd6f3",
- "summary_state": "ready",
- "summary": "Represents a span of a symbol in the graph, including its start and end lines, to assist in finding enclosing symbols.",
- "crux": {
- "code": "interface SymbolSpan {\n node: NodeV1;\n start: number;\n end: number;\n}",
- "span": "L85-L89"
- }
- },
- {
- "id": "src/search/grep.ts#toSymbolRef",
- "name": "toSymbolRef",
- "kind": "function",
- "path": "src/search/grep.ts",
- "span": "L132-L135",
- "signature": "function toSymbolRef(n: NodeV1): GrepSymbolRef",
- "exported": false,
- "origin": "ast",
- "body_hash": "f527f108414f4112517e03e555c78d998f5d3cea3a6bf89b2f9b383bc73aa732",
- "summary_state": "ready",
- "summary": "Converts a node in the graph to a GrepSymbolRef, providing a structured representation of the symbol.",
- "crux": {
- "code": "function toSymbolRef(n: NodeV1): GrepSymbolRef {\n const hash = n.id.indexOf(\"#\");\n return { id: n.id, name: hash >= 0 ? n.id.slice(hash + 1) : n.name, kind: n.kind, path: n.path, span: n.span };\n}",
- "span": "L128-L131"
- }
- },
- {
- "id": "src/util/id.ts",
- "name": "id.ts",
- "kind": "file",
- "path": "src/util/id.ts",
- "span": "L1-L17",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "5fabc8ddcc3abc907ce69f04ad2ebe51933262cf44aa2dfd40589f71f1926e8a",
- "chars": 626,
- "summary_state": "ready",
- "summary": "This file provides utility functions for generating unique identifiers, creating content hashes, and normalizing names for consistent matching.",
- "crux": null
- },
- {
- "id": "src/util/id.ts#contentHash",
- "name": "contentHash",
- "kind": "function",
- "path": "src/util/id.ts",
- "span": "L9-L11",
- "signature": "function contentHash(input: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "d83ce720108cb9ea3b0c7b1e7034657603640647ca00283905fcd099ac3fe2ed",
- "summary_state": "ready",
- "summary": "This function creates a stable hash of the input content, which is essential for deduplication of documents.",
- "crux": {
- "code": " return createHash(\"sha256\").update(input).digest(\"hex\");",
- "span": "L10-L10"
- }
- },
- {
- "id": "src/util/id.ts#newId",
- "name": "newId",
- "kind": "function",
- "path": "src/util/id.ts",
- "span": "L4-L6",
- "signature": "function newId(prefix: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "55062dee898e1edb76d65f7daf785b67e998a57a7dfd6f78c7eb17f39e3e1dc0",
- "summary_state": "ready",
- "summary": "This function generates a unique identifier with a specified prefix, solving the need for easily identifiable and unique keys.",
- "crux": {
- "code": " return `${prefix}_${randomUUID().replace(/-/g, \"\").slice(0, 20)}`;",
- "span": "L5-L5"
- }
- },
- {
- "id": "src/util/id.ts#normalizeName",
- "name": "normalizeName",
- "kind": "function",
- "path": "src/util/id.ts",
- "span": "L14-L16",
- "signature": "function normalizeName(name: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "bac0e298462067a441b2b76566ed29c3787280585b956f84b81d7a766cd7211a",
- "summary_state": "ready",
- "summary": "This function normalizes names for case- and whitespace-insensitive matching, ensuring consistency in name comparisons.",
- "crux": {
- "code": " return name.trim().toLowerCase().replace(/\\s+/g, \" \");",
- "span": "L15-L15"
- }
- },
- {
- "id": "src/viz/assemble.ts",
- "name": "assemble.ts",
- "kind": "file",
- "path": "src/viz/assemble.ts",
- "span": "L1-L131",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "58ad5caed087bd7b929f5b625501a607e79e0476f998636bec241e0296706ece",
- "chars": 4233,
- "summary_state": "ready",
- "summary": "Assembles a comprehensive graph document from markdown files in a context directory, ensuring that only valid nodes and edges are included.",
- "crux": {
- "code": "/** Read a context dir and assemble the render-ready graph document. */\nexport function assembleContextGraph(contextDir: string): VizGraph {\n const nodes: VizNode[] = [];\n const rawEdges: VizEdge[] = [];\n let skippedFiles = 0;\n\n if (existsSync(contextDir)) {\n for (const entry of readdirSync(contextDir).sort()) {\n if (!entry.endsWith(\".md\")) continue;\n let parsed: matter.GrayMatterFile<string>;\n try {\n parsed = matter(readFileSync(join(contextDir, entry), \"utf8\"));",
- "span": "L78-L89"
- }
- },
- {
- "id": "src/viz/assemble.ts#assembleContextGraph",
- "name": "assembleContextGraph",
- "kind": "function",
- "path": "src/viz/assemble.ts",
- "span": "L79-L130",
- "signature": "function assembleContextGraph(contextDir: string): VizGraph",
- "exported": true,
- "origin": "ast",
- "body_hash": "8529626bef8abf2e1a326d601cf5a6a4972e0a1b801d6b653ba8227a27b9dbbd",
- "summary_state": "ready",
- "summary": "Processes markdown files in a specified directory to create a structured visualization graph, handling errors gracefully.",
- "crux": {
- "code": " if (existsSync(contextDir)) {\n for (const entry of readdirSync(contextDir).sort()) {\n if (!entry.endsWith(\".md\")) continue;\n let parsed: matter.GrayMatterFile<string>;\n try {\n parsed = matter(readFileSync(join(contextDir, entry), \"utf8\"));\n } catch {\n skippedFiles++;\n continue;\n }\n const fm = parsed.data as Record<string, unknown>;\n const id = String(fm.slug ?? entry.replace(/\\.md$/, \"\"));",
- "span": "L84-L95"
- }
- },
- {
- "id": "src/viz/assemble.ts#extractSummary",
- "name": "extractSummary",
- "kind": "function",
- "path": "src/viz/assemble.ts",
- "span": "L65-L76",
- "signature": "function extractSummary(body: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "1857e477bdb012672fa843cfca8d43eb543e7cfba2cc496692a65ebe8c0fa6c5",
- "summary_state": "ready",
- "summary": "Extracts and cleans the summary text from a markdown node's content, ensuring it adheres to length constraints.",
- "crux": {
- "code": "function extractSummary(body: string): string {\n let text = body;\n const start = text.indexOf(GEN_START);\n const end = text.indexOf(GEN_END);\n if (start >= 0 && end > start) text = text.slice(start + GEN_START.length, end);\n // Keep only the Summary section if headings are present.\n const related = text.indexOf(\"## Related\");\n if (related >= 0) text = text.slice(0, related);\n text = text.replace(/^##\\s+Summary\\s*$/m, \"\");\n text = text.trim();\n return text.length > SUMMARY_MAX ? text.slice(0, SUMMARY_MAX).trimEnd() + \"…\" : text;",
- "span": "L65-L75"
- }
- },
- {
- "id": "src/viz/assemble.ts#normalizeRelation",
- "name": "normalizeRelation",
- "kind": "function",
- "path": "src/viz/assemble.ts",
- "span": "L56-L58",
- "signature": "function normalizeRelation(rel: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "adfaae55d1d21718adbedaa294194517aa7abdddeb95433642fd358137e48909",
- "summary_state": "ready",
- "summary": "Maps legacy vague verbs to concrete verbs to maintain consistency in the graph's relationships.",
- "crux": {
- "code": "export function normalizeRelation(rel: string): string {\n return NORMALIZE_RELATION[rel] ?? rel;\n}",
- "span": "L56-L58"
- }
- },
- {
- "id": "src/viz/assemble.ts#VizEdge",
- "name": "VizEdge",
- "kind": "interface",
- "path": "src/viz/assemble.ts",
- "span": "L26-L31",
- "signature": "interface VizEdge",
- "exported": true,
- "origin": "ast",
- "body_hash": "bef3aefe267d463b0d4cf617f379adadd4fffb539e9a0a5e240520be60a191cb",
- "summary_state": "ready",
- "summary": "Defines the structure of an edge in the visualization graph, representing relationships between nodes.",
- "crux": null
- },
- {
- "id": "src/viz/assemble.ts#VizGraph",
- "name": "VizGraph",
- "kind": "interface",
- "path": "src/viz/assemble.ts",
- "span": "L33-L42",
- "signature": "interface VizGraph",
- "exported": true,
- "origin": "ast",
- "body_hash": "7edd9c49c11acc8e90963256a92ee2f27415c50446334924e2e260b715b56427",
- "summary_state": "ready",
- "summary": "Encapsulates the complete visualization graph, including metadata about nodes and edges.",
- "crux": null
- },
- {
- "id": "src/viz/assemble.ts#VizNode",
- "name": "VizNode",
- "kind": "interface",
- "path": "src/viz/assemble.ts",
- "span": "L18-L24",
- "signature": "interface VizNode",
- "exported": true,
- "origin": "ast",
- "body_hash": "ec19a79898c594e5afc405cab037fcc0c43144c5766af8a955dccda7df733ba6",
- "summary_state": "ready",
- "summary": "Defines the structure of a node in the visualization graph, encapsulating its identity and attributes.",
- "crux": null
- },
- {
- "id": "src/viz/serve.ts",
- "name": "serve.ts",
- "kind": "file",
- "path": "src/viz/serve.ts",
- "span": "L1-L149",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "14283762f454c01fc95cfbe9c2b41ef063fc17c4c3e5d120b5dc7f66f541fc1c",
- "chars": 4909,
- "summary_state": "ready",
- "summary": "This file implements a local server for serving a viewer and handling API requests related to context and code graphs.",
- "crux": {
- "code": " const server = createServer((req, res) => {\n const path = (req.url ?? \"/\").split(\"?\")[0];\n\n const asset = STATIC_FILES[path];\n if (asset) {\n const file = join(opts.viewerDir, asset.file);\n if (!existsSync(file)) {\n res.writeHead(404, { \"content-type\": \"text/plain\" });\n res.end(\"viewer bundle missing — run the package build\");\n return;\n }\n res.writeHead(200, { \"content-type\": asset.type });",
- "span": "L60-L71"
- }
- },
- {
- "id": "src/viz/serve.ts#listen",
- "name": "listen",
- "kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L43-L55",
- "signature": "function listen(server: Server, port: number): Promise<boolean>",
- "exported": false,
- "origin": "ast",
- "body_hash": "b43a357dceb98a6eb6676409503021e6e38f13d7d442d44ba819dda0c0ea6246",
- "summary_state": "ready",
- "summary": "Attempts to bind the server to a specified port, handling errors if the port is in use.",
- "crux": {
- "code": " return new Promise((resolve, reject) => {\n const onError = (err: NodeJS.ErrnoException) => {\n if (err.code === \"EADDRINUSE\") resolve(false);\n else reject(err);\n };\n server.once(\"error\", onError);\n server.listen(port, \"127.0.0.1\", () => {\n server.removeListener(\"error\", onError);\n resolve(true);\n });",
- "span": "L44-L53"
- }
- },
- {
- "id": "src/viz/serve.ts#listen.onError",
- "name": "onError",
- "kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L45-L48",
- "signature": "onError = (err: NodeJS.ErrnoException)",
- "exported": false,
- "origin": "ast",
- "body_hash": "6643919e3ea413fc58afe100fe65dc3beccadb7aa66bf5d3247e072c83d9d000",
- "summary_state": "ready",
- "summary": "Handles errors that occur when trying to bind the server to a port.",
- "crux": null
- },
- {
- "id": "src/viz/serve.ts#sendJson",
- "name": "sendJson",
- "kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L38-L41",
- "signature": "function sendJson(res: ServerResponse, status: number, body: unknown): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "a2b33c898c929db2715116f964722f5e438e61a58fdfa4607d21c4365df5da6a",
- "summary_state": "ready",
- "summary": "Sends a JSON response with the specified status and body to the client.",
- "crux": {
- "code": " res.writeHead(status, { \"content-type\": \"application/json; charset=utf-8\" });\n res.end(JSON.stringify(body));\n}",
- "span": "L39-L41"
- }
- },
- {
- "id": "src/viz/serve.ts#startVizServer",
- "name": "startVizServer",
- "kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L57-L148",
- "signature": "async function startVizServer(opts: VizServerOptions): Promise<VizServer>",
- "exported": true,
- "origin": "ast",
- "body_hash": "d652f8a8b5ea738a1ff68592d9644525dee438568c9158e5edffe536b1f1aa16",
- "summary_state": "ready",
- "summary": "Initializes and starts the visualization server, setting up routes and handling requests.",
- "crux": {
- "code": " const server = createServer((req, res) => {\n const path = (req.url ?? \"/\").split(\"?\")[0];\n\n const asset = STATIC_FILES[path];\n if (asset) {\n const file = join(opts.viewerDir, asset.file);\n if (!existsSync(file)) {\n res.writeHead(404, { \"content-type\": \"text/plain\" });\n res.end(\"viewer bundle missing — run the package build\");\n return;\n }\n res.writeHead(200, { \"content-type\": asset.type });",
- "span": "L60-L71"
- }
- },
- {
- "id": "src/viz/serve.ts#startVizServer.close",
- "name": "close",
- "kind": "method",
- "path": "src/viz/serve.ts",
- "span": "L140-L146",
- "signature": "close(): Promise<void>",
- "exported": true,
- "origin": "ast",
- "body_hash": "69dc0089d8f1d6e843c8add8fabf2e120fd1045505f9c15632ba93bdc58c01d4",
- "summary_state": "ready",
- "summary": "Closes the visualization server and cleans up resources.",
- "crux": {
- "code": " close(): Promise<void> {\n clearTimeout(debounce);\n watcher?.close();\n for (const client of sseClients) client.end();\n sseClients.clear();\n return new Promise((resolve, reject) => server.close((err) => (err ? reject(err) : resolve())));\n },",
- "span": "L140-L146"
- }
- },
- {
- "id": "src/viz/serve.ts#VizServer",
- "name": "VizServer",
- "kind": "interface",
- "path": "src/viz/serve.ts",
- "span": "L23-L26",
- "signature": "interface VizServer",
- "exported": true,
- "origin": "ast",
- "body_hash": "9c56587daccba8982a5f5da3a0ea5f185becea8c4f4927331b15117f5d456214",
- "summary_state": "ready",
- "summary": "Represents the visualization server with its URL and a method to close it.",
- "crux": null
- },
- {
- "id": "src/viz/serve.ts#VizServerOptions",
- "name": "VizServerOptions",
- "kind": "interface",
- "path": "src/viz/serve.ts",
- "span": "L16-L21",
- "signature": "interface VizServerOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "0b439484269a73c19df0d658113fbdc889c2214d1081e08d92bc86ae99e0c795",
- "summary_state": "ready",
- "summary": "Defines the configuration options required to start the visualization server.",
- "crux": null
- },
- {
- "id": "test/ask-fusion.test.ts",
- "name": "ask-fusion.test.ts",
- "kind": "file",
- "path": "test/ask-fusion.test.ts",
- "span": "L1-L205",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "8b7bdc7a4f93f89f5d0ffacba11f469fb78c7f6014c4b1fa60881f099cc23724",
- "chars": 9152,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask-fusion.test.ts#makeOps",
- "name": "makeOps",
- "kind": "function",
- "path": "test/ask-fusion.test.ts",
- "span": "L132-L146",
- "signature": "function makeOps(bStrength: { coverage: number; coverageStrong: number }): ScopeRankOps",
- "exported": false,
- "origin": "ast",
- "body_hash": "ab84135bc48243ccbf2d7dd8f433f7622673568b677071d5e5a758f376c0b50a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask-fusion.test.ts#scopeDocs",
- "name": "scopeDocs",
- "kind": "function",
- "path": "test/ask-fusion.test.ts",
- "span": "L21-L23",
- "signature": "function scopeDocs(scope: string, scores: number[]): ScopedDoc[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "8d5a6b8359ac99c0090d6fe289ac6046438586342fae817aafd18bee03eb130d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask-index.test.ts",
- "name": "ask-index.test.ts",
- "kind": "file",
- "path": "test/ask-index.test.ts",
- "span": "L1-L378",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "c9cd7c011ebd661f35488c59dcd34801079f2786d56e96833f4da7c45dfa37d7",
- "chars": 16112,
- "summary_state": "ready",
- "summary": "This file contains tests to ensure the integrity and correctness of the `ask` sidecar functionality, verifying that it accurately reproduces live tokenization results and handles various edge cases without failure.",
- "crux": null
- },
- {
- "id": "test/ask-index.test.ts#makeFixture",
- "name": "makeFixture",
- "kind": "function",
- "path": "test/ask-index.test.ts",
- "span": "L26-L50",
- "signature": "function makeFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c90c21864f82921d79c49a3ab3b523d234323a0850a634de37d08abced8fd0f8",
- "summary_state": "ready",
- "summary": "Creates a temporary multi-file fixture with overlapping vocabulary to facilitate meaningful tests on tokenization and scoring.",
- "crux": {
- "code": "function makeFixture(): string {\n const dir = mkdtempSync(join(tmpdir(), \"graft-ask-index-\"));\n writeFileSync(\n join(dir, \"auth.ts\"),\n `/** Validate an incoming API request's auth token. */\\n` +\n `export function validateAuthToken(token: string): boolean {\\n` +\n ` return token.length > 0;\\n` +\n `}\\n\\n` +\n `export function authMiddleware(req: unknown): boolean {\\n` +\n ` return validateAuthToken(\"x\");\\n` +\n `}\\n`,\n );",
- "span": "L26-L37"
- }
- },
- {
- "id": "test/ask-index.test.ts#reinjectBodyText",
- "name": "reinjectBodyText",
- "kind": "function",
- "path": "test/ask-index.test.ts",
- "span": "L69-L85",
- "signature": "function reinjectBodyText(dir: string, outDir: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "dd2e01921c74775b79f94544f814554415656ca604983fbcd14b10a0fea1a6b0",
- "summary_state": "ready",
- "summary": "Reconstructs the body text for nodes in the wiring.json to ensure accurate tokenization results during tests.",
- "crux": {
- "code": " const wpath = wiringPath(outDir);\n const graph = JSON.parse(readFileSync(wpath, \"utf8\")) as GraphV1;\n const bodyById = new Map<string, string>();\n for (const entry of readdirSync(dir)) {\n const lang = languageOf(entry);\n if (!lang) continue;\n const source = readFileSync(join(dir, entry), \"utf8\");\n const { nodes } = extractFile(entry, source, lang);\n for (const n of nodes) if (n.body_text !== undefined) bodyById.set(n.id, n.body_text);\n }\n for (const n of graph.nodes as NodeV1[]) {\n const bt = bodyById.get(n.id);",
- "span": "L70-L81"
- }
- },
- {
- "id": "test/ask-index.test.ts#sortPairs",
- "name": "sortPairs",
- "kind": "function",
- "path": "test/ask-index.test.ts",
- "span": "L106-L106",
- "signature": "sortPairs = (p: [string, number][])",
- "exported": false,
- "origin": "ast",
- "body_hash": "67de2733865dd8e5d635892fb085c3781a9a541c49ad2d112c8c150aaef655b6",
- "summary_state": "ready",
- "summary": "Sorts an array of pairs by the first element, ensuring consistent ordering for comparison in tests.",
- "crux": {
- "code": " const sortPairs = (p: [string, number][]) => [...p].sort((a, b) => a[0].localeCompare(b[0]));",
- "span": "L106-L106"
- }
- },
- {
- "id": "test/ask.test.ts",
- "name": "ask.test.ts",
- "kind": "file",
- "path": "test/ask.test.ts",
- "span": "L1-L732",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "9893d94a042010c980dfa7b7d501f4fbcaf683688b7fe57a3a03f85dd956bc82",
- "chars": 33273,
- "summary_state": "stale",
- "summary": "Contains tests for the `ask` functionality, validating its behavior with various options and scenarios.",
- "crux": {
- "code": "test(\"ask without source returns pointers but no inlined code\", async () => {\n const dir = makeFixture();\n try {\n await buildGraph(dir); // $0, structure-only — cards + wiring.json\n const r = ask(dir, \"addNumbers\");\n const hit = r.hits.find((h) => h.title.startsWith(\"addNumbers\"));\n assert.ok(hit, \"should locate the addNumbers symbol\");\n assert.match(hit.pointer, /^math\\.ts:L\\d+-L\\d+$/);\n assert.equal(hit.code, undefined, \"no source inlined without the option\");\n } finally {\n rmSync(dir, { recursive: true, force: true });\n }",
- "span": "L27-L38"
- }
- },
- {
- "id": "test/ask.test.ts#crossSeamMonorepoFixture",
- "name": "crossSeamMonorepoFixture",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L346-L387",
- "signature": "function crossSeamMonorepoFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "7be30ecd7e20efc11b1384a9ca617411a1bf6f4c833048cb31e78880bcb2808a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask.test.ts#duplicateNameFixture",
- "name": "duplicateNameFixture",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L636-L651",
- "signature": "function duplicateNameFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "65d26c7671c925c41a2a09cad0036295c2ad65006b7f1a58c0c460bed2b31ddd",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask.test.ts#idfShiftFixture",
- "name": "idfShiftFixture",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L451-L462",
- "signature": "function idfShiftFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "8a01704e38cec0ac645d0230c648b406a620aabb1cb504882c8badcb533027e3",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask.test.ts#makeFixture",
- "name": "makeFixture",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L17-L26",
- "signature": "function makeFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "2782fc6b3f2efa27b0c0195482a4b138e1ec02bd16da279313966e96a6d807e8",
- "summary_state": "ready",
- "summary": "Creates a temporary directory with a sample TypeScript file for testing purposes.",
- "crux": {
- "code": " const dir = mkdtempSync(join(tmpdir(), \"graft-ask-\"));\n writeFileSync(\n join(dir, \"math.ts\"),\n `export function addNumbers(a: number, b: number): number {\\n` +\n ` return a + b;\\n` +\n `}\\n`,\n );\n return dir;",
- "span": "L16-L23"
- }
- },
- {
- "id": "test/ask.test.ts#multiScopeFixture",
- "name": "multiScopeFixture",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L277-L310",
- "signature": "function multiScopeFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "861ae2479922824311b7da16753f6517024cd4f5989bc02070ca3ec7d0270cf2",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask.test.ts#qualifiedFixture",
- "name": "qualifiedFixture",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L190-L208",
- "signature": "function qualifiedFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "9d1086ae8f0a6226d68cdbf7006c21e891972897ebe7510d188f913958306ca2",
- "summary_state": "ready",
- "summary": "Sets up a temporary directory with a cache implementation to test structural resolution of function calls.",
- "crux": {
- "code": " `export function loadItem(key: string): string {\\n` +\n ` const c = new Cache();\\n` +\n ` return c.get(key);\\n` +",
- "span": "L198-L200"
- }
- },
- {
- "id": "test/ask.test.ts#rankOf",
- "name": "rankOf",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L469-L469",
- "signature": "rankOf = (r: ReturnType<typeof ask>[\"hits\"], title: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "c03a498c384ff31544d9daa078d91655c746bfcf8f10830ad1e4f0f720e14717",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask.test.ts#siblingPrefixFixture",
- "name": "siblingPrefixFixture",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L417-L424",
- "signature": "function siblingPrefixFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c852d824057f313b5bb59d469c1e04b442dc6b8a3f15e5643e8edbb98c0504f1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask.test.ts#stampCrux",
- "name": "stampCrux",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L44-L50",
- "signature": "function stampCrux(dir: string, code: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "88e65ff2cd0c7e96135c81d1072a15b210a7b2ddad022394ea8f59f6842dcbf4",
- "summary_state": "ready",
- "summary": "Updates the wiring.json file to include a crux for the specified node, allowing for inlined source retrieval.",
- "crux": {
- "code": " n.crux = { code, span: \"L2-L2\" };",
- "span": "L47-L47"
- }
- },
- {
- "id": "test/claude-format.test.ts",
- "name": "claude-format.test.ts",
- "kind": "file",
- "path": "test/claude-format.test.ts",
- "span": "L1-L161",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "3e8f24e9e4e930bbd45cd7bc306bc465ddc872e838803b7bbd0c634247d246f3",
- "chars": 7825,
- "summary_state": "stale",
- "summary": "This test suite verifies the functionality of various formatting and retrieval functions related to the status line and enriched segments in a codebase, ensuring correct rendering based on different states and inputs.",
- "crux": {
- "code": "test('not-built state', () => {\n const lines = renderStatusline(null, null, { ctxPct: null });\n assert.match(strip(lines[0]), /not built/);\n});\n\ntest('enriched segment hidden when zero ready', () => {\n assert.equal(enrichedSegment({ ...emptyStats(), totalCount: 10, readyCount: 0 }), null);\n});\n\ntest('enriched segment shown when >=1 ready', () => {\n const seg = enrichedSegment({ ...emptyStats(), totalCount: 4, readyCount: 2 });\n assert.equal(strip(seg!), '50% enriched');",
- "span": "L8-L19"
- }
- },
- {
- "id": "test/claude-format.test.ts#freshSession",
- "name": "freshSession",
- "kind": "function",
- "path": "test/claude-format.test.ts",
- "span": "L105-L105",
- "signature": "freshSession = ()",
- "exported": false,
- "origin": "ast",
- "body_hash": "61509362f702d01df4dfd7777521ae04e30c0dbc1656070024e4712c763314ee",
- "summary_state": "ready",
- "summary": "Initializes a fresh session state for testing the relevant retrieval process.",
- "crux": {
- "code": "const freshSession = () => ({ lastQuery: null, perAgentQuery: {}, graftReads: 0, sourceReads: 0, savedTokens: 0, injectedPointers: [] as string[] });",
- "span": "L105-L105"
- }
- },
- {
- "id": "test/claude-format.test.ts#gateAsk",
- "name": "gateAsk",
- "kind": "function",
- "path": "test/claude-format.test.ts",
- "span": "L97-L104",
- "signature": "gateAsk = (over: Record<string, unknown> = {})",
- "exported": false,
- "origin": "ast",
- "body_hash": "34d03c21985709ffe94de675b861d213c0d38d4794d221e1dd41f634f1837117",
- "summary_state": "ready",
- "summary": "Creates a structured query object for testing relevant retrieval functionality with customizable parameters.",
- "crux": {
- "code": "const gateAsk = (over: Record<string, unknown> = {}) => ({\n query: 'pkce', mode: 'lexical', coverage: 1,\n hits: [\n { kind: 'symbol', title: 'verify', pointer: 'src/pkce.ts:L1-L4', snippet: 's', score: 1 },\n { kind: 'symbol', title: 'gen', pointer: 'src/pkce.ts:L6-L9', snippet: 's', score: 0.8 },\n ],\n ...over,\n}) as any;",
- "span": "L97-L104"
- }
- },
- {
- "id": "test/claude-format.test.ts#strip",
- "name": "strip",
- "kind": "function",
- "path": "test/claude-format.test.ts",
- "span": "L6-L6",
- "signature": "strip = (s: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "6381d72b2af2fa01d40d5fa8e463da782c5fe5655ad06caec8a3184ee6546edc",
- "summary_state": "ready",
- "summary": "Removes ANSI escape codes from a string to ensure clean output for assertions.",
- "crux": {
- "code": "const strip = (s: string) => s.replace(/\\x1b\\[[0-9;]*m/g, '');",
- "span": "L6-L6"
- }
- },
- {
- "id": "test/claude-hooks.test.ts",
- "name": "claude-hooks.test.ts",
- "kind": "file",
- "path": "test/claude-hooks.test.ts",
- "span": "L1-L443",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "062187284e1e6fe9bd51da4a3adad6cf8d9c7b1d94c332c9234abf159ab105af",
- "chars": 19625,
- "summary_state": "stale",
- "summary": "This file contains tests for the functionality of the graft hooks in the Claude project, ensuring that edits are detected and state is managed correctly.",
- "crux": {
- "code": "test('underGraft detects edits inside graft/', () => {\n assert.equal(underGraft('/repo', '/repo/graft/x.md'), true);\n assert.equal(underGraft('/repo', '/repo/src/cli.ts'), false);\n});\n\ntest('post-edit marks dirty and records lastFile', async () => {\n const d = mkdtempSync(join(tmpdir(), 'graft-hooks-'));\n mkdirSync(join(d, 'graft', '.graph'), { recursive: true });\n writeFileSync(join(d, 'graft', '.graph', 'wiring.json'),\n JSON.stringify({ meta: { nodeCount: 0, edgeCount: 0, languages: [] }, nodes: [], edges: [] }));\n // graft check will fail (no dist/cli.js here) → staleCount falls back to 0, but dirty must still be set.\n process.env.CLAUDE_PROJECT_DIR = d;",
- "span": "L11-L22"
- }
- },
- {
- "id": "test/claude-hooks.test.ts#fakeBuild",
- "name": "fakeBuild",
- "kind": "function",
- "path": "test/claude-hooks.test.ts",
- "span": "L85-L88",
- "signature": "fakeBuild = (dir: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "0eb606c28f6d7ec57d7fe9a9824b87942c0682ddb75d37fd911508366e5ac9e5",
- "summary_state": "ready",
- "summary": "This function simulates a build process by writing a mock wiring.json file to the specified directory, allowing tests to verify behavior based on the build output.",
- "crux": {
- "code": " const fakeBuild = (dir: string) => writeFileSync(join(dir, 'graft', '.graph', 'wiring.json'),\n JSON.stringify({ meta: { nodeCount: 2, edgeCount: 1, languages: ['typescript'] },\n nodes: [{ id: 'a', summary_state: 'ready' }, { id: 'b', summary_state: 'pending' }],\n edges: [{ from: 'a', to: 'b' }] }));",
- "span": "L84-L87"
- }
- },
- {
- "id": "test/claude-hooks.test.ts#runWithStdin",
- "name": "runWithStdin",
- "kind": "function",
- "path": "test/claude-hooks.test.ts",
- "span": "L39-L42",
- "signature": "async function runWithStdin(text: string, fn: () => Promise<void>): Promise<void>",
- "exported": false,
- "origin": "ast",
- "body_hash": "6bf4b171a46fcfcceccaedd45a273ed78fac5a1b4ae47bbd881df4e54c33b912",
- "summary_state": "ready",
- "summary": "This function sets up the environment to run a given asynchronous function with specified input from stdin, managing the environment variable for the duration of the execution.",
- "crux": {
- "code": " process.env.GRAFT_TEST_STDIN = text;\n try { await fn(); } finally { delete process.env.GRAFT_TEST_STDIN; }\n}",
- "span": "L39-L41"
- }
- },
- {
- "id": "test/claude-hooks.test.ts#writeAskArgsStub",
- "name": "writeAskArgsStub",
- "kind": "function",
- "path": "test/claude-hooks.test.ts",
- "span": "L248-L259",
- "signature": "function writeAskArgsStub(d: string): { stub: string; argsFile: string }",
- "exported": false,
- "origin": "ast",
- "body_hash": "5e40a5c4aa63815a683dbfebebf6fb64cef131890e8c7095416e29ebd9fb3d2c",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/claude-hooks.test.ts#writeMultiScopeWiring",
- "name": "writeMultiScopeWiring",
- "kind": "function",
- "path": "test/claude-hooks.test.ts",
- "span": "L127-L146",
- "signature": "function writeMultiScopeWiring(d: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "d35f1648e45126f112b8e3a573b030a0c3a2155d3c0a654de19876c7bf4c1993",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/claude-init.test.ts",
- "name": "claude-init.test.ts",
- "kind": "file",
- "path": "test/claude-init.test.ts",
- "span": "L1-L137",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "08dbd597b9b05cc11404b539ffea0f1857238e4022c81bc766554eb5c4d35ff3",
- "chars": 6268,
- "summary_state": "stale",
- "summary": "This file contains tests for the initialization logic of the graft system, ensuring that settings and skills are correctly scaffolded and managed during the initialization process.",
- "crux": {
- "code": "test('runInit scaffolds settings + both shims + the skill (build skipped)', () => {\n const d = fresh();\n const r = runInit(d, { build: false });\n assert.ok(existsSync(join(d, '.claude', 'settings.json')));\n assert.ok(existsSync(join(d, '.claude', 'helpers', 'graft-statusline.cjs')));\n assert.ok(existsSync(join(d, '.claude', 'helpers', 'graft-hooks.cjs')));\n const skillPath = join(d, '.claude', 'skills', 'graft', 'SKILL.md');\n assert.ok(existsSync(skillPath), 'writes the graft skill');\n assert.equal(r.skill, skillPath);\n assert.match(readFileSync(skillPath, 'utf8'), /name: graft/);\n assert.equal(r.built, false);\n const s = JSON.parse(readFileSync(join(d, '.claude', 'settings.json'), 'utf8'));",
- "span": "L19-L30"
- }
- },
- {
- "id": "test/claude-init.test.ts#col",
- "name": "col",
- "kind": "function",
- "path": "test/claude-init.test.ts",
- "span": "L116-L116",
- "signature": "col = (text: string, marker: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "0b37f9523b6cb61e19981676c6eea4c39d624029fbc06e88392bb90dec866d68",
- "summary_state": "ready",
- "summary": "Determines the column alignment for specific text markers in the output, ensuring consistent formatting in the display.",
- "crux": {
- "code": " const col = (text: string, marker: string) => text.split('\\n').find((l) => l.includes(marker))!.indexOf('a new session');",
- "span": "L116-L116"
- }
- },
- {
- "id": "test/claude-init.test.ts#fresh",
- "name": "fresh",
- "kind": "function",
- "path": "test/claude-init.test.ts",
- "span": "L10-L10",
- "signature": "function fresh(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "e730884fcd6a9cadcca1e8a2f33564442c1ea4a2d1589c56af4b51b6de23d940",
- "summary_state": "ready",
- "summary": "Creates a fresh temporary directory for testing purposes, ensuring isolation between test runs.",
- "crux": {
- "code": "function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-init-')); }",
- "span": "L10-L10"
- }
- },
- {
- "id": "test/claude-init.test.ts#runPostinstall",
- "name": "runPostinstall",
- "kind": "function",
- "path": "test/claude-init.test.ts",
- "span": "L12-L17",
- "signature": "function runPostinstall(env: Record<string, string>): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "a9ee9b51b2acd9ee930e28e5c0968dc94c648d848eac513230143d3acadae7e7",
- "summary_state": "ready",
- "summary": "Executes the post-installation script, which sets up necessary configurations after the main initialization process.",
- "crux": {
- "code": "function runPostinstall(env: Record<string, string>): string {\n try {\n return execFileSync(process.execPath, ['scripts/postinstall.mjs'],\n { encoding: 'utf8', env: { ...process.env, ...env } });\n } catch { return ''; }",
- "span": "L12-L16"
- }
- },
- {
- "id": "test/claude-paths.test.ts",
- "name": "claude-paths.test.ts",
- "kind": "file",
- "path": "test/claude-paths.test.ts",
- "span": "L1-L24",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "205740f8110e72e4cb24652c09f763fad5e056dc77776bcfa95a1953731ed2c8",
- "chars": 1063,
- "summary_state": "ready",
- "summary": "This test file verifies that the paths for the graft CLI and Claude script are correctly resolved relative to the module structure, ensuring they are independent of the current working directory.",
- "crux": {
- "code": "test('graftCliPath is module-relative (cwd-independent) and points at a sibling cli.js', () => {\n const a = graftCliPath();\n const orig = process.cwd();\n try { process.chdir('/'); assert.equal(graftCliPath(), a, 'must not depend on cwd / project dir'); }\n finally { process.chdir(orig); }\n assert.match(a, /[/\\\\]cli\\.js$/);\n // cli.js sits one level above the claude module dir → its parent dir is src (tsx) or dist (built)\n assert.match(basename(dirname(a)), /^(src|dist)$/);\n});\n\ntest('claudeScriptPath resolves a sibling script in the claude dir (cwd-independent)', () => {\n const a = claudeScriptPath('sync-run.js');",
- "span": "L6-L17"
- }
- },
- {
- "id": "test/claude-settings-merge.test.ts",
- "name": "claude-settings-merge.test.ts",
- "kind": "file",
- "path": "test/claude-settings-merge.test.ts",
- "span": "L1-L91",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "7fed008f3dca41eb509b1978124bf3defd9fa967fa6fc0b0ce32616cb323729c",
- "chars": 4654,
- "summary_state": "stale",
- "summary": "This test suite verifies the behavior of merging Graft settings, ensuring that defaults are applied correctly, existing configurations are preserved, and no duplicates are introduced during re-initialization.",
- "crux": {
- "code": "test('empty settings gets the full Graft blocks', () => {\n const { merged, warnings } = mergeGraftSettings({});\n assert.equal(merged.statusLine.command, SL);\n assert.equal(merged.subagentStatusLine.command, SL);\n assert.ok(Array.isArray(merged.hooks.PostToolUse));\n assert.equal(merged.hooks.PostToolUse[0].matcher, 'Write|Edit|MultiEdit');\n for (const e of ['PostToolUse', 'UserPromptSubmit', 'SessionStart', 'Stop']) {\n assert.ok(merged.hooks[e][0].hooks[0].command.includes('graft-hooks.cjs'), `${e} wired`);\n }\n assert.ok(merged.footerLinksRegexes.includes('graft/[\\\\w./-]+\\\\.md'));\n assert.deepEqual(warnings, []);\n});",
- "span": "L7-L18"
- }
- },
- {
- "id": "test/claude-shim-template.test.ts",
- "name": "claude-shim-template.test.ts",
- "kind": "file",
- "path": "test/claude-shim-template.test.ts",
- "span": "L1-L34",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "f787f99fef2dc6a5ed366419fc470e8e4f825e0bc590cf3550d39e01995e7619",
- "chars": 1585,
- "summary_state": "ready",
- "summary": "This test file validates the behavior of the statusline and hooks shims to ensure they correctly parse and resolve module paths in a Node.js environment.",
- "crux": {
- "code": " const body = src.replace(/^#!.*\\n/, ''); // strip shebang for vm\n assert.doesNotThrow(() => new vm.Script(body), 'valid JS');\n\n // 1. baked dir is present as the first candidate\n assert.match(src, new RegExp(`const BAKED = \"${BAKED}\"`));\n // 2. repo node_modules via require.resolve from the project dir\n assert.match(src, /require\\.resolve\\('@nanonets\\/graft\\/package\\.json', \\{ paths: \\[base\\] \\}\\)/);\n assert.match(src, /fromPkg\\(dir\\)/);\n // 3. legacy execPath/../lib guess retained\n assert.match(src, /path\\.join\\(path\\.dirname\\(process\\.execPath\\), '\\.\\.', 'lib'\\)/);\n // 4. npm root -g catch-all, queried on demand (no on-disk cache)\n assert.match(src, /execFileSync\\('npm', \\['root', '-g'\\]/);",
- "span": "L10-L21"
- }
- },
- {
- "id": "test/claude-skill-template.test.ts",
- "name": "claude-skill-template.test.ts",
- "kind": "file",
- "path": "test/claude-skill-template.test.ts",
- "span": "L1-L25",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e3bb9465bee23b368bf6c9e79c9658d664c67c1c3da2ef0fa4b2457535c16cc2",
- "chars": 1551,
- "summary_state": "stale",
- "summary": "This test ensures that the generated skill template adheres to the expected format and contains the necessary components for functionality.",
- "crux": {
- "code": " assert.ok(src.startsWith('---\\n'), 'starts with YAML frontmatter');\n assert.match(src, /^name: graft$/m, 'declares name: graft');\n assert.match(src, /^description:/m, 'has a description');\n const body = src.split(/\\n---\\n/)[1] ?? '';\n assert.ok(body.trim().length > 0, 'has a non-empty body');\n assert.match(body, /graft ask/, 'body tells the agent to use `graft ask`');\n assert.match(body, /every occurrence/i, 'body teaches the exhaustive-task grep rule');\n assert.match(body, /graft callers/, 'body teaches the callers command');\n assert.match(body, /graft callees/, 'body teaches the callees command');\n assert.match(body, /graft impact/, 'body teaches the impact command');\n assert.match(body, /truncated/i, 'body tells the agent to follow up on truncated spans');\n assert.match(body, /graft grep/, 'body routes sweeps to graft grep');",
- "span": "L7-L18"
- }
- },
- {
- "id": "test/claude-state.test.ts",
- "name": "claude-state.test.ts",
- "kind": "file",
- "path": "test/claude-state.test.ts",
- "span": "L1-L51",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "78e6a81af7642ea788072457ea181bc626c7a8a898cfebb882ab42fed7e9dd2e",
- "chars": 1991,
- "summary_state": "ready",
- "summary": "This test suite verifies the functionality of state management, including stats and session handling, as well as lock acquisition and release mechanisms.",
- "crux": {
- "code": "test('stats round-trip and patch merge', () => {\n const d = fresh();\n assert.equal(readStats(d), null);\n writeStats(d, { ...emptyStats(), nodeCount: 319, edgeCount: 730 });\n assert.equal(readStats(d)!.nodeCount, 319);\n const patched = patchStats(d, { dirty: true, staleCount: 4 });\n assert.equal(patched.dirty, true);\n assert.equal(patched.staleCount, 4);\n assert.equal(readStats(d)!.edgeCount, 730, 'patch preserves other fields');\n});\n\ntest('session defaults and round-trip', () => {",
- "span": "L13-L24"
- }
- },
- {
- "id": "test/claude-state.test.ts#fresh",
- "name": "fresh",
- "kind": "function",
- "path": "test/claude-state.test.ts",
- "span": "L11-L11",
- "signature": "function fresh(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "49e9f70f3b52532360521760ee5e0e5c907bdf3f55d1ed2c90bb3c3e48d93cda",
- "summary_state": "ready",
- "summary": "Generates a unique temporary directory for testing purposes to ensure isolation between test cases.",
- "crux": {
- "code": "function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-state-')); }",
- "span": "L11-L11"
- }
- },
- {
- "id": "test/claude-stats.test.ts",
- "name": "claude-stats.test.ts",
- "kind": "file",
- "path": "test/claude-stats.test.ts",
- "span": "L1-L30",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "f625d026d152a65017699e37e27534043dc0af0f43ba2d3ea778bac8ddab82c3",
- "chars": 983,
- "summary_state": "ready",
- "summary": "This test file verifies the functionality of the computeStats function to ensure it accurately calculates node and edge counts, as well as the count of ready nodes from a given wiring structure.",
- "crux": {
- "code": "test('computeStats derives counts and readyCount', () => {\n const s = computeStats(wiring);\n assert.equal(s.nodeCount, 3);\n assert.equal(s.edgeCount, 2);\n assert.deepEqual(s.languages, ['typescript']);\n assert.equal(s.totalCount, 3);\n assert.equal(s.readyCount, 2);",
- "span": "L15-L21"
- }
- },
- {
- "id": "test/claude-statusline.test.ts",
- "name": "claude-statusline.test.ts",
- "kind": "file",
- "path": "test/claude-statusline.test.ts",
- "span": "L1-L48",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "07128b5b195af3a37c1e170a35c18378e36160d1a6f8e17be362bac315811cac",
- "chars": 2137,
- "summary_state": "ready",
- "summary": "This file contains tests for the resolveStats function, ensuring it correctly retrieves and prioritizes cached statistics or falls back to graph data as needed.",
- "crux": {
- "code": "test('resolveStats returns the hook-maintained cache when present and non-empty', () => {\n const d = repo();\n writeStats(d, { ...emptyStats(), nodeCount: 5, edgeCount: 9, dirty: true, staleCount: 2 });\n const s = resolveStats(d)!;\n assert.equal(s.nodeCount, 5);\n assert.equal(s.dirty, true, 'cache is the source of truth when present');\n});\n\ntest('resolveStats falls back to wiring.json when no cache (manual graft build / fresh checkout)', () => {\n const d = repo();\n writeWiring(d, {\n meta: { nodeCount: 42, edgeCount: 100, languages: ['typescript'] },",
- "span": "L15-L26"
- }
- },
- {
- "id": "test/claude-statusline.test.ts#repo",
- "name": "repo",
- "kind": "function",
- "path": "test/claude-statusline.test.ts",
- "span": "L9-L9",
- "signature": "function repo(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "121eb027efad697b8021b3a994a7f977441a0a34c0e92fd9a1792851368850e5",
- "summary_state": "ready",
- "summary": "Creates a temporary directory for testing purposes, ensuring a clean environment for each test run.",
- "crux": {
- "code": "function repo(): string { return mkdtempSync(join(tmpdir(), 'graft-sl-')); }",
- "span": "L9-L9"
- }
- },
- {
- "id": "test/claude-statusline.test.ts#writeWiring",
- "name": "writeWiring",
- "kind": "function",
- "path": "test/claude-statusline.test.ts",
- "span": "L10-L13",
- "signature": "function writeWiring(dir: string, obj: unknown): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "2e1f37e4395b142a5e04d343c3d72366ed3c3245acc13afc8eef46df21b1df21",
- "summary_state": "ready",
- "summary": "Writes a wiring.json file to a specified directory, setting up the necessary structure for graph data in tests.",
- "crux": {
- "code": "function writeWiring(dir: string, obj: unknown): void {\n mkdirSync(join(dir, 'graft', '.graph'), { recursive: true });\n writeFileSync(join(dir, 'graft', '.graph', 'wiring.json'), JSON.stringify(obj));",
- "span": "L10-L12"
- }
- },
- {
- "id": "test/cli-meta.test.ts",
- "name": "cli-meta.test.ts",
- "kind": "file",
- "path": "test/cli-meta.test.ts",
- "span": "L1-L81",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e7a05bf838e876a317276f94a26d92b0b1526e1ea7eabda4e68b804bdb0334e5",
- "chars": 3338,
- "summary_state": "ready",
- "summary": "This file contains tests for formatting version and upgrade reports, resolving package.json paths, reading the current version, and detecting if a script is running via npx, ensuring correct behavior of the CLI meta functionalities.",
- "crux": {
- "code": "test('formatVersionReport: up to date', () => {\n const out = formatVersionReport('0.4.4', { ok: true, version: '0.4.4' });\n assert.equal(out, 'graft 0.4.4\\nlatest on npm: 0.4.4 ✓ up to date');\n});\n\ntest('formatVersionReport: newer version available', () => {\n const out = formatVersionReport('0.4.4', { ok: true, version: '0.4.5' });\n assert.equal(out, 'graft 0.4.4\\nlatest on npm: 0.4.5 — run graft upgrade');\n});\n\ntest('formatVersionReport: offline / unreachable', () => {\n const out = formatVersionReport('0.4.4', { ok: false });",
- "span": "L16-L27"
- }
- },
- {
- "id": "test/context.test.ts",
- "name": "context.test.ts",
- "kind": "file",
- "path": "test/context.test.ts",
- "span": "L1-L213",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "126861c136d48ed6a148e50226c96ec2935c52cf83ef56fbd43392e0d271db1f",
- "chars": 7976,
- "summary_state": "ready",
- "summary": "This file contains end-to-end tests for the markdown-graph pipeline, ensuring that the initialization and checking processes work correctly with various scenarios.",
- "crux": {
- "code": "test(\"init builds one markdown node per entity, with links and a manifest\", async () => {\n const dir = makeFixture();\n try {\n const r = await buildContext(dir, buildOpts());\n // Auth Service, Token Store, Billing.\n assert.equal(r.nodes, 3);\n assert.equal(r.links, 2);\n assert.equal(r.files, 2);\n\n const ctx = join(dir, \"graft\");\n assert.ok(existsSync(join(ctx, \"auth-service.md\")));\n assert.ok(existsSync(join(ctx, \"token-store.md\")));",
- "span": "L49-L60"
- }
- },
- {
- "id": "test/context.test.ts#buildOpts",
- "name": "buildOpts",
- "kind": "function",
- "path": "test/context.test.ts",
- "span": "L45-L47",
- "signature": "function buildOpts()",
- "exported": false,
- "origin": "ast",
- "body_hash": "20ec093d8fa9dadc46af8980d9440b6824597f4cdeb74529d4d62ee38d27e52d",
- "summary_state": "ready",
- "summary": "This function generates options for building the context, including a fake model and providers.",
- "crux": null
- },
- {
- "id": "test/context.test.ts#makeFixture",
- "name": "makeFixture",
- "kind": "function",
- "path": "test/context.test.ts",
- "span": "L32-L43",
- "signature": "function makeFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "515198ac732683d4da4b920e53a0eb439ea8e0107afb22af65cc29c0e702192c",
- "summary_state": "ready",
- "summary": "This function creates a temporary directory with mock service files for testing the context building process.",
- "crux": {
- "code": " const dir = mkdtempSync(join(tmpdir(), \"ctxgraph-\"));\n writeFileSync(\n join(dir, \"auth.ts\"),\n `// [[Auth Service]] ==depends_on==> [[Token Store]]\\nexport const auth = 1;\\n`,\n );\n writeFileSync(\n join(dir, \"billing.ts\"),\n `// [[Billing]] ==uses==> [[Auth Service]]\\nexport const billing = 2;\\n`,\n );\n return dir;",
- "span": "L15-L24"
- }
- },
- {
- "id": "test/context.test.ts#runCli",
- "name": "runCli",
- "kind": "function",
- "path": "test/context.test.ts",
- "span": "L19-L30",
- "signature": "function runCli(args: string[]): { stdout: string; stderr: string; status: number }",
- "exported": false,
- "origin": "ast",
- "body_hash": "f6727f675d8cb599692eabff8675faa168c515b6cfe5d91fbc1092f31371e31f",
- "summary_state": "ready",
- "summary": "This function executes a command-line interface (CLI) command and captures its output, allowing tests to verify the behavior of the CLI under different conditions.",
- "crux": {
- "code": " const stdout = execFileSync(process.execPath, [\"--import\", \"tsx\", \"src/cli.ts\", ...args], {\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n return { stdout, stderr: \"\", status: 0 };\n } catch (err) {\n const e = err as { stdout?: string; stderr?: string; status?: number };\n return { stdout: e.stdout ?? \"\", stderr: e.stderr ?? \"\", status: e.status ?? 1 };",
- "span": "L21-L28"
- }
- },
- {
- "id": "test/covers.test.ts",
- "name": "covers.test.ts",
- "kind": "file",
- "path": "test/covers.test.ts",
- "span": "L1-L77",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "f5a75f405be1a01ad43fc806588858df3a8988fee62ad4ec024440d3f5e0fc0c",
- "chars": 3059,
- "summary_state": "ready",
- "summary": "This test suite verifies that the wiring build correctly populates the 'covers' field in concept nodes and maintains stability across builds.",
- "crux": {
- "code": "test(\"wiring build backfills covers: onto concept nodes\", async () => {\n const dir = makeFixture();\n try {\n await buildContext(dir, { model: \"fake\", ...fakeProviders() });\n await buildGraph(dir); // $0, no LLM — still writes cards + covers\n\n const fm = matter(readFileSync(join(dir, \"graft\", \"auth-service.md\"), \"utf8\")).data;\n assert.ok(Array.isArray(fm.covers), \"covers should be an array\");\n const login = fm.covers.find((c: { symbol: string }) => c.symbol === \"login\");\n assert.ok(login, \"covers should include the login function\");\n assert.equal(login.kind, \"function\");\n assert.match(login.at, /^auth\\.ts:L\\d+-L\\d+$/);",
- "span": "L26-L37"
- }
- },
- {
- "id": "test/covers.test.ts#makeFixture",
- "name": "makeFixture",
- "kind": "function",
- "path": "test/covers.test.ts",
- "span": "L16-L24",
- "signature": "function makeFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c50f4905cfffe46da829a42a2bcab6838f96a17497009a9efe7a64a98729540f",
- "summary_state": "ready",
- "summary": "Creates a temporary directory with a sample TypeScript file for testing the wiring build.",
- "crux": {
- "code": " const dir = mkdtempSync(join(tmpdir(), \"graft-covers-\"));\n writeFileSync(\n join(dir, \"auth.ts\"),\n `// [[Auth Service]] ==depends_on==> [[Token Store]]\\n` +\n `export function login(user: string): boolean {\\n return user.length > 0;\\n}\\n`,\n );\n return dir;",
- "span": "L17-L23"
- }
- },
- {
- "id": "test/graph-bindings.test.ts",
- "name": "graph-bindings.test.ts",
- "kind": "file",
- "path": "test/graph-bindings.test.ts",
- "span": "L1-L82",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "b6892b1b6982547fc67d5b0e7812a536e47018ab3e38e4eda35a0f12f24ab8db",
- "chars": 4267,
- "summary_state": "ready",
- "summary": "This file contains tests that validate the behavior of type bindings in different programming languages' code snippets.",
- "crux": {
- "code": "test(\"py: constructor assignment binds receiver type\", () => {\n const edges = callEdges(\"class A:\\n def m(self): pass\\napp = A()\\ndef f():\\n app.m()\\n\", \"python\");\n const call = edges.find((e) => e.name === \"m\" && e.viaMember);\n assert.equal(call?.recvType, \"A\");\n});\n\ntest(\"py: parameter annotation binds\", () => {\n const edges = callEdges(\"def f(app: FastAPI):\\n app.include_router()\\n\", \"python\");\n assert.equal(edges.find((e) => e.name === \"include_router\")?.recvType, \"FastAPI\");\n});\n\ntest(\"py: self binds to enclosing class; self.attr via __init__ assignment\", () => {",
- "span": "L9-L20"
- }
- },
- {
- "id": "test/graph-bindings.test.ts#callEdges",
- "name": "callEdges",
- "kind": "function",
- "path": "test/graph-bindings.test.ts",
- "span": "L5-L7",
- "signature": "function callEdges(src: string, lang: \"python\" | \"typescript\" | \"go\", file = `x.${lang === \"python\" ? \"py\" : lang === \"go\" ? \"go\" : \"ts\"}`)",
- "exported": false,
- "origin": "ast",
- "body_hash": "835bab16fc5593e4c29ca25d3accec71d790d08f8d0127043711501b6ba94e2d",
- "summary_state": "ready",
- "summary": "This function extracts call edges from source code based on the specified programming language, filtering for 'calls' relations.",
- "crux": {
- "code": " return extractFile(file, src, lang).rawEdges.filter((e) => e.relation === \"calls\");",
- "span": "L6-L6"
- }
- },
- {
- "id": "test/graph-go.test.ts",
- "name": "graph-go.test.ts",
- "kind": "file",
- "path": "test/graph-go.test.ts",
- "span": "L1-L168",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "bf11085a7edb03c00d52dca090af9c1ca4eb3cb34bb88904bbdd478171d3483d",
- "chars": 5664,
- "summary_state": "ready",
- "summary": "This file contains tests for verifying the extraction of Go code structures and their relationships in a code graph.",
- "crux": {
- "code": "test(\"Go extraction: funcs, methods, structs, interfaces, type aliases\", async () => {\n const dir = makeFixture();\n try {\n const result = await buildGraph(dir); // $0, Tier-1 only\n assert.ok(result.languages.includes(\"go\"), \"languages should include go\");\n\n const graph = readGraph(wiringPath(join(dir, \"graft\")));\n assert.ok(graph, \"wiring graph should be written\");\n\n // functions — exported by leading-uppercase\n const foo = nodeById(graph!, \"main.go#Foo\");\n assert.equal(foo?.kind, \"function\");",
- "span": "L66-L77"
- }
- },
- {
- "id": "test/graph-go.test.ts#makeFixture",
- "name": "makeFixture",
- "kind": "function",
- "path": "test/graph-go.test.ts",
- "span": "L53-L60",
- "signature": "function makeFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "76b9a9cf518c965694990ed9cbfa55da12a5eb1bdc5b662c6b0550fb038dbb04",
- "summary_state": "ready",
- "summary": "Creates a temporary Go module directory with necessary files for testing graph extraction.",
- "crux": {
- "code": " const dir = mkdtempSync(join(tmpdir(), \"graft-go-\"));\n writeFileSync(join(dir, \"go.mod\"), \"module mymod\\n\\ngo 1.21\\n\");\n writeFileSync(join(dir, \"main.go\"), MAIN_GO);\n mkdirSync(join(dir, \"pkg\", \"util\"), { recursive: true });\n writeFileSync(join(dir, \"pkg\", \"util\", \"util.go\"), UTIL_GO);\n return dir;\n}",
- "span": "L54-L60"
- }
- },
- {
- "id": "test/graph-go.test.ts#nodeById",
- "name": "nodeById",
- "kind": "function",
- "path": "test/graph-go.test.ts",
- "span": "L62-L64",
- "signature": "function nodeById(graph: GraphV1, id: string): NodeV1 | undefined",
- "exported": false,
- "origin": "ast",
- "body_hash": "7d35f3037365876a2bedd0af5973ec5cc0b3871e3bce7f310993d907ae378c67",
- "summary_state": "ready",
- "summary": "Retrieves a node from the graph by its unique identifier, facilitating graph traversal and assertions in tests.",
- "crux": null
- },
- {
- "id": "test/graph-load.test.ts",
- "name": "graph-load.test.ts",
- "kind": "file",
- "path": "test/graph-load.test.ts",
- "span": "L1-L153",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "1d283a2ff0318b7a3cd9be2b76ad3ef8a2eb4599934d37135448315c703c2c83",
- "chars": 5530,
- "summary_state": "stale",
- "summary": "This file contains tests for caching mechanisms in the graph loading functionality to improve performance by avoiding unnecessary re-parsing of files.",
- "crux": {
- "code": "test(\"loadGraphCached: two loads of an unchanged file return the same parsed object\", () => {\n const dir = fixtureDir();\n writeGraph({ version: 1, nodes: [node(\"a\")], edges: [] } as GraphV1, dir);\n __resetParseCounts();\n\n const g1 = loadGraphCached(dir);\n const g2 = loadGraphCached(dir);\n assert.ok(g1);\n assert.strictEqual(g1, g2, \"second load must reuse the cached object, not re-parse\");\n assert.equal(__parseCount.graph, 1);\n});\n",
- "span": "L52-L63"
- }
- },
- {
- "id": "test/graph-load.test.ts#bump",
- "name": "bump",
- "kind": "function",
- "path": "test/graph-load.test.ts",
- "span": "L46-L50",
- "signature": "function bump(path: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "8779dc90b4ac3a22fe19faeeb81277a8a6b3cfa975a943ea81eaae7057c8ff91",
- "summary_state": "ready",
- "summary": "Updates the modification time of a file to ensure that caching mechanisms recognize changes, preventing stale data usage.",
- "crux": {
- "code": "function bump(path: string): void {\n const st = statSync(path);\n const future = new Date(st.mtimeMs + 1000);\n utimesSync(path, future, future);\n}",
- "span": "L46-L50"
- }
- },
- {
- "id": "test/graph-load.test.ts#fixtureDir",
- "name": "fixtureDir",
- "kind": "function",
- "path": "test/graph-load.test.ts",
- "span": "L40-L42",
- "signature": "function fixtureDir(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "3f567c59fa24284eaa46cfde4904ae179e1dae786288df2256d80d65721c95c9",
- "summary_state": "ready",
- "summary": "Generates a temporary directory for use in tests, ensuring isolation and preventing interference between test cases.",
- "crux": {
- "code": "function fixtureDir(): string {\n return mkdtempSync(join(tmpdir(), \"graft-load-\"));\n}",
- "span": "L40-L42"
- }
- },
- {
- "id": "test/graph-load.test.ts#node",
- "name": "node",
- "kind": "function",
- "path": "test/graph-load.test.ts",
- "span": "L23-L38",
- "signature": "function node(id: string): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "50c83e997e60e662392960d89cc6c5b421a65cfd8c166084e4c5f3c8ea9a9bd6",
- "summary_state": "ready",
- "summary": "Creates a node representation for the graph with specified properties, facilitating the construction of graph structures in tests.",
- "crux": {
- "code": " return {\n id,\n name: id,\n kind: \"function\",\n path: `${id}.ts`,\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: id,\n summary_state: \"pending\",\n summary: null,",
- "span": "L24-L35"
- }
- },
- {
- "id": "test/graph-map.test.ts",
- "name": "graph-map.test.ts",
- "kind": "file",
- "path": "test/graph-map.test.ts",
- "span": "L1-L487",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "617c2dedc79ac3c36e7f89e095f21cf98268432f6b80d7e4afb5c18db71d33cc",
- "chars": 20498,
- "summary_state": "stale",
- "summary": "This file contains tests for the `buildRepoMap` and `formatRepoMap` functions, ensuring they correctly process and format repository data.",
- "crux": {
- "code": "test(\"buildRepoMap: totals count files, symbols, edges, and languages across the whole graph\", () => {\n const nodes = [\n fileNode(\"src/a.ts\"),\n symNode(\"src/a.ts\", \"fnA\"),\n fileNode(\"docs/readme.py\"), // deliberately mixed languages\n symNode(\"docs/readme.py\", \"fnB\"),\n ];\n const edges = [edge(\"src/a.ts#fnA\", \"docs/readme.py#fnB\")];\n const map = buildRepoMap(graphOf(nodes, edges));\n\n assert.equal(map.totals.files, 2);\n assert.equal(map.totals.symbols, 2);",
- "span": "L65-L76"
- }
- },
- {
- "id": "test/graph-map.test.ts#bigFixture",
- "name": "bigFixture",
- "kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L419-L438",
- "signature": "function bigFixture(): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "36aa3a253a2bbeb21b090b155800f0354efd0e279bcf199a768d0cd9b8f66aac",
- "summary_state": "ready",
- "summary": "Creates a large fixture graph for testing, simulating a repository with multiple directories and symbols.",
- "crux": {
- "code": "function bigFixture(): GraphV1 {\n const nodes: NodeV1[] = [];\n const edges: EdgeV1[] = [];\n const dirs = [\"alpha\", \"beta\", \"gamma\", \"delta\"];\n for (const dir of dirs) {\n for (let f = 0; f < 3; f++) {\n const path = `${dir}/file${f}.ts`;\n nodes.push(fileNode(path));\n for (let s = 0; s < 4; s++) {\n const name = `${dir}Sym${f}_${s}`;\n nodes.push(symNode(path, name));\n // Give the first symbol in each file a bunch of callers so it's a hub.",
- "span": "L240-L251"
- }
- },
- {
- "id": "test/graph-map.test.ts#edge",
- "name": "edge",
- "kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L51-L53",
- "signature": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "123ba52d4dfdf593b1dd056eb9c949165a0ba7fd06eaf374cf1bf1bd797baee8",
- "summary_state": "ready",
- "summary": "Defines a connection between two nodes in the graph, representing relationships such as function calls.",
- "crux": {
- "code": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1 {\n return { source, target, relation, confidence: \"extracted\" };\n}",
- "span": "L51-L53"
- }
- },
- {
- "id": "test/graph-map.test.ts#fileNode",
- "name": "fileNode",
- "kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L16-L31",
- "signature": "function fileNode(path: string): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "cb831beea5577f48e8bd82886ecb0467eccc24e399316f742291c59d63d580de",
- "summary_state": "ready",
- "summary": "Creates a file node representation for the graph, encapsulating file metadata for processing.",
- "crux": {
- "code": "function fileNode(path: string): NodeV1 {\n return {\n id: path,\n name: path.slice(path.lastIndexOf(\"/\") + 1),\n kind: \"file\",\n path,\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: `h${counter++}`,\n summary_state: \"pending\",",
- "span": "L16-L27"
- }
- },
- {
- "id": "test/graph-map.test.ts#graphOf",
- "name": "graphOf",
- "kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L55-L61",
- "signature": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "11c79a80294cef88be10408d30c430dbdc2440d9b80b4611d426503f279261a8",
- "summary_state": "ready",
- "summary": "Constructs a graph structure from nodes and edges, serving as the foundational data for repository mapping.",
- "crux": {
- "code": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1 {\n return {\n meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [] },\n nodes,\n edges,\n };\n}",
- "span": "L55-L61"
- }
- },
- {
- "id": "test/graph-map.test.ts#graphOfWithScopes",
- "name": "graphOfWithScopes",
- "kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L66-L70",
- "signature": "function graphOfWithScopes(nodes: NodeV1[], edges: EdgeV1[], scopes: ScopeV1[]): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "c57b4814de468dbada1d57653f382f823854b6ce72a311d8b51905362c5ac4ef",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/graph-map.test.ts#symNode",
- "name": "symNode",
- "kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L33-L49",
- "signature": "function symNode(path: string, name: string, opts: { kind?: Kind; span?: string } = {}): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "819353898b73f80877d6102fc06f582cec736379220bb864d8be47c3a5107314",
- "summary_state": "ready",
- "summary": "Generates a symbol node representation for the graph, allowing for the inclusion of function or variable symbols with associated metadata.",
- "crux": {
- "code": "function symNode(path: string, name: string, opts: { kind?: Kind; span?: string } = {}): NodeV1 {\n const id = `${path}#${name}`;\n return {\n id,\n name,\n kind: opts.kind ?? \"function\",\n path,\n span: opts.span ?? \"L1-L10\",\n signature: `${name}()`,\n exported: true,\n origin: \"ast\",\n body_hash: `h${counter++}`,",
- "span": "L33-L44"
- }
- },
- {
- "id": "test/graph-map.test.ts#twoScopeFixture",
- "name": "twoScopeFixture",
- "kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L287-L302",
- "signature": "function twoScopeFixture(): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "a3cf21a9cdddac213e8fd3e11309df1b5274b945890fd39a405a9d1d6c6c41eb",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/graph-resolve-typed.test.ts",
- "name": "graph-resolve-typed.test.ts",
- "kind": "file",
- "path": "test/graph-resolve-typed.test.ts",
- "span": "L1-L93",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "0c3760525cc61ee97de448fa26b4a5b9a3bb07c03b4acfbdf3608541b189cf81",
- "chars": 4908,
- "summary_state": "ready",
- "summary": "This test file verifies the resolution of method calls and inheritance in a graph of nodes representing code elements, ensuring correct behavior in various scenarios.",
- "crux": {
- "code": "test(\"typed member call resolves despite global name ambiguity\", () => {\n const edges = resolveEdges(NODES, [\n { source: \"t.py#test_x\", relation: \"calls\", name: \"include_router\", viaMember: true, recvType: \"FastAPI\", file: \"t.py\" },\n ]);\n const call = edges.find((e) => e.relation === \"calls\");\n assert.equal(call?.target, \"app.py#FastAPI.include_router\");\n assert.equal(call?.confidence, \"inferred\");\n});\n\ntest(\"untyped ambiguous member call still drops (regression guard)\", () => {\n const edges = resolveEdges(NODES, [\n { source: \"t.py#test_x\", relation: \"calls\", name: \"include_router\", viaMember: true, file: \"t.py\" },",
- "span": "L18-L29"
- }
- },
- {
- "id": "test/graph-resolve-typed.test.ts#n",
- "name": "n",
- "kind": "function",
- "path": "test/graph-resolve-typed.test.ts",
- "span": "L6-L10",
- "signature": "function n(id: string, kind: NodeV1[\"kind\"]): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "25448bda72366b6bf9233cc1f03e63aa5ef4e1c2253c876b7c2223db09c163fc",
- "summary_state": "ready",
- "summary": "Creates a NodeV1 object representing a code element with its associated metadata, facilitating the construction of a node graph for resolution tests.",
- "crux": {
- "code": " const name = id.includes(\"#\") ? id.split(\"#\")[1].split(\".\").pop()! : id;\n return { id, name, kind, path: id.split(\"#\")[0], span: \"L1-L1\", signature: null,\n exported: true, origin: \"ast\", body_hash: \"h\", summary_state: \"pending\", summary: null, crux: null } as NodeV1;",
- "span": "L7-L9"
- }
- },
- {
- "id": "test/graph-scopes.test.ts",
- "name": "graph-scopes.test.ts",
- "kind": "file",
- "path": "test/graph-scopes.test.ts",
- "span": "L1-L203",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "030dea9cb5a26fac262acf50101289a62655681d7dd487a3518e59a64db209d8",
- "chars": 8316,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/graph-scopes.test.ts#fx",
- "name": "fx",
- "kind": "function",
- "path": "test/graph-scopes.test.ts",
- "span": "L17-L24",
- "signature": "function fx(layout: Record<string, string>): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "8ab0bd0d4ecd0a2c1738c41a1260ab74a8f9407edaa90b444b43b8e8180058b1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/graph-scopes.test.ts#normalize",
- "name": "normalize",
- "kind": "function",
- "path": "test/graph-scopes.test.ts",
- "span": "L93-L94",
- "signature": "normalize = (prefixes: string[], siblingName: string): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "0da47baf7c1a7c14a23a56b743085bac4a9620dffbb4751e23ea705c176b3d5b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/graph-scopes.test.ts#pyFns",
- "name": "pyFns",
- "kind": "function",
- "path": "test/graph-scopes.test.ts",
- "span": "L159-L161",
- "signature": "function pyFns(n: number): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "66058beee96d43f3e99600dd019dfff7771d96c51cbefa76db334ba5a08dec6f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/graph-scopes.test.ts#run",
- "name": "run",
- "kind": "function",
- "path": "test/graph-scopes.test.ts",
- "span": "L75-L89",
- "signature": "run = (siblingName: string): string[]",
- "exported": false,
- "origin": "ast",
- "body_hash": "1ad4b6cd5889ea9fd5db15c6aa691788477f3e18a1a38d2faaa36347ef1fab0b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/graph-scopes.test.ts#tsFns",
- "name": "tsFns",
- "kind": "function",
- "path": "test/graph-scopes.test.ts",
- "span": "L155-L157",
- "signature": "function tsFns(n: number): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "3b0fd3e3016031d46b2c8e0c42d7571ad9c0abfe7656557ae90064211618503d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/graph-traverse-cli.test.ts",
- "name": "graph-traverse-cli.test.ts",
- "kind": "file",
- "path": "test/graph-traverse-cli.test.ts",
- "span": "L1-L143",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "53390c4f5cb5d2135b2d423c9b7e191abdb4897ebc29909be741cef4f0f7d81f",
- "chars": 5928,
- "summary_state": "stale",
- "summary": "This file contains tests for the CLI commands related to graph traversal, ensuring correct functionality and output for various scenarios.",
- "crux": {
- "code": "test('graft callers: happy path shows header and the caller hit', () => {\n const d = builtRepo();\n const r = runCli(['callers', 'add', d]);\n assert.equal(r.status, 0);\n assert.match(r.stdout, /add · function · src\\/math\\.ts:/);\n assert.match(r.stdout, /calls ← sub \\(src\\/math\\.ts:/);\n});\n\ntest('graft callers --json: shape matches {query, matches:[{symbol,hits}]}', () => {\n const d = builtRepo();\n const r = runCli(['callers', 'add', d, '--json']);\n assert.equal(r.status, 0);",
- "span": "L42-L53"
- }
- },
- {
- "id": "test/graph-traverse-cli.test.ts#builtRepo",
- "name": "builtRepo",
- "kind": "function",
- "path": "test/graph-traverse-cli.test.ts",
- "span": "L17-L28",
- "signature": "function builtRepo(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "8c3de9f35f0d7a39cf5bd38c0462e92cb65cb762d5285e6cd637ef423631ea43",
- "summary_state": "ready",
- "summary": "Sets up a temporary repository with a sample math module for testing CLI commands.",
- "crux": {
- "code": " 'export function add(a: number, b: number): number {\\n return a + b;\\n}\\n' +\n 'export function sub(a: number, b: number): number {\\n return add(a, -b);\\n}\\n' +\n 'export function compute(a: number, b: number): number {\\n return sub(a, b);\\n}\\n',",
- "span": "L21-L23"
- }
- },
- {
- "id": "test/graph-traverse-cli.test.ts#runCli",
- "name": "runCli",
- "kind": "function",
- "path": "test/graph-traverse-cli.test.ts",
- "span": "L30-L41",
- "signature": "function runCli(args: string[]): { stdout: string; stderr: string; status: number }",
- "exported": false,
- "origin": "ast",
- "body_hash": "3aae0bf33b1d771d8677050168cec54ed0b21cf245a4c04c715f6a520b61a7b0",
- "summary_state": "ready",
- "summary": "Executes the CLI command with given arguments and captures the output and status code.",
- "crux": {
- "code": " const stdout = execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', ...args], {\n encoding: 'utf8',\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n return { stdout, stderr: '', status: 0 };\n } catch (err) {\n const e = err as { stdout?: string; stderr?: string; status?: number };\n return { stdout: e.stdout ?? '', stderr: e.stderr ?? '', status: e.status ?? 1 };",
- "span": "L31-L38"
- }
- },
- {
- "id": "test/graph-traverse.test.ts",
- "name": "graph-traverse.test.ts",
- "kind": "file",
- "path": "test/graph-traverse.test.ts",
- "span": "L1-L277",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "9683b55f739af4afbb3840cee333eed0b1869494b66fe9cddfae1153df246947",
- "chars": 10972,
- "summary_state": "ready",
- "summary": "Contains tests for graph traversal functionalities, ensuring correct symbol resolution and edge walking behavior.",
- "crux": {
- "code": "test(\"resolveSymbol: bare name match is case-insensitive\", () => {\n const g = baseGraph();\n const matches = resolveSymbol(g, \"RENDER\");\n assert.deepEqual(matches.map((n) => n.id), [\"src/widget.ts#Widget.render\"]);\n});\n\ntest(\"resolveSymbol: qualified Class.method resolves via id suffix\", () => {\n const g = baseGraph();\n const matches = resolveSymbol(g, \"Cache.get\");\n assert.deepEqual(matches.map((n) => n.id), [\"src/cache.ts#Cache.get\"]);\n});\n",
- "span": "L70-L81"
- }
- },
- {
- "id": "test/graph-traverse.test.ts#baseGraph",
- "name": "baseGraph",
- "kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L57-L66",
- "signature": "function baseGraph(): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "6d809e9b571f2f9529bce4e42392b36e09b8bb9050633f2daaa90f202ff47bab",
- "summary_state": "ready",
- "summary": "Creates a base graph fixture used for testing symbol resolution and edge walking.",
- "crux": {
- "code": "function baseGraph(): GraphV1 {\n return graphOf(\n [cacheGet, widgetRender, otherGet, hashFn, fileNode],\n [\n edge(\"src/cache.ts\", \"src/cache.ts#Cache.get\", \"contains\"),\n edge(\"src/cache.ts#Cache.get\", \"src/widget.ts#Widget.render\", \"calls\"),\n edge(\"src/cache.ts#Cache.get\", \"npm:lodash\", \"imports\"),\n ],\n );\n}",
- "span": "L57-L66"
- }
- },
- {
- "id": "test/graph-traverse.test.ts#diamondGraph",
- "name": "diamondGraph",
- "kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L167-L179",
- "signature": "function diamondGraph(): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "5f778e8292d09729865a06efd50026df15ba7da5a5fb6980e3dd814036db0aca",
- "summary_state": "ready",
- "summary": "Constructs a diamond-shaped graph for testing the impact of nodes based on incoming edges.",
- "crux": {
- "code": "function diamondGraph(): GraphV1 {\n const X = nodeStub({ id: \"X\", name: \"X\" });\n const A = nodeStub({ id: \"A\", name: \"A\" });\n const B = nodeStub({ id: \"B\", name: \"B\" });\n const C = nodeStub({ id: \"C\", name: \"C\" });\n return {\n node: X,\n graph: graphOf(\n [X, A, B, C],\n [edge(\"A\", \"X\", \"calls\"), edge(\"B\", \"X\", \"calls\"), edge(\"C\", \"A\", \"calls\"), edge(\"C\", \"B\", \"calls\")],\n ),\n } as unknown as { node: NodeV1; graph: GraphV1 };",
- "span": "L167-L178"
- }
- },
- {
- "id": "test/graph-traverse.test.ts#edge",
- "name": "edge",
- "kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L32-L34",
- "signature": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "123ba52d4dfdf593b1dd056eb9c949165a0ba7fd06eaf374cf1bf1bd797baee8",
- "summary_state": "ready",
- "summary": "Constructs an edge between two nodes in the graph, defining their relationship type.",
- "crux": {
- "code": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1 {\n return { source, target, relation, confidence: \"extracted\" };\n}",
- "span": "L32-L34"
- }
- },
- {
- "id": "test/graph-traverse.test.ts#fileAndSymbolGraph",
- "name": "fileAndSymbolGraph",
- "kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L221-L231",
- "signature": "function fileAndSymbolGraph()",
- "exported": false,
- "origin": "ast",
- "body_hash": "8d46dcd8a65e23d4490137683c72016c5380080da91bc2cdb643dec3df6a637b",
- "summary_state": "ready",
- "summary": "Creates a graph that includes both file and symbol nodes to test their interactions in dependency resolution.",
- "crux": {
- "code": "function fileAndSymbolGraph() {\n const fileA = nodeStub({ id: \"src/a.ts\", name: \"a.ts\", kind: \"file\", path: \"src/a.ts\" });\n const helper = nodeStub({ id: \"src/a.ts#helper\", name: \"helper\", kind: \"function\", path: \"src/a.ts\" });\n const fileB = nodeStub({ id: \"src/b.ts\", name: \"b.ts\", kind: \"file\", path: \"src/b.ts\" });\n const useB = nodeStub({ id: \"src/b.ts#useB\", name: \"useB\", kind: \"function\", path: \"src/b.ts\" });\n const graph = graphOf(\n [fileA, helper, fileB, useB],\n [edge(\"src/b.ts\", \"src/a.ts\", \"imports\"), edge(\"src/b.ts#useB\", \"src/a.ts#helper\", \"calls\")],\n );\n return { fileA, helper, fileB, useB, graph };\n}",
- "span": "L221-L231"
- }
- },
- {
- "id": "test/graph-traverse.test.ts#graphOf",
- "name": "graphOf",
- "kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L36-L42",
- "signature": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "3e1c1fd8cd1838095c47e9e0e80c0dac69a49091787a166d61858315c7ee4c63",
- "summary_state": "ready",
- "summary": "Generates a graph structure from an array of nodes and edges, encapsulating metadata about the graph.",
- "crux": {
- "code": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1 {\n return {\n meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [\"ts\"] },\n nodes,\n edges,\n };\n}",
- "span": "L36-L42"
- }
- },
- {
- "id": "test/graph-traverse.test.ts#nodeStub",
- "name": "nodeStub",
- "kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L15-L30",
- "signature": "function nodeStub(partial: Partial<NodeV1> & { id: string }): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "7e4a8788936b6b4d198eb93113a428318b00f2276e01fd31d89f8c9cf3f81ccb",
- "summary_state": "ready",
- "summary": "Creates a stub node for testing purposes, encapsulating essential properties of a NodeV1 object.",
- "crux": {
- "code": "function nodeStub(partial: Partial<NodeV1> & { id: string }): NodeV1 {\n return {\n name: partial.id,\n kind: \"function\",\n path: partial.id.split(\"#\")[0],\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: partial.id,\n summary_state: \"pending\",\n summary: null,",
- "span": "L15-L26"
- }
- },
- {
- "id": "test/graph-write.test.ts",
- "name": "graph-write.test.ts",
- "kind": "file",
- "path": "test/graph-write.test.ts",
- "span": "L1-L128",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "cbbf9c3591519993ec89298444d34732f08eb16f90ba1c1cd33bd39d5512f9ff",
- "chars": 4839,
- "summary_state": "ready",
- "summary": "This file contains tests to ensure that the `writeGraph` function correctly handles the serialization of graph nodes, specifically that the `body_text` field is omitted when unnecessary, while preserving other fields and the integrity of the original node object.",
- "crux": {
- "code": "test(\"writeGraph strips body_text from the serialized node but keeps every other field\", () => {\n const dir = mkdtempSync(join(tmpdir(), \"graft-write-\"));\n try {\n const node = makeNode({ body_text: \"some searchable definition body\" });\n const graph: GraphV1 = {\n meta: { version: 1, nodeCount: 1, edgeCount: 0, languages: [\"typescript\"] },\n nodes: [node],\n edges: [],\n };\n const path = writeGraph(graph, dir);\n\n const raw = JSON.parse(readFileSync(path, \"utf8\"));",
- "span": "L37-L48"
- }
- },
- {
- "id": "test/graph-write.test.ts#makeNode",
- "name": "makeNode",
- "kind": "function",
- "path": "test/graph-write.test.ts",
- "span": "L19-L35",
- "signature": "function makeNode(overrides: Partial<NodeV1> = {}): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "41ebbf74745569c7f08bdc2d7a852617987e439975ac045b640252aa0684fc7e",
- "summary_state": "ready",
- "summary": "Creates a node object with default properties, allowing for optional overrides, to facilitate testing of graph serialization and deserialization.",
- "crux": {
- "code": " return {\n id: \"a.ts#f\",\n name: \"f\",\n kind: \"function\",\n path: \"a.ts\",\n span: \"L1-L3\",\n signature: \"f(): void\",\n exported: true,\n origin: \"ast\",\n body_hash: \"hash\",\n summary_state: \"pending\",\n summary: null,",
- "span": "L20-L31"
- }
- },
- {
- "id": "test/graphrank.test.ts",
- "name": "graphrank.test.ts",
- "kind": "file",
- "path": "test/graphrank.test.ts",
- "span": "L1-L257",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e4e6155adc501b4d336cba4ad49192310678cf67f3547e2b362bfcb68f30a53e",
- "chars": 11404,
- "summary_state": "stale",
- "summary": "This file contains unit and integration tests for the personalizedPageRank function, ensuring it correctly ranks nodes based on their connectivity in a graph.",
- "crux": {
- "code": "test(\"PageRank: a seed wired to the cluster outranks an isolated seed\", () => {\n // hub calls a, b, c; lone is a disconnected seed with equal restart weight.\n const g = graphOf(\n [\"hub\", \"a\", \"b\", \"c\", \"lone\"],\n [edge(\"hub\", \"a\"), edge(\"hub\", \"b\"), edge(\"hub\", \"c\")],\n );\n const pr = personalizedPageRank(g, new Map([[\"hub\", 1], [\"lone\", 1]]));\n assert.ok((pr.get(\"hub\") ?? 0) > (pr.get(\"lone\") ?? 0), \"connected seed beats isolated seed\");\n assert.equal([...pr.values()].some((v) => v === 1), true, \"top node normalized to 1\");\n});\n\ntest(\"PageRank: neighbours of a seed accrue mass even with zero restart weight\", () => {",
- "span": "L50-L61"
- }
- },
- {
- "id": "test/graphrank.test.ts#edge",
- "name": "edge",
- "kind": "function",
- "path": "test/graphrank.test.ts",
- "span": "L39-L41",
- "signature": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "123ba52d4dfdf593b1dd056eb9c949165a0ba7fd06eaf374cf1bf1bd797baee8",
- "summary_state": "ready",
- "summary": "Defines an edge between two nodes in the graph, establishing a relationship.",
- "crux": {
- "code": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1 {\n return { source, target, relation, confidence: \"extracted\" };\n}",
- "span": "L39-L41"
- }
- },
- {
- "id": "test/graphrank.test.ts#graphOf",
- "name": "graphOf",
- "kind": "function",
- "path": "test/graphrank.test.ts",
- "span": "L42-L48",
- "signature": "function graphOf(nodes: string[], edges: EdgeV1[]): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "bf3b5a40bcc1fa81ff40b720adeff034d332bbbb831f3e2f7528e2f667146ce1",
- "summary_state": "ready",
- "summary": "Constructs a graph object from given nodes and edges, encapsulating their relationships.",
- "crux": {
- "code": "function graphOf(nodes: string[], edges: EdgeV1[]): GraphV1 {\n return {\n meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [\"ts\"] },\n nodes: nodes.map(node),\n edges,\n };\n}",
- "span": "L42-L48"
- }
- },
- {
- "id": "test/graphrank.test.ts#makeCollisionFixture",
- "name": "makeCollisionFixture",
- "kind": "function",
- "path": "test/graphrank.test.ts",
- "span": "L182-L192",
- "signature": "function makeCollisionFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "2177edb69c1857665ec38d0fadebf5147cc7c3e71b39d026ee7f33e0c07865f8",
- "summary_state": "ready",
- "summary": "Sets up a temporary file structure to simulate a collision scenario for testing graph ranking.",
- "crux": {
- "code": "function makeCollisionFixture(): string {\n const dir = mkdtempSync(join(tmpdir(), \"graft-graphrank-\"));\n writeFileSync(\n join(dir, \"connected.ts\"),\n `export function fooHandler() {\\n helperAlpha();\\n helperBeta();\\n}\\n` +\n `export function helperAlpha() { return 1; }\\n` +\n `export function helperBeta() { return 2; }\\n`,\n );\n writeFileSync(join(dir, \"isolated.ts\"), `export function fooWidget() { return 0; }\\n`);\n return dir;\n}",
- "span": "L128-L138"
- }
- },
- {
- "id": "test/graphrank.test.ts#node",
- "name": "node",
- "kind": "function",
- "path": "test/graphrank.test.ts",
- "span": "L23-L38",
- "signature": "function node(id: string): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "50c83e997e60e662392960d89cc6c5b421a65cfd8c166084e4c5f3c8ea9a9bd6",
- "summary_state": "ready",
- "summary": "Creates a node representation for the graph with specified properties.",
- "crux": {
- "code": "function node(id: string): NodeV1 {\n return {\n id,\n name: id,\n kind: \"function\",\n path: `${id}.ts`,\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: id,\n summary_state: \"pending\",",
- "span": "L23-L34"
- }
- },
- {
- "id": "test/graphrank.test.ts#rank",
- "name": "rank",
- "kind": "function",
- "path": "test/graphrank.test.ts",
- "span": "L194-L195",
- "signature": "rank = (dir: string, gr: boolean)",
- "exported": false,
- "origin": "ast",
- "body_hash": "5bf6fb6a4dc37b257683b4ab9b24ff4838cf94cd3404123bb383861163c4bbec",
- "summary_state": "ready",
- "summary": "Executes the ask function with specified parameters to retrieve ranked results based on graph connectivity.",
- "crux": {
- "code": "const rank = (dir: string, gr: boolean) =>\n ask(dir, \"foo\", { graphRank: gr }).hits.map((h) => h.title.split(\" ·\")[0]);",
- "span": "L140-L141"
- }
- },
- {
- "id": "test/helpers.ts",
- "name": "helpers.ts",
- "kind": "file",
- "path": "test/helpers.ts",
- "span": "L1-L55",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e45af1d38d7c6d4abc804fc74e9ae4c3373cf78769c17b16b185c3ee0e2c3228",
- "chars": 2012,
- "summary_state": "ready",
- "summary": "This file provides test doubles for offline, deterministic testing of components without external dependencies.",
- "crux": null
- },
- {
- "id": "test/helpers.ts#BracketSynthesizer",
- "name": "BracketSynthesizer",
- "kind": "class",
- "path": "test/helpers.ts",
- "span": "L21-L50",
- "signature": "class BracketSynthesizer implements Synthesizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "6a30b1293990bb2dce95f1f1f77219dbcdc54eef7e6a01d0db03403f4d344bcc",
- "summary_state": "ready",
- "summary": "This class synthesizes a graph structure from simple markup, enabling tests to define the relationships between nodes explicitly.",
- "crux": {
- "code": " async synthesize(files: FileSummary[]): Promise<SynthNode[]> {\n const byName = new Map<string, { sources: Set<string>; links: Map<string, SynthLink> }>();\n const ensure = (name: string) => {\n let e = byName.get(name);\n if (!e) {\n e = { sources: new Set(), links: new Map() };\n byName.set(name, e);\n }\n return e;\n };\n for (const f of files) {\n for (const m of f.summary.matchAll(/\\[\\[([^\\]]+)\\]\\]/g)) {",
- "span": "L22-L33"
- }
- },
- {
- "id": "test/helpers.ts#BracketSynthesizer.synthesize",
- "name": "synthesize",
- "kind": "method",
- "path": "test/helpers.ts",
- "span": "L22-L49",
- "signature": "async synthesize(files: FileSummary[]): Promise<SynthNode[]>",
- "exported": true,
- "origin": "ast",
- "body_hash": "b42a19064389576a02ba334fcab8bfb5d8d985a46f995be864095e770d47e26d",
- "summary_state": "ready",
- "summary": "This method processes file summaries to create a structured representation of nodes and their relationships based on markup.",
- "crux": {
- "code": " for (const m of f.summary.matchAll(/\\[\\[([^\\]]+)\\]\\]\\s*==([a-z_]+)==>\\s*\\[\\[([^\\]]+)\\]\\]/g)) {\n const [, from, relation, to] = m;\n ensure(to.trim()).sources.add(f.path);\n ensure(from.trim()).links.set(`${to}|${relation}`, { to: to.trim(), relation });\n }",
- "span": "L36-L40"
- }
- },
- {
- "id": "test/helpers.ts#BracketSynthesizer.synthesize.ensure",
- "name": "ensure",
- "kind": "function",
- "path": "test/helpers.ts",
- "span": "L24-L31",
- "signature": "ensure = (name: string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "3b8cc65a6170766e70a5b038f9f27176e60114ce70e0e2dc1463f720ed384c4c",
- "summary_state": "ready",
- "summary": "This function ensures that a node exists in the map, creating it if necessary, to maintain the graph structure.",
- "crux": {
- "code": " const ensure = (name: string) => {\n let e = byName.get(name);\n if (!e) {\n e = { sources: new Set(), links: new Map() };\n byName.set(name, e);\n }\n return e;\n };",
- "span": "L24-L31"
- }
- },
- {
- "id": "test/helpers.ts#fakeProviders",
- "name": "fakeProviders",
- "kind": "function",
- "path": "test/helpers.ts",
- "span": "L52-L54",
- "signature": "function fakeProviders()",
- "exported": true,
- "origin": "ast",
- "body_hash": "0395bc21ba030a5d0e1fc9e5fdd0d8780c4309c87d899bedbc940f1bdcd2864f",
- "summary_state": "ready",
- "summary": "This function creates and returns instances of the test doubles for summarization and synthesis.",
- "crux": null
- },
- {
- "id": "test/helpers.ts#PassthroughSummarizer",
- "name": "PassthroughSummarizer",
- "kind": "class",
- "path": "test/helpers.ts",
- "span": "L9-L13",
- "signature": "class PassthroughSummarizer implements Summarizer",
- "exported": true,
- "origin": "ast",
- "body_hash": "43c71f9e449859d657d6cef17b80d2bb650734751530e8401c356fc963f7b012",
- "summary_state": "ready",
- "summary": "This class serves as a no-op summarizer that returns the input code unchanged for controlled testing.",
- "crux": {
- "code": " async summarize(code: string): Promise<string> {\n return code;\n }",
- "span": "L10-L12"
- }
- },
- {
- "id": "test/helpers.ts#PassthroughSummarizer.summarize",
- "name": "summarize",
- "kind": "method",
- "path": "test/helpers.ts",
- "span": "L10-L12",
- "signature": "async summarize(code: string): Promise<string>",
- "exported": true,
- "origin": "ast",
- "body_hash": "8836e78c4875dee01aeae5cb976c217cd347554542e387996b7c190b1a73af18",
- "summary_state": "ready",
- "summary": "This method returns the input code as-is, allowing tests to control the output precisely.",
- "crux": {
- "code": " async summarize(code: string): Promise<string> {\n return code;\n }",
- "span": "L10-L12"
- }
- },
- {
- "id": "test/hosts-codex-hooks.test.ts",
- "name": "hosts-codex-hooks.test.ts",
- "kind": "file",
- "path": "test/hosts-codex-hooks.test.ts",
- "span": "L1-L80",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "ed49a8a106eeb458ad2dd071071cefae17dd4d0eabd1b74006047feadef9a89a",
- "chars": 3738,
- "summary_state": "ready",
- "summary": "This test suite verifies the behavior of the installCodexHooks function, ensuring it correctly manages hook installations and configurations in various scenarios.",
- "crux": {
- "code": "test('no-op when the CLI home dir is absent', () => {\n assert.deepEqual(installCodexHooks(fresh()), []);\n});\n\ntest('writes shim + hooks.json entry, idempotent on re-run', () => {\n const home = fresh();\n mkdirSync(join(home, '.codex'), { recursive: true });\n const w = installCodexHooks(home);\n assert.equal(w.length, 2);\n const shim = join(home, '.codex', 'hooks', 'graft', 'graft-hooks.cjs');\n assert.ok(existsSync(shim));\n assert.ok(statSync(shim).mode & 0o111, 'shim is executable');",
- "span": "L10-L21"
- }
- },
- {
- "id": "test/hosts-codex-hooks.test.ts#fresh",
- "name": "fresh",
- "kind": "function",
- "path": "test/hosts-codex-hooks.test.ts",
- "span": "L8-L8",
- "signature": "function fresh(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c75405ab5617c9e32684bf0530549edf2833d88ee5e6c955308b46c9f4e14c46",
- "summary_state": "ready",
- "summary": "Generates a unique temporary directory for testing purposes.",
- "crux": null
- },
- {
- "id": "test/hosts-init.test.ts",
- "name": "hosts-init.test.ts",
- "kind": "file",
- "path": "test/hosts-init.test.ts",
- "span": "L1-L139",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "56f8988468cb716296b40c939bf58d079015d135fcb3f2c1481e64bce7f67324",
- "chars": 5922,
- "summary_state": "ready",
- "summary": "This test suite verifies the behavior of the runHostsInit function in various scenarios, ensuring it correctly handles host initialization, agent detection, and configuration management.",
- "crux": {
- "code": "test('writes only detected hosts by default', () => {\n const home = fresh(); const repo = fresh();\n mkdirSync(join(home, '.cursor'));\n const r = runHostsInit(repo, { home });\n assert.deepEqual(r.written.map((w) => w.id), ['cursor']);\n const mdc = readFileSync(join(repo, '.cursor', 'rules', 'graft.mdc'), 'utf8');\n assert.match(mdc, /alwaysApply: true/);\n assert.ok(!existsSync(join(repo, 'AGENTS.md')));\n});\n\ntest('explicit agents list overrides detection and flags unknown ids', () => {\n const home = fresh(); const repo = fresh();",
- "span": "L11-L22"
- }
- },
- {
- "id": "test/hosts-init.test.ts#fresh",
- "name": "fresh",
- "kind": "function",
- "path": "test/hosts-init.test.ts",
- "span": "L9-L9",
- "signature": "function fresh(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "9da796af39ee7c44e2c780ded8bc297fc37f854834c5ecdab7819298b3df9cce",
- "summary_state": "ready",
- "summary": "Generates a unique temporary directory for testing purposes to avoid conflicts between test runs.",
- "crux": null
- },
- {
- "id": "test/hosts-instructions.test.ts",
- "name": "hosts-instructions.test.ts",
- "kind": "file",
- "path": "test/hosts-instructions.test.ts",
- "span": "L1-L36",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "9fadc09e68320bbe16b97ee552411a4b1bcff04fbcd825201deb1103f7986528",
- "chars": 1653,
- "summary_state": "stale",
- "summary": "This test suite verifies the structure and content of various instruction bodies to ensure they meet specified formatting and inclusion criteria.",
- "crux": {
- "code": "test('canonical body names the three essentials', () => {\n const b = instructionBody();\n assert.match(b, /^## Graft — repo context graph/m);\n assert.match(b, /graft ask \"/);\n assert.match(b, /graft\\/INDEX\\.md/);\n assert.match(b, /graft build/);\n assert.match(b, /every occurrence|enumerate with grep/i, 'teaches the exhaustive-task grep rule');\n assert.match(b, /callers/, 'teaches the callers/callees/impact commands');\n assert.match(b, /truncated/i, 'tells the agent to follow up on truncated spans');\n assert.match(b, /graft grep/, 'routes sweeps to graft grep');\n assert.match(b, /graft map/, 'tells the agent to orient with graft map before exploring');\n assert.ok(!/\\bhook|statusline\\b/i.test(b), 'no host-specific machinery in the shared body');",
- "span": "L5-L16"
- }
- },
- {
- "id": "test/hosts-mcp-config.test.ts",
- "name": "hosts-mcp-config.test.ts",
- "kind": "file",
- "path": "test/hosts-mcp-config.test.ts",
- "span": "L1-L77",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "5b3ec5afd61079f051d8063f06701ddac608f48b706e72f9ee607e8da673fb06",
- "chars": 3982,
- "summary_state": "ready",
- "summary": "This test suite verifies the behavior of the registerMcpConfigs function in handling various configurations and edge cases.",
- "crux": {
- "code": "test('cursor/gemini/kiro get repo-local JSON entries', () => {\n const repo = fresh(); const home = fresh();\n const w = registerMcpConfigs(repo, ['cursor', 'gemini', 'kiro'], { home });\n assert.deepEqual(w.map((x) => x.action), ['created', 'created', 'created']);\n const cursor = JSON.parse(readFileSync(join(repo, '.cursor', 'mcp.json'), 'utf8'));\n assert.deepEqual(cursor.mcpServers.graft, { command: 'npx', args: ['-y', '@nanonets/graft', 'mcp'] });\n assert.ok(existsSync(join(repo, '.gemini', 'settings.json')));\n assert.ok(existsSync(join(repo, '.kiro', 'settings', 'mcp.json')));\n});\n\ntest('existing config keys are preserved; re-run is unchanged', () => {\n const repo = fresh(); const home = fresh();",
- "span": "L10-L21"
- }
- },
- {
- "id": "test/hosts-mcp-config.test.ts#fresh",
- "name": "fresh",
- "kind": "function",
- "path": "test/hosts-mcp-config.test.ts",
- "span": "L8-L8",
- "signature": "function fresh(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "5d57935fd93aed6bacff9481af82c74f353c4928d0c3cf15efbfa038c85dad5a",
- "summary_state": "ready",
- "summary": "Generates a fresh temporary directory for testing purposes.",
- "crux": null
- },
- {
- "id": "test/hosts-registry.test.ts",
- "name": "hosts-registry.test.ts",
- "kind": "file",
- "path": "test/hosts-registry.test.ts",
- "span": "L1-L45",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "6490cbdc54b870d670adf28b5b469e07360a474073b08d692601ef1c4b7ea47e",
- "chars": 1632,
- "summary_state": "ready",
- "summary": "This file contains tests for the hosts registry functionality, ensuring that the correct hosts are detected based on the presence of specific directories.",
- "crux": {
- "code": "test('registry exposes the six phase-1 hosts', () => {\n assert.deepEqual(hostIds().sort(), ['agents', 'copilot', 'cursor', 'gemini', 'kiro', 'windsurf']);\n for (const h of HOSTS) {\n assert.ok(h.relPath.length > 0);\n assert.ok(h.content().length > 0);\n }\n});\n\ntest('nothing detected on a bare machine and bare repo', () => {\n assert.deepEqual(detectHosts(probeFor(fresh(), fresh())), []);\n});\n",
- "span": "L17-L28"
- }
- },
- {
- "id": "test/hosts-registry.test.ts#fresh",
- "name": "fresh",
- "kind": "function",
- "path": "test/hosts-registry.test.ts",
- "span": "L15-L15",
- "signature": "function fresh(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "4b7e71149dfcf083709a98bd3f04eb92af9a722c7d567dcd4288be6119afc6ea",
- "summary_state": "ready",
- "summary": "Generates a temporary directory for testing purposes, ensuring a clean environment for each test case.",
- "crux": null
- },
- {
- "id": "test/hosts-registry.test.ts#probeFor",
- "name": "probeFor",
- "kind": "function",
- "path": "test/hosts-registry.test.ts",
- "span": "L9-L14",
- "signature": "function probeFor(home: string, repo: string): DetectProbe",
- "exported": false,
- "origin": "ast",
- "body_hash": "7653739002fda057d1517f18bfe77dfb0dcf78ab6cb9716ceb7624601eec1f7f",
- "summary_state": "ready",
- "summary": "Creates a probe object that checks for the existence of a directory, facilitating host detection based on the file system state.",
- "crux": {
- "code": " dirExists: (p) => { try { return statSync(p).isDirectory(); } catch { return false; } },\n };",
- "span": "L12-L13"
- }
- },
- {
- "id": "test/hosts-sections.test.ts",
- "name": "hosts-sections.test.ts",
- "kind": "file",
- "path": "test/hosts-sections.test.ts",
- "span": "L1-L112",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a780abe63074737d40bcd556df06b7b541d2694df75c307daabd280f64f9dba4",
- "chars": 4777,
- "summary_state": "ready",
- "summary": "This file contains tests for the upsertSection function, ensuring it correctly creates, appends, replaces, and reports on sections in markdown files.",
- "crux": {
- "code": "test('creates the file with a fenced block when missing', () => {\n const f = join(fresh(), 'AGENTS.md');\n const r = upsertSection(f, '## Graft\\nuse graft ask');\n assert.equal(r.action, 'created');\n const text = readFileSync(f, 'utf8');\n assert.ok(text.includes('<!-- graft:start -->'));\n assert.ok(text.includes('use graft ask'));\n assert.ok(text.endsWith('\\n'));\n});\n\ntest('appends after existing content, separated by a blank line', () => {\n const f = join(fresh(), 'AGENTS.md');",
- "span": "L10-L21"
- }
- },
- {
- "id": "test/hosts-sections.test.ts#fresh",
- "name": "fresh",
- "kind": "function",
- "path": "test/hosts-sections.test.ts",
- "span": "L8-L8",
- "signature": "function fresh(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "5fbf8aed98c1fd26d88217061c491d534e161b32a06df5c80d376de4eb1171a3",
- "summary_state": "ready",
- "summary": "Generates a fresh temporary directory for testing purposes.",
- "crux": null
- },
- {
- "id": "test/llm-adapters.test.ts",
- "name": "llm-adapters.test.ts",
- "kind": "file",
- "path": "test/llm-adapters.test.ts",
- "span": "L1-L216",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "53081583f9a2ef8a7f925fcce6554201fb8a10184ac835f3879cb3f04700f346",
- "chars": 8829,
- "summary_state": "ready",
- "summary": "This file contains tests for network-free adapters that simulate interactions with OpenAI and Anthropic SDKs, ensuring correct request handling and response formatting.",
- "crux": {
- "code": "test(\"openai: plain text — system/user map to strings, usage is uncached-only\", async () => {\n const { client, box } = fakeOpenAI(openAiResp());\n const m = new OpenAIChatModel({ apiKey: \"x\", model: \"gpt-x\", client });\n const res = await m.create({\n messages: [\n { role: \"system\", content: \"sys\" },\n { role: \"user\", content: \"hi\" },\n ],\n temperature: 0,\n });\n assert.equal(box.params.model, \"gpt-x\");\n assert.equal(box.params.messages[0].content, \"sys\"); // plain string, no cache parts",
- "span": "L33-L44"
- }
- },
- {
- "id": "test/llm-adapters.test.ts#anthropicResp",
- "name": "anthropicResp",
- "kind": "function",
- "path": "test/llm-adapters.test.ts",
- "span": "L127-L134",
- "signature": "function anthropicResp(over: Partial<any> = {}): any",
- "exported": false,
- "origin": "ast",
- "body_hash": "510e5ddfab3f4b864398e600e0a6a9e786c164cb2ca583e48fa5eb617305e366",
- "summary_state": "ready",
- "summary": "Generates a mock response structure for Anthropic API calls, aiding in the testing of response processing.",
- "crux": {
- "code": " content: [{ type: \"text\", text: \"hi there\" }],\n stop_reason: \"end_turn\",\n usage: { input_tokens: 70, output_tokens: 20, cache_read_input_tokens: 30, cache_creation_input_tokens: 5 },\n ...over,",
- "span": "L129-L132"
- }
- },
- {
- "id": "test/llm-adapters.test.ts#fakeAnthropic",
- "name": "fakeAnthropic",
- "kind": "function",
- "path": "test/llm-adapters.test.ts",
- "span": "L119-L125",
- "signature": "function fakeAnthropic(resp: unknown)",
- "exported": false,
- "origin": "ast",
- "body_hash": "389c2181f2f3596989f46febc959ccdb5daf6c8faf71d739e0e6341c49faa323",
- "summary_state": "ready",
- "summary": "Creates a mock Anthropic client for testing purposes, enabling verification of the parameters it receives.",
- "crux": {
- "code": " messages: { create: async (params: any) => ((box.params = params), resp) },\n } as unknown as Anthropic;",
- "span": "L122-L123"
- }
- },
- {
- "id": "test/llm-adapters.test.ts#fakeOpenAI",
- "name": "fakeOpenAI",
- "kind": "function",
- "path": "test/llm-adapters.test.ts",
- "span": "L17-L23",
- "signature": "function fakeOpenAI(resp: unknown)",
- "exported": false,
- "origin": "ast",
- "body_hash": "1df77ef154b74d8a146666026f8598c84891a3fad31a785932884d867b7348a8",
- "summary_state": "ready",
- "summary": "Creates a mock OpenAI client for testing purposes, allowing assertions on the parameters sent to it.",
- "crux": {
- "code": " chat: { completions: { create: async (params: any) => ((box.params = params), resp) } },\n } as unknown as OpenAI;",
- "span": "L20-L21"
- }
- },
- {
- "id": "test/llm-adapters.test.ts#openAiResp",
- "name": "openAiResp",
- "kind": "function",
- "path": "test/llm-adapters.test.ts",
- "span": "L25-L31",
- "signature": "function openAiResp(over: Partial<any> = {}): any",
- "exported": false,
- "origin": "ast",
- "body_hash": "97c63c00348e9d80c2ddccf50e21e28de7379123cdc570757b21857c67364268",
- "summary_state": "ready",
- "summary": "Generates a mock response structure for OpenAI API calls, facilitating the testing of response handling.",
- "crux": {
- "code": " choices: [{ message: { content: \"hello\", tool_calls: [] }, finish_reason: \"stop\" }],\n usage: { prompt_tokens: 100, completion_tokens: 20, prompt_tokens_details: { cached_tokens: 30 } },\n ...over,\n };",
- "span": "L27-L30"
- }
- },
- {
- "id": "test/llm-ops.test.ts",
- "name": "llm-ops.test.ts",
- "kind": "file",
- "path": "test/llm-ops.test.ts",
- "span": "L1-L82",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "ef3ba575506602feeb3048a6bded8bd2a92e9a59054c569352e82d1a847b80af",
- "chars": 3303,
- "summary_state": "ready",
- "summary": "Tests the behavior of three engine operations (summarize, synthesize, crux) using a fake transport to ensure they build the correct requests and handle responses appropriately.",
- "crux": {
- "code": "test(\"ChatSummarizer sends plain text and returns trimmed content\", async () => {\n const m = new FakeChatModel({ text: \" a prose summary \" });\n const out = await new ChatSummarizer(m).summarize(\"code\", { path: \"a.ts\" });\n assert.equal(out, \"a prose summary\");\n assert.equal(m.last?.responseFormat, undefined); // plain text\n assert.equal(m.last?.messages[0].role, \"system\");\n});\n\ntest(\"ChatSynthesizer forces record_graph and cleans parsed args\", async () => {\n const m = new FakeChatModel({\n toolCalls: [\n {",
- "span": "L31-L42"
- }
- },
- {
- "id": "test/llm-ops.test.ts#FakeChatModel",
- "name": "FakeChatModel",
- "kind": "class",
- "path": "test/llm-ops.test.ts",
- "span": "L15-L29",
- "signature": "class FakeChatModel implements ChatModel",
- "exported": false,
- "origin": "ast",
- "body_hash": "eda253622c2c5165804dbff88e4833ec0cfd0f45f9326916108aae84f2932905",
- "summary_state": "ready",
- "summary": "Simulates a chat model to test the behavior of chat operations without network dependency.",
- "crux": {
- "code": " this.last = req;\n return {\n text: this.reply.text ?? \"\",\n toolCalls: this.reply.toolCalls ?? [],\n usage: { input: 0, output: 0, cacheRead: 0, cacheCreate: 0 },\n stopReason: \"stop\",\n assistant: { role: \"assistant\", content: this.reply.text ?? \"\" },\n };",
- "span": "L20-L27"
- }
- },
- {
- "id": "test/llm-ops.test.ts#FakeChatModel.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "test/llm-ops.test.ts",
- "span": "L18-L18",
- "signature": "constructor(private reply: { text?: string; toolCalls?: ToolCall[] })",
- "exported": false,
- "origin": "ast",
- "body_hash": "edce87b8798c8e867446b2b7970f4c97f1f8eba762255e690daea9453d10e630",
- "summary_state": "ready",
- "summary": "Initializes the fake chat model with a predefined reply for testing purposes.",
- "crux": null
- },
- {
- "id": "test/llm-ops.test.ts#FakeChatModel.create",
- "name": "create",
- "kind": "method",
- "path": "test/llm-ops.test.ts",
- "span": "L19-L28",
- "signature": "async create(req: ChatRequest): Promise<ChatResponse>",
- "exported": false,
- "origin": "ast",
- "body_hash": "e90179ccabec3472e4184b3a1147383e87c3de3f42b8757304dbb33b36547488",
- "summary_state": "ready",
- "summary": "Processes a chat request and returns a simulated chat response based on predefined data.",
- "crux": {
- "code": " this.last = req;\n return {\n text: this.reply.text ?? \"\",\n toolCalls: this.reply.toolCalls ?? [],\n usage: { input: 0, output: 0, cacheRead: 0, cacheCreate: 0 },\n stopReason: \"stop\",\n assistant: { role: \"assistant\", content: this.reply.text ?? \"\" },\n };",
- "span": "L20-L27"
- }
- },
- {
- "id": "test/mcp-server.test.ts",
- "name": "mcp-server.test.ts",
- "kind": "file",
- "path": "test/mcp-server.test.ts",
- "span": "L1-L66",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "5eacb67182a2925edec5bd036ae556018ed3b2c266d65aaefa0d4d1ff0a3fee6",
- "chars": 2564,
- "summary_state": "stale",
- "summary": "This file contains tests for the RPC functionality of the MCP server, ensuring that various methods return expected results and handle errors correctly.",
- "crux": {
- "code": "test('initialize → tools/list → tools/call round-trip', async () => {\n const dir = mkdtempSync(join(tmpdir(), 'graft-mcpsrv-'));\n const rs = await rpc(\n [\n { jsonrpc: '2.0', id: 1, method: 'initialize', params: { protocolVersion: '2025-03-26', capabilities: {}, clientInfo: { name: 't', version: '0' } } },\n { jsonrpc: '2.0', method: 'notifications/initialized' },\n { jsonrpc: '2.0', id: 2, method: 'tools/list' },\n { jsonrpc: '2.0', id: 3, method: 'tools/call', params: { name: 'graft_blast_radius', arguments: { file: 'x.ts' } } },\n ],\n dir,\n 3,\n );",
- "span": "L30-L41"
- }
- },
- {
- "id": "test/mcp-server.test.ts#rpc",
- "name": "rpc",
- "kind": "function",
- "path": "test/mcp-server.test.ts",
- "span": "L9-L28",
- "signature": "async function rpc(messages: object[], dir: string, expected: number): Promise<any[]>",
- "exported": false,
- "origin": "ast",
- "body_hash": "a83e1cfe6b7af8f6c87c6c9756d4ca8d61c0122c956f24b5b80a2249b2e950b1",
- "summary_state": "ready",
- "summary": "The rpc function facilitates communication with the MCP server by sending messages and collecting responses, handling asynchronous interactions effectively.",
- "crux": {
- "code": " for (const m of messages) child.stdin.write(`${JSON.stringify(m)}\\n`);\n const deadline = Date.now() + 15000;\n while (responses.length < expected && Date.now() < deadline) await new Promise((r) => setTimeout(r, 50));\n child.kill();\n await once(child, 'exit').catch(() => {});\n return responses;",
- "span": "L22-L27"
- }
- },
- {
- "id": "test/mcp-tools.test.ts",
- "name": "mcp-tools.test.ts",
- "kind": "file",
- "path": "test/mcp-tools.test.ts",
- "span": "L1-L301",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "2241812ee605797530ebbbd0e646833ba632460cd2ce3a0b80d44cd53f6ef844",
- "chars": 13284,
- "summary_state": "stale",
- "summary": "This test suite validates the functionality of various tools in the MCP codebase, ensuring they operate correctly on built repositories and handle errors appropriately.",
- "crux": {
- "code": "test('TOOLS lists all eight tools with schemas', () => {\n assert.deepEqual(TOOLS.map((t) => t.name), [\n 'graft_ask',\n 'graft_skeleton',\n 'graft_check',\n 'graft_blast_radius',\n 'graft_callers',\n 'graft_callees',\n 'graft_grep',\n 'graft_map',\n ]);\n for (const t of TOOLS) {",
- "span": "L75-L86"
- }
- },
- {
- "id": "test/mcp-tools.test.ts#builtRepo",
- "name": "builtRepo",
- "kind": "function",
- "path": "test/mcp-tools.test.ts",
- "span": "L9-L16",
- "signature": "function builtRepo(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "2e8d1ef9e31662a9e1a2e64630378d64979be157310df30d3e97900015426178",
- "summary_state": "ready",
- "summary": "Creates a temporary repository structure for testing the tools with a basic math implementation.",
- "crux": {
- "code": " const d = mkdtempSync(join(tmpdir(), 'graft-mcptools-'));\n mkdirSync(join(d, 'src'), { recursive: true });\n writeFileSync(join(d, 'src', 'math.ts'),\n 'export function add(a: number, b: number): number {\\n return a + b;\\n}\\nexport function sub(a: number, b: number): number {\\n return add(a, -b);\\n}\\n');\n execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'build', d], { stdio: 'pipe' });",
- "span": "L10-L14"
- }
- },
- {
- "id": "test/mcp-tools.test.ts#chainRepo",
- "name": "chainRepo",
- "kind": "function",
- "path": "test/mcp-tools.test.ts",
- "span": "L22-L33",
- "signature": "function chainRepo(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "15d62ff8440102dce21a2647a706a4307c540acecc930810e29307b72defe3b6",
- "summary_state": "ready",
- "summary": "Sets up a repository with a three-deep function call structure to test depth-related functionality in tools.",
- "crux": {
- "code": " 'export function compute(a: number, b: number): number {\\n return sub(a, b);\\n}\\n',",
- "span": "L29-L29"
- }
- },
- {
- "id": "test/mcp-tools.test.ts#customDirRepo",
- "name": "customDirRepo",
- "kind": "function",
- "path": "test/mcp-tools.test.ts",
- "span": "L37-L45",
- "signature": "function customDirRepo(): { repo: string; graphDir: string }",
- "exported": false,
- "origin": "ast",
- "body_hash": "def8983a39f4cc761bf0d89b5f58bb41eff230621ebb4894b7f9007c75af1227",
- "summary_state": "ready",
- "summary": "Establishes a repository in a custom directory to validate the handling of non-default graph locations.",
- "crux": {
- "code": " execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'build', d, '--dir', graphDir], { stdio: 'pipe' });",
- "span": "L43-L43"
- }
- },
- {
- "id": "test/mcp-tools.test.ts#fileScopeRepo",
- "name": "fileScopeRepo",
- "kind": "function",
- "path": "test/mcp-tools.test.ts",
- "span": "L50-L60",
- "signature": "function fileScopeRepo(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "c3e730fb2a68c37167f29ebcf6a14eab2650fde246b3b2fd611cf96b58c55cbd",
- "summary_state": "ready",
- "summary": "Creates a repository to test the interaction between file imports and function calls across files.",
- "crux": {
- "code": " writeFileSync(join(d, 'src', 'a.ts'), 'export function helper(): number {\\n return 42;\\n}\\n');\n writeFileSync(\n join(d, 'src', 'b.ts'),",
- "span": "L53-L55"
- }
- },
- {
- "id": "test/mcp-tools.test.ts#multiDirRepo",
- "name": "multiDirRepo",
- "kind": "function",
- "path": "test/mcp-tools.test.ts",
- "span": "L65-L73",
- "signature": "function multiDirRepo(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "1ba610952a7f039e9715046c0e81e62fb5a0fcb2bb3d62e5435321252679a0bf",
- "summary_state": "ready",
- "summary": "Generates a repository with multiple directories to test the handling of directory limits in tool operations.",
- "crux": {
- "code": " writeFileSync(join(d, dir, 'x.ts'), `export function ${dir}Fn(): number {\\n return 1;\\n}\\n`);\n }",
- "span": "L69-L70"
- }
- },
- {
- "id": "test/regression-single-repo.test.ts",
- "name": "regression-single-repo.test.ts",
- "kind": "file",
- "path": "test/regression-single-repo.test.ts",
- "span": "L1-L135",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "ae90cd4d99fa1372c2ba2457870bd77d08b4be2a3160112dfbc70edd80180aa7",
- "chars": 6251,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/regression-single-repo.test.ts#assertScopeFreeText",
- "name": "assertScopeFreeText",
- "kind": "function",
- "path": "test/regression-single-repo.test.ts",
- "span": "L71-L77",
- "signature": "function assertScopeFreeText(label: string, text: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "eb7b6ad610aea83818cdbcb4b77efc92e0a00a667cd4249421e726ca9a6b106a",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/regression-single-repo.test.ts#fx",
- "name": "fx",
- "kind": "function",
- "path": "test/regression-single-repo.test.ts",
- "span": "L27-L34",
- "signature": "function fx(layout: Record<string, string>): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "03a58872524b4c478d0693b013a9a3f7abd7c43553e26586678471cec16ddda6",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/savings.test.ts",
- "name": "savings.test.ts",
- "kind": "file",
- "path": "test/savings.test.ts",
- "span": "L1-L66",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "c72e0b930bc106083b6a69b366c83e3b4f96d816cb4be4f62c45578fdb3ae21b",
- "chars": 2776,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/savings.test.ts#fileNode",
- "name": "fileNode",
- "kind": "function",
- "path": "test/savings.test.ts",
- "span": "L10-L26",
- "signature": "function fileNode(path: string, chars?: number): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "a511e0353d36f5c20370f000f5314d5ee3880e70ae68027ec09cdb17c98c35a4",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/savings.test.ts#graphOf",
- "name": "graphOf",
- "kind": "function",
- "path": "test/savings.test.ts",
- "span": "L28-L30",
- "signature": "function graphOf(nodes: NodeV1[]): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "24dbd41a16d5d267b695d299a8510734f9d6cee0ce8608bd7a0530520c0f4ebd",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/search-grep.test.ts",
- "name": "search-grep.test.ts",
- "kind": "file",
- "path": "test/search-grep.test.ts",
- "span": "L1-L244",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a23b17c1a455374c4b4172834c51bb6c5e5ed5abbc891df16ee7cb4aeae9b5c0",
- "chars": 9704,
- "summary_state": "ready",
- "summary": "Contains core tests for the `graft grep` functionality, ensuring accurate symbol attribution and search results in a parsed graph.",
- "crux": {
- "code": "test('WALK_RELATIONS (shared, src/graph/relations.ts): exactly the five dependency relations', () => {\n assert.deepEqual(\n [...WALK_RELATIONS].sort(),\n ['calls', 'extends', 'implements', 'imports', 'references'].sort(),\n );\n // Excluded on purpose: contains is structural (file->symbol), not dependency wiring.\n assert.equal(WALK_RELATIONS.has('contains' as never), false);\n});\n\ntest('grepGraph: groups are ordered by inDegree desc, then path asc', () => {\n const repo = needleRepo();\n const graph = loadBuiltGraph(repo);",
- "span": "L93-L104"
- }
- },
- {
- "id": "test/search-grep.test.ts#fileNode",
- "name": "fileNode",
- "kind": "function",
- "path": "test/search-grep.test.ts",
- "span": "L24-L39",
- "signature": "function fileNode(path: string, lines: number): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "a97b45c7d03f4c753851a32b055aa77614f568140588edcbea2757291188a02e",
- "summary_state": "ready",
- "summary": "Creates a file node representation for a given path and number of lines, facilitating graph construction.",
- "crux": {
- "code": "function fileNode(path: string, lines: number): NodeV1 {\n return {\n id: path,\n name: path,\n kind: 'file',\n path,\n span: `L1-L${lines}`,\n signature: null,\n exported: true,\n origin: 'ast',\n body_hash: '',\n summary_state: 'pending',",
- "span": "L24-L35"
- }
- },
- {
- "id": "test/search-grep.test.ts#graphOf",
- "name": "graphOf",
- "kind": "function",
- "path": "test/search-grep.test.ts",
- "span": "L41-L43",
- "signature": "function graphOf(nodes: NodeV1[], edges: GraphV1['edges'] = []): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "14ab0ac438fbede56f702c479b6f7fc1bc8d146c4b36242dab7d25fbcb8cf5c6",
- "summary_state": "ready",
- "summary": "Constructs a graph representation from nodes and edges, encapsulating metadata about the graph structure.",
- "crux": {
- "code": "function graphOf(nodes: NodeV1[], edges: GraphV1['edges'] = []): GraphV1 {\n return { meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [] }, nodes, edges };\n}",
- "span": "L41-L43"
- }
- },
- {
- "id": "test/search-grep.test.ts#loadBuiltGraph",
- "name": "loadBuiltGraph",
- "kind": "function",
- "path": "test/search-grep.test.ts",
- "span": "L87-L91",
- "signature": "function loadBuiltGraph(repo: string): GraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "39d7dbe4e44d4a83bb1b4d13836e4b230a8c709a09e7ff116b77190a82eb16c1",
- "summary_state": "ready",
- "summary": "Loads a built graph from a specified repository, ensuring the graph is correctly constructed for testing.",
- "crux": {
- "code": "function loadBuiltGraph(repo: string): GraphV1 {\n const g = readGraph(wiringPath(join(repo, 'graft')));\n assert.ok(g, 'expected a built graph.json');\n return g!;\n}",
- "span": "L87-L91"
- }
- },
- {
- "id": "test/search-grep.test.ts#needleRepo",
- "name": "needleRepo",
- "kind": "function",
- "path": "test/search-grep.test.ts",
- "span": "L50-L85",
- "signature": "function needleRepo(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "ddbfa733e3076db220939ab5efd2ec90a8250b54170f03bb9d23c28751467b01",
- "summary_state": "ready",
- "summary": "Sets up a temporary repository with TypeScript files to test the grep functionality, simulating real-world usage scenarios.",
- "crux": {
- "code": "function needleRepo(): string {\n const d = mkdtempSync(join(tmpdir(), 'graft-grep-'));\n mkdirSync(join(d, 'src'), { recursive: true });\n writeFileSync(\n join(d, 'src', 'a.ts'),\n [\n 'export function heavilyCalled(): void {',\n ' console.log(\"NEEDLE hit in heavilyCalled\");',\n '}',\n '',\n 'export function rarelyCalled(): void {',\n ' console.log(\"NEEDLE hit in rarelyCalled\");',",
- "span": "L50-L61"
- }
- },
- {
- "id": "test/viz-assemble.test.ts",
- "name": "viz-assemble.test.ts",
- "kind": "file",
- "path": "test/viz-assemble.test.ts",
- "span": "L1-L106",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "89a2a9f11f459a8110f9d89b2de780dfd164504f3b4c7dc61953a6c83c5911cb",
- "chars": 3118,
- "summary_state": "ready",
- "summary": "This file contains tests that validate the assembly of a context graph from markdown frontmatter, ensuring proper relation normalization and error handling for malformed files.",
- "crux": {
- "code": "test(\"assembleContextGraph builds nodes and edges from frontmatter\", () => {\n const dir = makeContextDir();\n try {\n const g = assembleContextGraph(dir);\n\n assert.equal(g.nodes.length, 2);\n assert.deepEqual(g.nodes.map((n) => n.id).sort(), [\"alpha\", \"beta\"]);\n\n const alpha = g.nodes.find((n) => n.id === \"alpha\")!;\n assert.equal(alpha.name, \"Alpha\");\n assert.equal(alpha.type, \"system\");\n assert.deepEqual(alpha.sources, [\"src/a.ts\"]);",
- "span": "L62-L73"
- }
- },
- {
- "id": "test/viz-assemble.test.ts#makeContextDir",
- "name": "makeContextDir",
- "kind": "function",
- "path": "test/viz-assemble.test.ts",
- "span": "L12-L60",
- "signature": "function makeContextDir(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "4fab7dd2dc5bc7c0b9d575f8396bdca67e8d2d5a9f337aa14ef7740dd87b2119",
- "summary_state": "ready",
- "summary": "This function creates a temporary directory with markdown files to simulate context data for testing the graph assembly.",
- "crux": {
- "code": " const dir = mkdtempSync(join(tmpdir(), \"graftviz-\"));\n writeFileSync(\n join(dir, \"alpha.md\"),\n `---\nname: Alpha\nslug: alpha\ntype: system\nsources:\n - path: src/a.ts\n hash: abc123\nlinks:\n - to: beta",
- "span": "L13-L24"
- }
- },
- {
- "id": "test/viz-serve.test.ts",
- "name": "viz-serve.test.ts",
- "kind": "file",
- "path": "test/viz-serve.test.ts",
- "span": "L1-L101",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "d22168054844e83bc5257271c4cc80a6e3eb1315e600c03b48fe6b54afd5c243",
- "chars": 4004,
- "summary_state": "ready",
- "summary": "This file contains tests for the viz server, ensuring it serves the correct endpoints and handles various scenarios like port fallback and context directory changes.",
- "crux": {
- "code": "test(\"viz server serves viewer, context graph, and gates code graph\", async () => {\n const { contextDir, viewerDir, root } = makeDirs();\n const srv = await startVizServer({ contextDir, viewerDir, port: 4831, repoName: \"fixture\" });\n try {\n const html = await fetch(`${srv.url}/`).then((r) => r.text());\n assert.match(html, /stub/);\n\n const graph = await fetch(`${srv.url}/api/context-graph`).then((r) => r.json());\n assert.equal(graph.meta.nodeCount, 1);\n assert.equal(graph.meta.repoName, \"fixture\");\n assert.equal(graph.nodes[0].id, \"alpha\");\n",
- "span": "L29-L40"
- }
- },
- {
- "id": "test/viz-serve.test.ts#makeDirs",
- "name": "makeDirs",
- "kind": "function",
- "path": "test/viz-serve.test.ts",
- "span": "L13-L27",
- "signature": "function makeDirs(): { contextDir: string; viewerDir: string; root: string }",
- "exported": false,
- "origin": "ast",
- "body_hash": "cff2ec95e868528eec2623a2907ab4c4e3e4a55224d0551b1fb8a63e8bbc124d",
- "summary_state": "ready",
- "summary": "This function creates necessary directory structures and files for testing the viz server.",
- "crux": {
- "code": " const root = mkdtempSync(join(tmpdir(), \"graftviz-srv-\"));\n const contextDir = join(root, \".context\");\n const viewerDir = join(root, \"viewer\");\n mkdirSync(contextDir);\n mkdirSync(viewerDir);\n writeFileSync(join(viewerDir, \"index.html\"), \"<title>stub</title>\\n\");\n writeFileSync(join(viewerDir, \"app.js\"), \"// stub\\n\");\n writeFileSync(join(viewerDir, \"style.css\"), \"/* stub */\\n\");\n writeFileSync(\n join(contextDir, \"alpha.md\"),\n `---\\nname: Alpha\\nslug: alpha\\ntype: system\\nsources: []\\nlinks: []\\n---\\nbody\\n`,\n );",
- "span": "L14-L25"
- }
- },
- {
- "id": "test/workspace.test.ts",
- "name": "workspace.test.ts",
- "kind": "file",
- "path": "test/workspace.test.ts",
- "span": "L1-L337",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "272fbff178d36987fc11da71b069683d2eaf705ffc6048445e1dcc5ac1d73755",
- "chars": 16503,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/workspace.test.ts#buildWorkspace",
- "name": "buildWorkspace",
- "kind": "function",
- "path": "test/workspace.test.ts",
- "span": "L40-L44",
- "signature": "async function buildWorkspace(parent: string): Promise<{ children: string[]; migrated: boolean }>",
- "exported": false,
- "origin": "ast",
- "body_hash": "3b3b06ede3ce06f892e8593ffd60089525ac61b98ae966662a6d1d6b521a2856",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/workspace.test.ts#pad",
- "name": "pad",
- "kind": "function",
- "path": "test/workspace.test.ts",
- "span": "L53-L57",
- "signature": "function pad(n: number): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "392948aa7faabec2fab944448c20fea3717d6afe9fb5c92e6e222cfc2fad8c9e",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/workspace.test.ts#workspaceFx",
- "name": "workspaceFx",
- "kind": "function",
- "path": "test/workspace.test.ts",
- "span": "L26-L37",
- "signature": "function workspaceFx(children: Record<string, Record<string, string>>): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "3e4d4b90019b952ebac2f1a61ecc85c173205e30528a6eec49190f98dfb58235",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "viewer/data.ts",
- "name": "data.ts",
- "kind": "file",
- "path": "viewer/data.ts",
- "span": "L1-L122",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "e9c5c89ad933e06004cbeddc1b1d7b60a6057726a463c66f9673ba20a3c61afd",
- "chars": 4708,
- "summary_state": "ready",
- "summary": "This file defines data structures and functions for managing and visualizing graph data from a server.",
- "crux": null
- },
- {
- "id": "viewer/data.ts#chipKey",
- "name": "chipKey",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L47-L51",
- "signature": "function chipKey(rel: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "85dd128b9f3bf028efaeac2428474b0d70ac47e8e94bcba80c111d59a6006df9",
- "summary_state": "ready",
- "summary": "Generates a key for chip grouping based on the relation verb, simplifying the visualization of relationships.",
- "crux": {
- "code": " if (famOf(rel) === \"structure\") return \"part of\";\n if (rel === \"calls\" || rel === \"uses\" || rel === \"depends_on\" || rel === \"imports\") return \"uses\";\n return rel.replace(/_/g, \" \");",
- "span": "L48-L50"
- }
- },
- {
- "id": "viewer/data.ts#CodeGraphV1",
- "name": "CodeGraphV1",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L86-L93",
- "signature": "interface CodeGraphV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "e494a9a322973f3bc8af2017764ac546a8e9cb7b03cae5aeb730f48ad2521d90",
- "summary_state": "ready",
- "summary": "Defines the structure of the code graph data received from the server, including nodes and edges.",
- "crux": null
- },
- {
- "id": "viewer/data.ts#colorToken",
- "name": "colorToken",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L72-L75",
- "signature": "function colorToken(tab: \"context\" | \"code\", type: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "dc48f14294140f474d97fdedf0bdbbbe487d5f0bcdeda6ae84f87251ab24b007",
- "summary_state": "ready",
- "summary": "Maps a type to its corresponding CSS custom property for styling in the visualization.",
- "crux": {
- "code": " return m[type] ?? \"--edge\";",
- "span": "L74-L74"
- }
- },
- {
- "id": "viewer/data.ts#cvar",
- "name": "cvar",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L77-L79",
- "signature": "function cvar(name: string): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "89e6f3b44e0dd358542573894691c925266e88da9160b79be00d043ae17245e8",
- "summary_state": "ready",
- "summary": "Retrieves the value of a CSS custom property from the document's root element.",
- "crux": null
- },
- {
- "id": "viewer/data.ts#Family",
- "name": "Family",
- "kind": "type",
- "path": "viewer/data.ts",
- "span": "L29-L29",
- "signature": "type Family = \"structure\" | \"dependency\" | \"contract\" | \"association\";",
- "exported": true,
- "origin": "ast",
- "body_hash": "324db0cd1c7f2eebbda194734b2a8db880eb835949f0325780ea5ae75308ef05",
- "summary_state": "ready",
- "summary": "Categorizes relation verbs into families to enforce consistent semantics in graph relationships.",
- "crux": null
- },
- {
- "id": "viewer/data.ts#famOf",
- "name": "famOf",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L39-L41",
- "signature": "function famOf(rel: string): Family",
- "exported": true,
- "origin": "ast",
- "body_hash": "faed31084ad49496d754f589593081a76a4cd98e714ff10a10c07d5cd476738d",
- "summary_state": "ready",
- "summary": "Determines the family category of a given relation verb, defaulting to 'association' if unknown.",
- "crux": {
- "code": " return FAMILY[rel] ?? \"association\";",
- "span": "L40-L40"
- }
- },
- {
- "id": "viewer/data.ts#loadCodeGraph",
- "name": "loadCodeGraph",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L96-L113",
- "signature": "async function loadCodeGraph(): Promise<VizGraph | null>",
- "exported": true,
- "origin": "ast",
- "body_hash": "343a1a01362fa33345082eb6cd5a04cfc1b7a1411de7bc23422c5ac5ebb1fae1",
- "summary_state": "ready",
- "summary": "Loads the code graph from the server, filtering out unresolved edges and returning a structured graph.",
- "crux": {
- "code": " if (!res.ok) return null;\n const raw = (await res.json()) as CodeGraphV1;\n const nodes: VizNode[] = raw.nodes.map((n) => ({\n id: n.id,\n name: n.name,\n type: n.kind,\n summary: n.summary ?? n.signature ?? \"\",\n sources: [`${n.path} · ${n.span}`],\n }));\n const known = new Set(nodes.map((n) => n.id));\n // imports edges may point at unresolved module strings — drop those for rendering\n const edges: VizEdge[] = raw.edges",
- "span": "L98-L109"
- }
- },
- {
- "id": "viewer/data.ts#loadContextGraph",
- "name": "loadContextGraph",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L81-L84",
- "signature": "async function loadContextGraph(): Promise<VizGraph>",
- "exported": true,
- "origin": "ast",
- "body_hash": "c65d9227bea8ceceffd49b4eb8475677aef8ca8820b966d9228a31875a6589e1",
- "summary_state": "ready",
- "summary": "Fetches the context graph data from the server and returns it in a structured format.",
- "crux": {
- "code": " const res = await fetch(\"/api/context-graph\");\n return (await res.json()) as VizGraph;",
- "span": "L82-L83"
- }
- },
- {
- "id": "viewer/data.ts#onServerChange",
- "name": "onServerChange",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L116-L121",
- "signature": "function onServerChange(handler: () => void): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "d864a1d7995232ad54351830e5963a2c6fc8c64cc5a941cf9cfea74d688514c9",
- "summary_state": "ready",
- "summary": "Subscribes to server events to trigger updates in the application when changes occur.",
- "crux": {
- "code": " if (ev.data === \"change\") handler();",
- "span": "L119-L119"
- }
- },
- {
- "id": "viewer/data.ts#VizEdge",
- "name": "VizEdge",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L14-L20",
- "signature": "interface VizEdge",
- "exported": true,
- "origin": "ast",
- "body_hash": "13baa6c9acc4c78eec36835e02fd49df79e869f836880341a959be134ceaabb1",
- "summary_state": "ready",
- "summary": "Defines the relationship between two nodes in the visualization graph, including its type and description.",
- "crux": null
- },
- {
- "id": "viewer/data.ts#VizGraph",
- "name": "VizGraph",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L22-L26",
- "signature": "interface VizGraph",
- "exported": true,
- "origin": "ast",
- "body_hash": "6448a4bb9c71c7932dce92d9d8a452f99a0a100041bd30c5b6759c5784b0f098",
- "summary_state": "ready",
- "summary": "Encapsulates the entire visualization graph structure, including its nodes and edges.",
- "crux": null
- },
- {
- "id": "viewer/data.ts#VizNode",
- "name": "VizNode",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L6-L12",
- "signature": "interface VizNode",
- "exported": true,
- "origin": "ast",
- "body_hash": "ec19a79898c594e5afc405cab037fcc0c43144c5766af8a955dccda7df733ba6",
- "summary_state": "ready",
- "summary": "Represents a node in the visualization graph, encapsulating its identity and metadata.",
- "crux": null
- },
- {
- "id": "viewer/detail.ts",
- "name": "detail.ts",
- "kind": "file",
- "path": "viewer/detail.ts",
- "span": "L1-L59",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "fe8df7c5561f2a8588cf4e1ecb367d19cb6b480fe4855f05e4f96137d8078884",
- "chars": 2421,
- "summary_state": "ready",
- "summary": "This file provides the logic to render a detailed view of a selected node in a graph, including its properties and relationships.",
- "crux": {
- "code": " if (!id || !graph) {\n host.innerHTML = '<div class=\"empty\">Select a node to view details</div>';\n return;\n }\n const node = graph.nodes.find((n) => n.id === id);\n if (!node) {\n host.innerHTML = '<div class=\"empty\">Select a node to view details</div>';\n return;\n }\n const color = cvar(colorToken(tab, node.type));\n const name = (nid: string) => graph.nodes.find((n) => n.id === nid)?.name ?? nid;\n const out = graph.edges.filter((e) => e.source === id);",
- "span": "L19-L30"
- }
- },
- {
- "id": "viewer/detail.ts#esc",
- "name": "esc",
- "kind": "function",
- "path": "viewer/detail.ts",
- "span": "L8-L10",
- "signature": "function esc(s: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "9fb927f7f1c881ee1fe325c0dc8a25b8c5cdb2c101b08ae935a35bb428f5bbdb",
- "summary_state": "ready",
- "summary": "This function sanitizes a string for safe HTML rendering by escaping special characters.",
- "crux": {
- "code": " return s.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\");\n}",
- "span": "L9-L10"
- }
- },
- {
- "id": "viewer/detail.ts#renderDetail",
- "name": "renderDetail",
- "kind": "function",
- "path": "viewer/detail.ts",
- "span": "L12-L58",
- "signature": "function renderDetail( host: HTMLElement, graph: VizGraph | null, tab: \"context\" | \"code\", id: string | null, onNavigate: (id: string) => void, ): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "bbd0db0a7f39cbfbd9b0ca31f88118c9a2cd037d394ad47bff7203a6f399f5ca",
- "summary_state": "ready",
- "summary": "This function renders the details of a selected node, including its type, name, summary, sources, and relationships.",
- "crux": {
- "code": " const color = cvar(colorToken(tab, node.type));\n const name = (nid: string) => graph.nodes.find((n) => n.id === nid)?.name ?? nid;\n const out = graph.edges.filter((e) => e.source === id);\n const inn = graph.edges.filter((e) => e.target === id);\n\n let html = `<span class=\"d-type\"><span class=\"sw\" style=\"background:${color}\"></span>${esc(node.type)}</span>`;\n html += `<h3>${esc(node.name)}</h3>`;\n if (node.summary) html += `<p class=\"summary\">${esc(node.summary)}</p>`;\n if (node.sources.length) {\n html += `<div class=\"d-label\">Sources · ${node.sources.length}</div>`;\n for (const s of node.sources) html += `<div class=\"src mono\">${esc(s)}</div>`;\n }",
- "span": "L28-L39"
- }
- },
- {
- "id": "viewer/detail.ts#renderDetail.linkList",
- "name": "linkList",
- "kind": "function",
- "path": "viewer/detail.ts",
- "span": "L40-L50",
- "signature": "linkList = (edges: typeof out, dotColor: string, title: string, other: (e: (typeof out)[number]) => string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "f103fe554602f3315706280d7eba1016c647c77fa6af27e9a4ec0442d6cf1d89",
- "summary_state": "ready",
- "summary": "This function generates HTML for displaying a list of links related to a node, categorized by their relationship type.",
- "crux": {
- "code": " if (!edges.length) return;\n html += `<div class=\"d-label\"><span class=\"dot\" style=\"background:${dotColor}\"></span>${title} · ${edges.length}</div>`;\n for (const e of edges) {\n html += `<button class=\"lnk\" data-go=\"${esc(other(e))}\">` +\n `<span class=\"rel\">${esc(e.relation.replace(/_/g, \" \"))}</span> ` +\n `<span class=\"to\">${esc(name(other(e)))}</span>` +\n (e.description ? `<div class=\"desc\">${esc(e.description)}</div>` : \"\") +\n `</button>`;\n }\n };",
- "span": "L41-L50"
- }
- },
- {
- "id": "viewer/detail.ts#renderDetail.name",
- "name": "name",
- "kind": "function",
- "path": "viewer/detail.ts",
- "span": "L29-L29",
- "signature": "name = (nid: string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "617c48812e0f0520b45da770cf91aeea5330b7e690c6d93defd4da77edf11b8a",
- "summary_state": "ready",
- "summary": "This function retrieves the name of a node by its ID, providing a fallback if not found.",
- "crux": {
- "code": " const name = (nid: string) => graph.nodes.find((n) => n.id === nid)?.name ?? nid;",
- "span": "L29-L29"
- }
- },
- {
- "id": "viewer/graph.ts",
- "name": "graph.ts",
- "kind": "file",
- "path": "viewer/graph.ts",
- "span": "L1-L335",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "192a59b16da8327457de6723893fd9207dd9570a35cd664f96534a7b85e73e01",
- "chars": 14262,
- "summary_state": "ready",
- "summary": "This file implements a force-directed graph visualization using D3.js, allowing interactive exploration of nodes and edges.",
- "crux": {
- "code": " setData(graph: VizGraph, tab: \"context\" | \"code\"): void {\n this.tab = tab;\n const prev = new Map(this.nodes.map((n) => [n.id, n]));\n const deg: Record<string, number> = {};\n for (const e of graph.edges) {\n deg[e.source] = (deg[e.source] ?? 0) + 1;\n deg[e.target] = (deg[e.target] ?? 0) + 1;\n }\n const W = this.svg.clientWidth || 800;\n const H = this.svg.clientHeight || 600;\n this.nodes = graph.nodes.map((n, i) => {\n const p = prev.get(n.id);",
- "span": "L94-L105"
- }
- },
- {
- "id": "viewer/graph.ts#el",
- "name": "el",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L42-L46",
- "signature": "function el<K extends keyof SVGElementTagNameMap>(tag: K, attrs: Record<string, string | number>): SVGElementTagNameMap[K]",
- "exported": false,
- "origin": "ast",
- "body_hash": "de7f696c06af5d771e8e661f398d9d275ca2cc06d86f4e91458d671480e346b7",
- "summary_state": "ready",
- "summary": "Creates and returns an SVG element with specified attributes, facilitating dynamic SVG generation.",
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView",
- "name": "GraphView",
- "kind": "class",
- "path": "viewer/graph.ts",
- "span": "L48-L334",
- "signature": "class GraphView",
- "exported": true,
- "origin": "ast",
- "body_hash": "1405c1f292294538c45794740adf01c59c83d3fd7047b6efa8c04c90a4409310",
- "summary_state": "ready",
- "summary": "Manages the rendering and interaction of the graph view, including node and edge updates.",
- "crux": {
- "code": " setData(graph: VizGraph, tab: \"context\" | \"code\"): void {\n this.tab = tab;\n const prev = new Map(this.nodes.map((n) => [n.id, n]));\n const deg: Record<string, number> = {};\n for (const e of graph.edges) {\n deg[e.source] = (deg[e.source] ?? 0) + 1;\n deg[e.target] = (deg[e.target] ?? 0) + 1;\n }\n const W = this.svg.clientWidth || 800;\n const H = this.svg.clientHeight || 600;\n this.nodes = graph.nodes.map((n, i) => {\n const p = prev.get(n.id);",
- "span": "L94-L105"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.applyView",
- "name": "applyView",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L268-L270",
- "signature": "private applyView(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "2adb54996d6ef9272cd69144b4b6c4bb92236506a3f5bf2d589faffd5218554b",
- "summary_state": "ready",
- "summary": "Applies the current view transformation to the graph, adjusting the viewport accordingly.",
- "crux": {
- "code": " private applyView(): void {\n this.viewport.setAttribute(\"transform\", `translate(${this.view.x},${this.view.y}) scale(${this.view.k})`);\n }",
- "span": "L268-L270"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.bindDrag",
- "name": "bindDrag",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L290-L309",
- "signature": "private bindDrag(group: SVGGElement, node: SimNode): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "00e851d11e1029516256411b627b60e78d781cdc62ada046a0eb93c55c2dd009",
- "summary_state": "ready",
- "summary": "Enables dragging functionality for nodes, allowing users to reposition them interactively.",
- "crux": {
- "code": " private bindDrag(group: SVGGElement, node: SimNode): void {\n group.addEventListener(\"pointerdown\", (ev) => {\n ev.stopPropagation();\n group.setPointerCapture(ev.pointerId);\n const move = (mv: PointerEvent) => {\n const rect = this.svg.getBoundingClientRect();\n node.fx = (mv.clientX - rect.left - this.view.x) / this.view.k;\n node.fy = (mv.clientY - rect.top - this.view.y) / this.view.k;\n this.sim?.alphaTarget(0.25).restart();\n };\n const up = () => {\n node.fx = null; node.fy = null;",
- "span": "L290-L301"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.bindDrag.move",
- "name": "move",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L294-L299",
- "signature": "move = (mv: PointerEvent)",
- "exported": true,
- "origin": "ast",
- "body_hash": "656f371efff6a0eed7868895a4044e4fdf1dc88840de21376c388ba03149fbd0",
- "summary_state": "ready",
- "summary": "Handles the movement of a node during drag events, updating its fixed position.",
- "crux": {
- "code": " const move = (mv: PointerEvent) => {\n const rect = this.svg.getBoundingClientRect();\n node.fx = (mv.clientX - rect.left - this.view.x) / this.view.k;\n node.fy = (mv.clientY - rect.top - this.view.y) / this.view.k;\n this.sim?.alphaTarget(0.25).restart();\n };",
- "span": "L294-L299"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.bindDrag.up",
- "name": "up",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L300-L305",
- "signature": "up = ()",
- "exported": true,
- "origin": "ast",
- "body_hash": "a935b15e42eefdf45da528afe3172b559d3e9ee97fe4be67f682dedccaac64c2",
- "summary_state": "ready",
- "summary": "Finalizes the drag operation by releasing the node's fixed position.",
- "crux": {
- "code": " const up = () => {\n node.fx = null; node.fy = null;\n this.sim?.alphaTarget(0);\n group.removeEventListener(\"pointermove\", move);\n group.removeEventListener(\"pointerup\", up);\n };",
- "span": "L300-L305"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.bindPanZoom",
- "name": "bindPanZoom",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L311-L333",
- "signature": "private bindPanZoom(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "737e5f69bc32913d3b061a4a878b61245d242e217f451a81d72d21e1d28fae30",
- "summary_state": "ready",
- "summary": "Sets up event listeners for panning and zooming the graph view based on user interactions.",
- "crux": {
- "code": " private bindPanZoom(): void {\n let panStart: { x: number; y: number } | null = null;\n this.svg.addEventListener(\"pointerdown\", (ev) => {\n panStart = { x: ev.clientX - this.view.x, y: ev.clientY - this.view.y };\n });\n this.svg.addEventListener(\"pointermove\", (ev) => {\n if (!panStart) return;\n this.view.x = ev.clientX - panStart.x;\n this.view.y = ev.clientY - panStart.y;\n this.applyView();\n });\n window.addEventListener(\"pointerup\", () => { panStart = null; });",
- "span": "L311-L322"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.buildChrome",
- "name": "buildChrome",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L71-L78",
- "signature": "private buildChrome(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "592cef68d76f99ad8da470cc3c8b4eda64701c02b8740a21e659fdd5e5325def",
- "summary_state": "ready",
- "summary": "Sets up the initial SVG structure for the graph, including definitions and viewport.",
- "crux": {
- "code": " this.svg.textContent = \"\";\n this.defs = el(\"defs\", {});\n this.svg.appendChild(this.defs);\n this.viewport = el(\"g\", {});\n this.svg.appendChild(this.viewport);\n this.svg.addEventListener(\"click\", () => this.select(null));\n }",
- "span": "L72-L78"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.buildElements",
- "name": "buildElements",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L138-L164",
- "signature": "private buildElements(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "a608a77fab16447bd9ef9c465a192abc0cb7167807f7c1718d961d730d7f055d",
- "summary_state": "ready",
- "summary": "Constructs the SVG elements for nodes and edges based on the current dataset.",
- "crux": {
- "code": " private buildElements(): void {\n this.ensureMarkers();\n this.viewport.textContent = \"\";\n this.edgeEls = this.edges.map((edge) => {\n const path = el(\"path\", { fill: \"none\", \"stroke-linecap\": \"round\" });\n const title = el(\"title\", {});\n title.textContent = edge.relation.replace(/_/g, \" \") + (edge.description ? ` — ${edge.description}` : \"\");\n path.appendChild(title);\n const label = el(\"text\", { \"text-anchor\": \"middle\", \"font-size\": 9.5, \"font-weight\": 700, \"stroke-width\": 3, \"paint-order\": \"stroke\", display: \"none\" });\n label.textContent = edge.relation.replace(/_/g, \" \");\n this.viewport.appendChild(path);\n this.viewport.appendChild(label);",
- "span": "L138-L149"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L65-L69",
- "signature": "constructor(svg: SVGSVGElement)",
- "exported": true,
- "origin": "ast",
- "body_hash": "27abb788d7de0ece37719a0a23d4fed7778c02dda10700bbfb4f110ea8c16984",
- "summary_state": "ready",
- "summary": "Initializes the GraphView instance and sets up the SVG environment for rendering.",
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.ensureMarkers",
- "name": "ensureMarkers",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L80-L91",
- "signature": "private ensureMarkers(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "9517cfdb2ccb4ce235405356f6ff9b2fb3fcd2f7d687689bde33cf5df9bd6906",
- "summary_state": "ready",
- "summary": "Ensures that the necessary SVG markers for edges are created and available for rendering.",
- "crux": {
- "code": " this.defs.textContent = \"\";\n const chevron = el(\"marker\", { id: \"arr\", viewBox: \"0 0 10 10\", refX: 8, refY: 5, markerWidth: 4.5, markerHeight: 4.5, orient: \"auto-start-reverse\" });\n chevron.appendChild(el(\"path\", { d: \"M2,1.5L8.5,5L2,8.5\", fill: \"none\", stroke: cvar(\"--edge\"), \"stroke-width\": 1.8, \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\", opacity: 0.75 }));\n const hollow = el(\"marker\", { id: \"arrH\", viewBox: \"0 0 12 12\", refX: 10, refY: 6, markerWidth: 6.5, markerHeight: 6.5, orient: \"auto-start-reverse\" });\n hollow.appendChild(el(\"path\", { d: \"M1.5,1.5L10.5,6L1.5,10.5z\", fill: cvar(\"--canvas\"), stroke: cvar(\"--edge\"), \"stroke-width\": 1.4 }));\n const out = el(\"marker\", { id: \"arrOut\", viewBox: \"0 0 10 10\", refX: 8, refY: 5, markerWidth: 5, markerHeight: 5, orient: \"auto-start-reverse\" });\n out.appendChild(el(\"path\", { d: \"M1,1L9,5L1,9z\", fill: cvar(\"--fil\") }));\n const inn = el(\"marker\", { id: \"arrIn\", viewBox: \"0 0 10 10\", refX: 8, refY: 5, markerWidth: 5, markerHeight: 5, orient: \"auto-start-reverse\" });\n inn.appendChild(el(\"path\", { d: \"M1,1L9,5L1,9z\", fill: cvar(\"--accent\") }));\n for (const m of [chevron, hollow, out, inn]) this.defs.appendChild(m);",
- "span": "L81-L90"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.firstMatch",
- "name": "firstMatch",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L263-L266",
- "signature": "firstMatch(): SimNode | undefined",
- "exported": true,
- "origin": "ast",
- "body_hash": "d43343323ad49732d473f46773ac41a0ee7472f6289d324eb369d739e8cb0352",
- "summary_state": "ready",
- "summary": "Finds the first node that matches the current query, facilitating search functionality.",
- "crux": {
- "code": " firstMatch(): SimNode | undefined {\n const q = this.query.toLowerCase();\n return this.nodes.find((n) => !this.hiddenTypes[n.type] && n.name.toLowerCase().includes(q));\n }",
- "span": "L263-L266"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.focus",
- "name": "focus",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L252-L261",
- "signature": "focus(id: string): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "a64691876d1786ccdb2027028d00210b8cb56557c65c1afa81a886b506d7b459",
- "summary_state": "ready",
- "summary": "Centers the view on a specified node, enhancing its visibility and selection.",
- "crux": {
- "code": " focus(id: string): void {\n const node = this.nodes.find((n) => n.id === id);\n if (!node) return;\n const W = this.svg.clientWidth, H = this.svg.clientHeight;\n this.view.k = Math.max(this.view.k, 1.4);\n this.view.x = W / 2 - (node.x ?? 0) * this.view.k;\n this.view.y = H / 2 - (node.y ?? 0) * this.view.k;\n this.applyView();\n this.select(id);\n }",
- "span": "L252-L261"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.reheat",
- "name": "reheat",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L286-L288",
- "signature": "reheat(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "ca57d7cb11e71985bcd27b937b4f6d0a62428a0ae84f5a297cb1147861032a59",
- "summary_state": "ready",
- "summary": "Restarts the simulation with increased alpha, making the graph more dynamic.",
- "crux": {
- "code": " reheat(): void {\n this.sim?.alpha(0.6).restart();\n }",
- "span": "L286-L288"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.resetView",
- "name": "resetView",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L281-L284",
- "signature": "resetView(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "ae1f1ee82c804ff145b1f4aa9de70cad49a5287735aa9825f6accbe21591794c",
- "summary_state": "ready",
- "summary": "Resets the graph view to its initial state, centering and scaling the view.",
- "crux": {
- "code": " resetView(): void {\n this.view = { x: 0, y: 0, k: 1 };\n this.applyView();\n }",
- "span": "L281-L284"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.restyle",
- "name": "restyle",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L185-L243",
- "signature": "restyle(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "a928dd40f55ad9a091ba969afdf370f2a265bf30fb94efdc6879fcc0fb01edda",
- "summary_state": "ready",
- "summary": "Applies styles to nodes and edges based on their visibility and selection state.",
- "crux": {
- "code": " restyle(): void {\n this.ensureMarkers();\n const neighbors = new Set<string>();\n if (this.selected) {\n for (const e of this.edges) {\n if (e.source.id === this.selected) neighbors.add(e.target.id);\n if (e.target.id === this.selected) neighbors.add(e.source.id);\n }\n }\n const q = this.query.toLowerCase();\n const nodeShown = (n: SimNode) => !this.hiddenTypes[n.type];\n",
- "span": "L185-L196"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.restyle.nodeShown",
- "name": "nodeShown",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L195-L195",
- "signature": "nodeShown = (n: SimNode)",
- "exported": true,
- "origin": "ast",
- "body_hash": "a598aac16da1955aecc62f39590f30d0c7e780d99429b1657c1bbba7d157ddea",
- "summary_state": "ready",
- "summary": "Determines if a node should be displayed based on its type and visibility settings.",
- "crux": null
- },
- {
- "id": "viewer/graph.ts#GraphView.select",
- "name": "select",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L245-L249",
- "signature": "select(id: string | null): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "7ba52874ad2ddda2bc80c3442e011c9d2b464fb8851a3ba527d3dba8ac6061c2",
- "summary_state": "ready",
- "summary": "Selects a node in the graph and updates the visual representation accordingly.",
- "crux": {
- "code": " select(id: string | null): void {\n this.selected = id;\n this.restyle();\n this.onSelect(id);\n }",
- "span": "L245-L249"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.setData",
- "name": "setData",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L94-L136",
- "signature": "setData(graph: VizGraph, tab: \"context\" | \"code\"): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "d8063d2226148959298ca10074e09f00b7530c0b6a87f023502c4bd1c02041a6",
- "summary_state": "ready",
- "summary": "Loads a new dataset into the graph, updating node positions and relationships accordingly.",
- "crux": {
- "code": " setData(graph: VizGraph, tab: \"context\" | \"code\"): void {\n this.tab = tab;\n const prev = new Map(this.nodes.map((n) => [n.id, n]));\n const deg: Record<string, number> = {};\n for (const e of graph.edges) {\n deg[e.source] = (deg[e.source] ?? 0) + 1;\n deg[e.target] = (deg[e.target] ?? 0) + 1;\n }\n const W = this.svg.clientWidth || 800;\n const H = this.svg.clientHeight || 600;\n this.nodes = graph.nodes.map((n, i) => {\n const p = prev.get(n.id);",
- "span": "L94-L105"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.tick",
- "name": "tick",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L166-L182",
- "signature": "private tick(): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "0fbefdd43e29e9d5134e756074fe1fa190fa23cf6afaa72a52d27f098ac8e6bb",
- "summary_state": "ready",
- "summary": "Updates the positions of nodes and edges on each simulation tick, ensuring the graph remains interactive.",
- "crux": {
- "code": " private tick(): void {\n for (const { path, label, edge } of this.edgeEls) {\n const a = edge.source, b = edge.target;\n const dx = (b.x ?? 0) - (a.x ?? 0), dy = (b.y ?? 0) - (a.y ?? 0);\n const d = Math.sqrt(dx * dx + dy * dy) || 1;\n const ux = dx / d, uy = dy / d;\n const sx = (a.x ?? 0) + ux * (a.r + 2), sy = (a.y ?? 0) + uy * (a.r + 2);\n const tx = (b.x ?? 0) - ux * (b.r + 6), ty = (b.y ?? 0) - uy * (b.r + 6);\n const mx = (sx + tx) / 2 - uy * 10, my = (sy + ty) / 2 + ux * 10;\n path.setAttribute(\"d\", `M${sx},${sy} Q${mx},${my} ${tx},${ty}`);\n label.setAttribute(\"x\", String((sx + tx) / 2 - uy * 14));\n label.setAttribute(\"y\", String((sy + ty) / 2 + ux * 14));",
- "span": "L166-L177"
- }
- },
- {
- "id": "viewer/graph.ts#GraphView.zoomBy",
- "name": "zoomBy",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L272-L279",
- "signature": "zoomBy(factor: number): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "2dd28ba55cc461ab1f950d582e10b63c6862804f17d518ef346fe4e3f49af289",
- "summary_state": "ready",
- "summary": "Adjusts the zoom level of the graph view based on user input, allowing for detailed exploration.",
- "crux": {
- "code": " zoomBy(factor: number): void {\n const W = this.svg.clientWidth / 2, H = this.svg.clientHeight / 2;\n const k = Math.max(0.35, Math.min(3, this.view.k * factor));\n this.view.x = W - (W - this.view.x) * (k / this.view.k);\n this.view.y = H - (H - this.view.y) * (k / this.view.k);\n this.view.k = k;\n this.applyView();\n }",
- "span": "L272-L279"
- }
- },
- {
- "id": "viewer/graph.ts#SimEdge",
- "name": "SimEdge",
- "kind": "interface",
- "path": "viewer/graph.ts",
- "span": "L32-L38",
- "signature": "interface SimEdge",
- "exported": false,
- "origin": "ast",
- "body_hash": "06690141adf5c47ffc6dd6b55a3cf9f041a4750f0b512cf49d3596928485fca8",
- "summary_state": "ready",
- "summary": "Defines the structure of an edge in the simulation, representing the relationship between two nodes.",
- "crux": null
- },
- {
- "id": "viewer/graph.ts#SimNode",
- "name": "SimNode",
- "kind": "interface",
- "path": "viewer/graph.ts",
- "span": "L22-L30",
- "signature": "interface SimNode extends SimulationNodeDatum",
- "exported": false,
- "origin": "ast",
- "body_hash": "b000c5412e66a114ce7349ebddb8f536c040a6c6f158c641a8370ea049b6a69d",
- "summary_state": "ready",
- "summary": "Defines the structure of a node in the simulation, including its position and properties.",
- "crux": null
- },
- {
- "id": "viewer/main.ts",
- "name": "main.ts",
- "kind": "file",
- "path": "viewer/main.ts",
- "span": "L1-L233",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "ab45ce4dfe66aafbe779b71d49d6370b3fe64482307b994e857ce34d3f317325",
- "chars": 8654,
- "summary_state": "ready",
- "summary": "This file serves as the entry point for the graft visualization viewer, managing the user interface and interactions for displaying graphs.",
- "crux": {
- "code": "const view = new GraphView($(\"graphSvg\") as unknown as SVGSVGElement);",
- "span": "L21-L21"
- }
- },
- {
- "id": "viewer/main.ts#$",
- "name": "$",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L12-L12",
- "signature": "$ = <T extends HTMLElement>(id: string): T",
- "exported": false,
- "origin": "ast",
- "body_hash": "e46dd7aa9ed3186876ec11a8520b5af609af327108e045bce175d535aa9ed0e5",
- "summary_state": "ready",
- "summary": "Provides a type-safe way to retrieve HTML elements by their ID, enhancing code readability and reducing errors.",
- "crux": null
- },
- {
- "id": "viewer/main.ts#activeGraph",
- "name": "activeGraph",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L23-L25",
- "signature": "function activeGraph(): VizGraph | null",
- "exported": false,
- "origin": "ast",
- "body_hash": "71591b2a66c0aa4d34f5b96cb2f1293248bdf02f55f6a73c2ee48258f6e2c445",
- "summary_state": "ready",
- "summary": "Determines which graph is currently active based on the selected tab, facilitating the correct data display.",
- "crux": {
- "code": " return state.tab === \"context\" ? state.context : state.code;",
- "span": "L24-L24"
- }
- },
- {
- "id": "viewer/main.ts#glyphFor",
- "name": "glyphFor",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L62-L71",
- "signature": "function glyphFor(key: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "bd36f5f7c09e4d09ac342de7015c4cbda2ec86e36ab0c22716dd37b006444581",
- "summary_state": "ready",
- "summary": "Maps edge types to their corresponding visual glyphs, enhancing the graphical representation of relationships.",
- "crux": {
- "code": " const fam = key === \"part of\" ? \"structure\" : key === \"uses\" ? \"dependency\" : famOf(key.replace(/ /g, \"_\"));\n const glyphs: Record<string, string> = {\n structure: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"19\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"3\" opacity=\".5\"/></svg>',\n dependency: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"14\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.6\"/><path d=\"M14,1 L19,4 L14,7 z\" fill=\"currentColor\"/></svg>',\n contract: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"13\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.4\"/><path d=\"M13,1 L19,4 L13,7 z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.2\"/></svg>',\n association: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"19\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-dasharray=\"2 4\" opacity=\".7\"/></svg>',\n };\n return glyphs[fam];",
- "span": "L63-L70"
- }
- },
- {
- "id": "viewer/main.ts#graphTab",
- "name": "graphTab",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L27-L29",
- "signature": "function graphTab(): \"context\" | \"code\"",
- "exported": false,
- "origin": "ast",
- "body_hash": "8bf89d024fe38470c469c719795eaf902c0e903157cf7ed24fe58a85db40cea4",
- "summary_state": "ready",
- "summary": "Identifies the current graph tab, ensuring the correct context is used for rendering and interactions.",
- "crux": {
- "code": " return state.tab === \"code\" || state.tab === \"outline\" ? \"code\" : \"context\";",
- "span": "L28-L28"
- }
- },
- {
- "id": "viewer/main.ts#loadAll",
- "name": "loadAll",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L216-L223",
- "signature": "async function loadAll(): Promise<void>",
- "exported": false,
- "origin": "ast",
- "body_hash": "c896b70116fce23a9b9846a95ed257835d18d1368d091a56cec01674e36bc480",
- "summary_state": "ready",
- "summary": "Loads the context and code graphs asynchronously, ensuring the viewer is populated with the latest data.",
- "crux": {
- "code": " state.context = context;\n state.code = code;\n $(\"repoName\").textContent = context.meta.repoName ?? \"\";\n document.title = `graft viz — ${context.meta.repoName ?? \"\"}`;\n setTab(state.tab);",
- "span": "L218-L222"
- }
- },
- {
- "id": "viewer/main.ts#renderChips",
- "name": "renderChips",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L32-L60",
- "signature": "function renderChips(): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "1ef41cd967e509d6342b72755564e0975cb6b87edfcc2911fe79404f906eddcb",
- "summary_state": "ready",
- "summary": "Generates and displays interactive chips for graph edges, allowing users to filter and manage edge visibility.",
- "crux": {
- "code": " const graph = activeGraph();\n if (!graph) return;\n const counts = new Map<string, number>();\n for (const e of graph.edges) {\n const key = chipKey(e.relation);\n counts.set(key, (counts.get(key) ?? 0) + 1);\n }\n const keys = [...counts.keys()].sort((a, b) => {\n const rank = (k: string) => (k === \"part of\" ? 0 : k === \"uses\" ? 1 : 2);\n return rank(a) - rank(b) || a.localeCompare(b);\n });\n for (const key of keys) {",
- "span": "L35-L46"
- }
- },
- {
- "id": "viewer/main.ts#renderChips.rank",
- "name": "rank",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L43-L43",
- "signature": "rank = (k: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "2b14b986fe4648076445602ac03c0f7c788760e8910fa9322617251aa60af5ce",
- "summary_state": "ready",
- "summary": "Establishes a ranking system for edge types to ensure they are displayed in a meaningful order.",
- "crux": {
- "code": " const rank = (k: string) => (k === \"part of\" ? 0 : k === \"uses\" ? 1 : 2);",
- "span": "L43-L43"
- }
- },
- {
- "id": "viewer/main.ts#renderLegend",
- "name": "renderLegend",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L74-L94",
- "signature": "function renderLegend(): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "ec1a1aba1d086d035890c60aadf98d7418c018c5488f106100102deaf0eafc01",
- "summary_state": "ready",
- "summary": "Creates a legend for node types in the graph, providing users with context about the displayed data.",
- "crux": {
- "code": " const graph = activeGraph();\n if (!graph) return;\n const counts = new Map<string, number>();\n for (const n of graph.nodes) counts.set(n.type, (counts.get(n.type) ?? 0) + 1);\n for (const [type, count] of counts) {\n const chip = document.createElement(\"button\");\n chip.type = \"button\";\n chip.className = \"lchip\" + (view.hiddenTypes[type] ? \" off\" : \"\");\n chip.innerHTML = `<span class=\"sw\" style=\"background:${cvar(colorToken(graphTab(), type))}\"></span>${type} <span style=\"color:var(--muted);font-weight:500\">${count}</span>`;\n chip.addEventListener(\"click\", () => {\n view.hiddenTypes[type] = !view.hiddenTypes[type];\n renderLegend();",
- "span": "L77-L88"
- }
- },
- {
- "id": "viewer/main.ts#setTab",
- "name": "setTab",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L129-L167",
- "signature": "function setTab(tab: Tab): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "c269ec25c7011b7343bdcec22729b23b0c65a57255598ac5145a46397809b321",
- "summary_state": "ready",
- "summary": "Handles the logic for switching between different graph views, ensuring the UI reflects the current context accurately.",
- "crux": {
- "code": " state.tab = tab;\n document.querySelectorAll<HTMLButtonElement>(\".tab\").forEach((b) => {\n b.setAttribute(\"aria-selected\", b.dataset.tab === tab ? \"true\" : \"false\");\n });\n const isOutline = tab === \"outline\";\n $(\"canvasWrap\").hidden = isOutline;\n $(\"outlineView\").hidden = !isOutline;\n view.hiddenRels = {};\n view.hiddenTypes = {};\n view.selected = null;\n showDetail(null);\n",
- "span": "L130-L141"
- }
- },
- {
- "id": "viewer/main.ts#showDetail",
- "name": "showDetail",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L115-L124",
- "signature": "function showDetail(id: string | null): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "e2b6f6a27ee1e3bac515ec8140678caa7c6cff3baab943cf43f8fdbdd7ab2e62",
- "summary_state": "ready",
- "summary": "Displays detailed information about a selected graph element, enhancing user interaction and understanding.",
- "crux": {
- "code": " view.focus(next);\n }\n });",
- "span": "L121-L123"
- }
- },
- {
- "id": "viewer/main.ts#showEmpty",
- "name": "showEmpty",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L169-L173",
- "signature": "function showEmpty(html: string): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "981ef1b3d68cfcc89b2804a326c87ce023df618bfee612f158fa72291fe7a6d1",
- "summary_state": "ready",
- "summary": "Displays a message when no graph data is available, guiding users on how to generate the necessary data.",
- "crux": {
- "code": " empty.innerHTML = html;\n empty.hidden = false;",
- "span": "L171-L172"
- }
- },
- {
- "id": "viewer/main.ts#Tab",
- "name": "Tab",
- "kind": "type",
- "path": "viewer/main.ts",
- "span": "L10-L10",
- "signature": "type Tab = \"context\" | \"code\" | \"outline\";",
- "exported": false,
- "origin": "ast",
- "body_hash": "4cd3b4afb6647f09ba09efccca7c53a333edbebe109fb1e24db04aa24df610de",
- "summary_state": "ready",
- "summary": "Defines the possible tab types for the viewer, ensuring that only valid tab selections are made.",
- "crux": null
- },
- {
- "id": "viewer/main.ts#updateCounts",
- "name": "updateCounts",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L103-L112",
- "signature": "function updateCounts(): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "170a2eec2d377c150839d170cd45a244584ecc9fdbd44ad194e8cac97fdfafb6",
- "summary_state": "ready",
- "summary": "Refreshes the displayed counts of nodes and edges based on the active graph, ensuring accurate information is presented.",
- "crux": {
- "code": " el.textContent = graph ? `${graph.meta.nodeCount} nodes · ${graph.meta.edgeCount} links` : \"\";",
- "span": "L110-L110"
- }
- },
- {
- "id": "viewer/main.ts#updateShownCount",
- "name": "updateShownCount",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L96-L101",
- "signature": "function updateShownCount(): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "11ab0ffa5da9e8d010f80cb1f95962900b0649019b7876e2b5213b85605d75ee",
- "summary_state": "ready",
- "summary": "Updates the displayed count of visible nodes in the graph, helping users understand the current view's scope.",
- "crux": {
- "code": " const shown = graph.nodes.filter((n) => !view.hiddenTypes[n.type]).length;\n $(\"lcount\").textContent = `${shown} / ${graph.nodes.length} nodes shown`;",
- "span": "L99-L100"
- }
- },
- {
- "id": "viewer/tree.ts",
- "name": "tree.ts",
- "kind": "file",
- "path": "viewer/tree.ts",
- "span": "L1-L67",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "d66e0157f4c2a1525c16505306eb3aabce82565c3d0e56199ea5b7a860290b01",
- "chars": 2750,
- "summary_state": "ready",
- "summary": "Generates a collapsible tree view of a code graph's hierarchy, allowing users to navigate through files, classes, and methods.",
- "crux": {
- "code": " host.innerHTML =\n '<div class=\"tree-tools\"><button data-tool=\"expand\">Expand all</button><button data-tool=\"collapse\">Collapse all</button></div>' +\n files.map(row).join(\"\");",
- "span": "L44-L46"
- }
- },
- {
- "id": "viewer/tree.ts#esc",
- "name": "esc",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L7-L9",
- "signature": "function esc(s: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "9fb927f7f1c881ee1fe325c0dc8a25b8c5cdb2c101b08ae935a35bb428f5bbdb",
- "summary_state": "ready",
- "summary": "Escapes special HTML characters in a string to prevent rendering issues in the tree view.",
- "crux": {
- "code": " return s.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\");\n}",
- "span": "L8-L9"
- }
- },
- {
- "id": "viewer/tree.ts#renderOutline",
- "name": "renderOutline",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L11-L66",
- "signature": "function renderOutline( host: HTMLElement, graph: VizGraph, selected: string | null, openState: Record<string, boolean>, onSelect: (id: string) => void, ): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "1448ed396d7ec6d8adc0e375aba7be5465c4e4db6d4184c6b5b01ac5a0788591",
- "summary_state": "ready",
- "summary": "Renders the outline view of the code graph, managing the display of files and their hierarchical relationships.",
- "crux": {
- "code": " const kids = (pid: string) =>\n graph.edges\n .filter((e) => e.relation === \"contains\" && e.source === pid)\n .map((e) => graph.nodes.find((n) => n.id === e.target))\n .filter((n): n is NonNullable<typeof n> => Boolean(n));",
- "span": "L18-L22"
- }
- },
- {
- "id": "viewer/tree.ts#renderOutline.countDesc",
- "name": "countDesc",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L23-L26",
- "signature": "countDesc = (pid: string): number",
- "exported": true,
- "origin": "ast",
- "body_hash": "1054af458d2de230dfb45cea7a5a0141f2f4d12521ee04f0919e7defdea719dd",
- "summary_state": "ready",
- "summary": "Counts the total number of descendant nodes for a given parent node, including its children and their descendants.",
- "crux": {
- "code": " return k.length + k.reduce((sum, c) => sum + countDesc(c.id), 0);\n };",
- "span": "L25-L26"
- }
- },
- {
- "id": "viewer/tree.ts#renderOutline.kids",
- "name": "kids",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L18-L22",
- "signature": "kids = (pid: string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "67a4d31f225a0006966aa2a39bdf245c514475f777082275626585879ce9b867",
- "summary_state": "ready",
- "summary": "Retrieves the child nodes of a given parent node in the graph based on the 'contains' relationship.",
- "crux": {
- "code": " .filter((e) => e.relation === \"contains\" && e.source === pid)\n .map((e) => graph.nodes.find((n) => n.id === e.target))",
- "span": "L20-L21"
- }
- },
- {
- "id": "viewer/tree.ts#renderOutline.row",
- "name": "row",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L29-L42",
- "signature": "row = (node: (typeof files)[number]): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "a62af44af8ff57bd1307237e130956ce85cb42fc0c2fc4889907fd4e87e75ab2",
- "summary_state": "ready",
- "summary": "Constructs the HTML representation of a tree row for a given node, including its children and symbol count.",
- "crux": {
- "code": " const children = kids(node.id);\n const open = openState[node.id] !== false;\n let html = `<button class=\"tree-row${open ? \" open\" : \"\"}${selected === node.id ? \" sel\" : \"\"}\"` +\n ` data-id=\"${esc(node.id)}\" data-haskids=\"${children.length ? 1 : 0}\">` +\n `<span class=\"chev\">${children.length ? \"▶\" : \"\"}</span>` +\n `<span class=\"k\" style=\"background:${cvar(colorToken(\"code\", node.type))}\"></span>` +\n `<span class=\"t${node.type === \"file\" ? \" mono\" : \"\"}\">${esc(node.name)}</span>` +\n `<span class=\"badge\">${children.length ? countDesc(node.id) + \" sym\" : esc(node.type)}</span></button>`;\n if (children.length && open) {\n html += `<div class=\"tree-kids\">${children.map(row).join(\"\")}</div>`;\n }\n return html;",
- "span": "L30-L41"
- }
- }
- ],
- "edges": [
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#AgentResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#globToRegExp",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#listFiles",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#runAgent",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#RunAgentOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#runTool",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#safePath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "bench/llm.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#listFiles",
- "target": "bench/agent.ts#listFiles.walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#listFiles",
- "target": "bench/agent.ts#listFiles.walk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#listFiles.walk",
- "target": "bench/agent.ts#listFiles.walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runAgent",
- "target": "bench/agent.ts#runAgent.slideCacheBreakpoint",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runAgent",
- "target": "bench/agent.ts#runTool",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runAgent",
- "target": "bench/llm.ts#makeChatModel",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/agent.ts#runAgent",
- "target": "bench/agent.ts#runAgent.slideCacheBreakpoint",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runTool",
- "target": "bench/agent.ts#globToRegExp",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runTool",
- "target": "bench/agent.ts#listFiles",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runTool",
- "target": "bench/agent.ts#safePath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/agent.ts#runTool",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/agent.ts#runTool",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/agent.ts#runTool",
- "target": "src/ask/ask.ts#formatSkeleton",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/agent.ts#runTool",
- "target": "src/ask/ask.ts#skeleton",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#extractJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#judge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#JudgeInput",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#Verdict",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "bench/llm.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts#judge",
- "target": "bench/judge.ts#extractJson",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/judge.ts#judge",
- "target": "bench/llm.ts#makeChatModel",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/llm.ts",
- "target": "bench/llm.ts#makeChatModel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/llm.ts",
- "target": "src/ai/llm/factory.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/llm.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/llm.ts",
- "target": "src/ai/providers.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/llm.ts#makeChatModel",
- "target": "src/ai/llm/factory.ts#createChatModel",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/llm.ts#makeChatModel",
- "target": "src/ai/providers.ts#resolveConfig",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#aggregate",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#Arm",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#ArmAgg",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#buildMarkdown",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#costOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#fmt",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#mean",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#metricTable",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#pctDelta",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#Row",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts",
- "target": "bench/report.ts#verdictFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#aggregate",
- "target": "bench/report.ts#costOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#aggregate",
- "target": "bench/report.ts#mean",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#buildMarkdown",
- "target": "bench/report.ts#aggregate",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#buildMarkdown",
- "target": "bench/report.ts#metricTable",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#buildMarkdown",
- "target": "bench/report.ts#verdictFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#metricTable",
- "target": "bench/report.ts#aggregate",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#metricTable",
- "target": "bench/report.ts#metricTable.cells",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#metricTable",
- "target": "bench/report.ts#metricTable.cells",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/report.ts#verdictFor",
- "target": "bench/report.ts#pctDelta",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#main",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#Args",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#main",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#parseArgs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/run.ts#pool",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/agent.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/judge.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/llm.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/report.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "bench/tasks.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "dotenv/config",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "src/ai/providers.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/judge.ts#judge",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/llm.ts#makeChatModel",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/report.ts#buildMarkdown",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/run.ts#parseArgs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts#main",
- "target": "bench/run.ts#pool",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/run.ts#main",
- "target": "src/ai/providers.ts#resolveConfig",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#main",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#main",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#main",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/run.ts#pool",
- "target": "bench/run.ts#pool.worker",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/selfcheck.ts#main",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/selfcheck.ts#main",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/selfcheck.ts#makeStubModel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/agent.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/judge.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "bench/report.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts#main",
- "target": "bench/judge.ts#judge",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/selfcheck.ts#main",
- "target": "bench/report.ts#buildMarkdown",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/selfcheck.ts#main",
- "target": "bench/selfcheck.ts#makeStubModel",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/selfcheck.ts#makeStubModel",
- "target": "bench/selfcheck.ts#makeStubModel.create",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#repoPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#Corpus",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#repoPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#Task",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/tasks.ts",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/llm.ts#makeChatModel",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#main",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#cost",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#graftPack",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#main",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#Metrics",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#row",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#runAgent",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#runRead",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#runSearch",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/llm.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "dotenv/config",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#cost",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#graftPack",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#main.pct",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#row",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#runAgent",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#main.pct",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts#runAgent",
- "target": "bench/token-ab.ts#runRead",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "bench/token-ab.ts#runAgent",
- "target": "bench/token-ab.ts#runSearch",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "scripts/build-viewer.mjs",
- "target": "esbuild",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "scripts/build-viewer.mjs",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "scripts/build-viewer.mjs",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "scripts/build-viewer.mjs",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#ChatCruxSummarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#CruxSummarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#FileCruxInput",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#NodeCrux",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#NodeRef",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#numberLines",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#parseResults",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#userContent",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#ChatCruxSummarizer",
- "target": "src/ai/crux.ts#ChatCruxSummarizer.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#ChatCruxSummarizer",
- "target": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#ChatCruxSummarizer",
- "target": "src/ai/crux.ts#CruxSummarizer",
- "relation": "implements",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
- "target": "src/ai/crux.ts#parseResults",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
- "target": "src/ai/crux.ts#userContent",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#parseResults",
- "target": "src/ai/crux.ts#parseResults.num",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#parseResults",
- "target": "src/ai/crux.ts#parseResults.num",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/crux.ts#userContent",
- "target": "src/ai/crux.ts#numberLines",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModelOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#CacheControl",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#cc",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#normalizeUsage",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#toAnthropicTool",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts",
- "target": "@anthropic-ai/sdk",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.assistantParam",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.fromResponse",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "target": "src/ai/llm/types.ts#ChatModel",
- "relation": "implements",
- "confidence": "inferred"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.assistantParam",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.fromResponse",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "target": "src/ai/llm/anthropic.ts#cc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.fromResponse",
- "target": "src/ai/llm/anthropic.ts#normalizeUsage",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/factory.ts#ChatModelConfig",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/factory.ts#createChatModel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/factory.ts#ProviderKind",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/anthropic.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/openai.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#ChatMessage",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#ChatParams",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#normalizeUsage",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#OpenAIChatModelOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#textPart",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#toChatMessage",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#toChatTool",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts",
- "target": "openai",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts#OpenAIChatModel",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts#OpenAIChatModel",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.create",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts#OpenAIChatModel",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts#OpenAIChatModel",
- "target": "src/ai/llm/types.ts#ChatModel",
- "relation": "implements",
- "confidence": "inferred"
- },
- {
- "source": "src/ai/llm/openai.ts#OpenAIChatModel.create",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.create",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts#OpenAIChatModel.create",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
- "target": "src/ai/llm/openai.ts#normalizeUsage",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse.parse",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse.parse",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/openai.ts#toChatMessage",
- "target": "src/ai/llm/openai.ts#textPart",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ChatModel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ChatRequest",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ChatResponse",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#Message",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ResponseFormat",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ToolCall",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ToolSpec",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#Usage",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/providers.ts#EngineConfig",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/providers.ts#resolveConfig",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/providers.ts#ResolvedConfig",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/llm/factory.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/summarize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/providers.ts",
- "target": "src/ai/synthesize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts",
- "target": "src/ai/summarize.ts#ChatSummarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts",
- "target": "src/ai/summarize.ts#Summarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts",
- "target": "src/ai/summarize.ts#userContent",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts#ChatSummarizer",
- "target": "src/ai/summarize.ts#ChatSummarizer.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts#ChatSummarizer",
- "target": "src/ai/summarize.ts#ChatSummarizer.summarize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts#ChatSummarizer",
- "target": "src/ai/summarize.ts#Summarizer",
- "relation": "implements",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/summarize.ts#ChatSummarizer.summarize",
- "target": "src/ai/summarize.ts#userContent",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#ChatSynthesizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#clean",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#FileSummary",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#Synthesizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#SynthLink",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#SynthNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#userContent",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts#ChatSynthesizer",
- "target": "src/ai/synthesize.ts#ChatSynthesizer.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts#ChatSynthesizer",
- "target": "src/ai/synthesize.ts#ChatSynthesizer.synthesize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts#ChatSynthesizer",
- "target": "src/ai/synthesize.ts#Synthesizer",
- "relation": "implements",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts#ChatSynthesizer.synthesize",
- "target": "src/ai/synthesize.ts#clean",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ai/synthesize.ts#ChatSynthesizer.synthesize",
- "target": "src/ai/synthesize.ts#userContent",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#ask",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#AskHit",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#AskOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#AskResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#askSavingsFooter",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#baselineFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#bm25",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#computeIdf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#computeIdfFromIndex",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#Corpus",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#escalationNudge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#fallthroughNoteFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#findSubjectNodes",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#firstProse",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#formatSkeleton",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#hasTerm",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#hitFiles",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#idfFromDf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#inlineSource",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#lexical",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#loadCorpus",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#matchedIdfShare",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#parseSpan",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#scopeFooterLines",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#score",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#skeleton",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#SkeletonEntry",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#SkeletonResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#sliceSpan",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#strongShare",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#structural",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#StructuralOutcome",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#subjectWords",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#toTokens",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "gray-matter",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/fuse.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/graphrank.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/ask/index-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/context/savings.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/graph/scopes.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/graph/traverse.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#ask",
- "target": "src/ask/ask.ts#baselineFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#ask",
- "target": "src/ask/ask.ts#inlineSource",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#ask",
- "target": "src/ask/ask.ts#lexical",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#ask",
- "target": "src/ask/ask.ts#loadCorpus",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#ask",
- "target": "src/ask/ask.ts#structural",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#ask",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#ask",
- "target": "src/graph/scopes.ts#pathUnderPrefix",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#ask",
- "target": "src/graph/scopes.ts#scopesHereClause",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#ask",
- "target": "src/graph/scopes.ts#scopesOfGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#askSavingsFooter",
- "target": "src/ask/ask.ts#toTokens",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#baselineFor",
- "target": "src/ask/ask.ts#hitFiles",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#baselineFor",
- "target": "src/context/savings.ts#savingsFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#computeIdf",
- "target": "src/ask/ask.ts#idfFromDf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#computeIdfFromIndex",
- "target": "src/ask/ask.ts#idfFromDf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#findSubjectNodes",
- "target": "src/ask/ask.ts#subjectWords",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#findSubjectNodes",
- "target": "src/graph/scopes.ts#pathUnderPrefix",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#findSubjectNodes",
- "target": "src/graph/traverse.ts#resolveSymbol",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#formatAsk",
- "target": "src/ask/ask.ts#askSavingsFooter",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#formatAsk",
- "target": "src/ask/ask.ts#escalationNudge",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#formatAsk",
- "target": "src/ask/ask.ts#scopeFooterLines",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#formatSkeleton",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#hitFiles",
- "target": "src/ask/ask.ts#parseSpan",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#inlineSource",
- "target": "src/ask/ask.ts#parseSpan",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#inlineSource",
- "target": "src/ask/ask.ts#sliceSpan",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#bm25",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#computeIdf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#computeIdfFromIndex",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#lexical.bodyLen",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#matchedIdfShare",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#score",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#strongShare",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/fuse.ts#rankScopesAndFuse",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/graphrank.ts#personalizedPageRank",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/index-file.ts#counts",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/index-file.ts#tokenize",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/graph/scopes.ts#pathUnderPrefix",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/graph/scopes.ts#scopeOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/graph/scopes.ts#scopesHereClause",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/graph/scopes.ts#scopesOfGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#lexical.bodyLen",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#loadCorpus",
- "target": "src/ask/ask.ts#firstProse",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#loadCorpus",
- "target": "src/graph/load.ts#loadAskIndexCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#loadCorpus",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#matchedIdfShare",
- "target": "src/ask/ask.ts#hasTerm",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#scopeFooterLines",
- "target": "src/graph/scopes.ts#scopeLabel",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#skeleton",
- "target": "src/ask/ask.ts#skeleton.startLine",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#skeleton",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#skeleton",
- "target": "src/context/savings.ts#savingsFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#skeleton",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/ask/ask.ts#skeleton",
- "target": "src/ask/ask.ts#skeleton.startLine",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#strongShare",
- "target": "src/ask/ask.ts#matchedIdfShare",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#structural",
- "target": "src/ask/ask.ts#fallthroughNoteFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#structural",
- "target": "src/ask/ask.ts#findSubjectNodes",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#byScore",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#fuseScopes",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#FusionResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#rankScopesAndFuse",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#ScopedDoc",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#ScopeRankOps",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/fuse.ts#rankScopesAndFuse",
- "target": "src/ask/fuse.ts#fuseScopes",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/graphrank.ts",
- "target": "src/ask/graphrank.ts#PageRankOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/graphrank.ts",
- "target": "src/ask/graphrank.ts#personalizedPageRank",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/graphrank.ts",
- "target": "src/graph/relations.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/graphrank.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/graphrank.ts#personalizedPageRank",
- "target": "src/ask/graphrank.ts#personalizedPageRank.link",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/graphrank.ts#personalizedPageRank",
- "target": "src/ask/graphrank.ts#personalizedPageRank.link",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#AskIndex",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#AskIndexDoc",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#askIndexPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#bagLen",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#counts",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#pairs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#readAskIndex",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#tokenize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#writeAskIndex",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts#readAskIndex",
- "target": "src/ask/index-file.ts#askIndexPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts#writeAskIndex",
- "target": "src/ask/index-file.ts#askIndexPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts#writeAskIndex",
- "target": "src/ask/index-file.ts#bagLen",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts#writeAskIndex",
- "target": "src/ask/index-file.ts#counts",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts#writeAskIndex",
- "target": "src/ask/index-file.ts#pairs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/index-file.ts#writeAskIndex",
- "target": "src/ask/index-file.ts#tokenize",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#AskJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#enrichedSegment",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#formatBlastRadius",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#formatOrientation",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#formatRetrieval",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#freshnessSegment",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#incomingEdges",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#nodeIdsInFile",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#relevantRetrieval",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#renderStatusline",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#renderSubagent",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#retrievalBody",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#retrievalTokensSaved",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#tokensOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts#formatBlastRadius",
- "target": "src/claude/format.ts#incomingEdges",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts#formatRetrieval",
- "target": "src/claude/format.ts#retrievalBody",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts#formatRetrieval",
- "target": "src/claude/format.ts#retrievalTokensSaved",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts#formatRetrieval",
- "target": "src/claude/format.ts#tokensOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts#incomingEdges",
- "target": "src/claude/format.ts#nodeIdsInFile",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts#relevantRetrieval",
- "target": "src/claude/format.ts#formatRetrieval",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts#renderStatusline",
- "target": "src/claude/format.ts#enrichedSegment",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts#renderStatusline",
- "target": "src/claude/format.ts#freshnessSegment",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts#retrievalTokensSaved",
- "target": "src/claude/format.ts#retrievalBody",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts#retrievalTokensSaved",
- "target": "src/claude/format.ts#tokensOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#checkStaleCount",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#emit",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#graftJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#handlePostEdit",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#handleStop",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#handleToolSavings",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#lastFileScopeHint",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#main",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#projectDir",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#readStdin",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#safeReadFd0",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#underGraft",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/format.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/paths.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/claude/stats.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts",
- "target": "src/graph/scopes.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#checkStaleCount",
- "target": "src/claude/hooks.ts#graftJson",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#graftJson",
- "target": "src/claude/paths.ts#graftCliPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/format.ts#formatBlastRadius",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/hooks.ts#checkStaleCount",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/hooks.ts#emit",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/hooks.ts#underGraft",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/state.ts#patchStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/stats.ts#readWiring",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handleStop",
- "target": "src/claude/paths.ts#claudeScriptPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handleStop",
- "target": "src/claude/state.ts#acquireLock",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handleStop",
- "target": "src/claude/state.ts#patchStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handleStop",
- "target": "src/claude/state.ts#readStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handleToolSavings",
- "target": "src/claude/state.ts#readSession",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handleToolSavings",
- "target": "src/claude/state.ts#writeSession",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#lastFileScopeHint",
- "target": "src/claude/stats.ts#readWiring",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#lastFileScopeHint",
- "target": "src/graph/scopes.ts#scopeOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#lastFileScopeHint",
- "target": "src/graph/scopes.ts#scopesOfGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/format.ts#formatOrientation",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/format.ts#relevantRetrieval",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#emit",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#graftJson",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#handlePostEdit",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#handleStop",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#handleToolSavings",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#lastFileScopeHint",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#projectDir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#readStdin",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/state.ts#readSession",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/state.ts#readStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/state.ts#writeSession",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#readStdin",
- "target": "src/claude/hooks.ts#safeReadFd0",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts",
- "target": "src/claude/init.ts#InitResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts",
- "target": "src/claude/init.ts#runInit",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts",
- "target": "src/claude/paths.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts",
- "target": "src/claude/settings-merge.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts",
- "target": "src/claude/shim-template.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts",
- "target": "src/claude/skill-template.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts",
- "target": "src/hosts/mcp-config.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/init.ts#runInit",
- "target": "src/claude/paths.ts#claudeDistDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/init.ts#runInit",
- "target": "src/claude/settings-merge.ts#mergeGraftSettings",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/init.ts#runInit",
- "target": "src/claude/shim-template.ts#hooksShim",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/init.ts#runInit",
- "target": "src/claude/shim-template.ts#statuslineShim",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/init.ts#runInit",
- "target": "src/claude/skill-template.ts#skillTemplate",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/init.ts#runInit",
- "target": "src/hosts/mcp-config.ts#mergeJsonKey",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/paths.ts",
- "target": "src/claude/paths.ts#claudeDistDir",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/paths.ts",
- "target": "src/claude/paths.ts#claudeScriptPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/paths.ts",
- "target": "src/claude/paths.ts#graftCliPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/paths.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/paths.ts",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/settings-merge.ts",
- "target": "src/claude/settings-merge.ts#graftBlocks",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/settings-merge.ts",
- "target": "src/claude/settings-merge.ts#hookCmd",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/settings-merge.ts",
- "target": "src/claude/settings-merge.ts#isGraftHookEntry",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/settings-merge.ts",
- "target": "src/claude/settings-merge.ts#Json",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/settings-merge.ts",
- "target": "src/claude/settings-merge.ts#mergeGraftSettings",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/settings-merge.ts#graftBlocks",
- "target": "src/claude/settings-merge.ts#hookCmd",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/settings-merge.ts#mergeGraftSettings",
- "target": "src/claude/settings-merge.ts#graftBlocks",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/settings-merge.ts#mergeGraftSettings",
- "target": "src/claude/settings-merge.ts#isGraftHookEntry",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/shim-template.ts",
- "target": "src/claude/shim-template.ts#hooksShim",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/shim-template.ts",
- "target": "src/claude/shim-template.ts#shim",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/shim-template.ts",
- "target": "src/claude/shim-template.ts#statuslineShim",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/shim-template.ts#hooksShim",
- "target": "src/claude/shim-template.ts#shim",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/shim-template.ts#statuslineShim",
- "target": "src/claude/shim-template.ts#shim",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/skill-template.ts",
- "target": "src/claude/skill-template.ts#skillTemplate",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#acquireLock",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#cacheDir",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#emptySession",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#emptyStats",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#lockPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#patchStats",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#readJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#readSession",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#readStats",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#releaseLock",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#sessionPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#SessionState",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#Stats",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#statsPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#writeJsonAtomic",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#writeSession",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#writeStats",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#acquireLock",
- "target": "src/claude/state.ts#cacheDir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#acquireLock",
- "target": "src/claude/state.ts#lockPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#lockPath",
- "target": "src/claude/state.ts#cacheDir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#patchStats",
- "target": "src/claude/state.ts#emptyStats",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#patchStats",
- "target": "src/claude/state.ts#readStats",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#patchStats",
- "target": "src/claude/state.ts#writeStats",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#readSession",
- "target": "src/claude/state.ts#emptySession",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#readSession",
- "target": "src/claude/state.ts#readJson",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#readSession",
- "target": "src/claude/state.ts#sessionPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#readStats",
- "target": "src/claude/state.ts#readJson",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#readStats",
- "target": "src/claude/state.ts#statsPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#releaseLock",
- "target": "src/claude/state.ts#lockPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#sessionPath",
- "target": "src/claude/state.ts#cacheDir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#statsPath",
- "target": "src/claude/state.ts#cacheDir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#writeSession",
- "target": "src/claude/state.ts#sessionPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#writeSession",
- "target": "src/claude/state.ts#writeJsonAtomic",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#writeStats",
- "target": "src/claude/state.ts#statsPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/state.ts#writeStats",
- "target": "src/claude/state.ts#writeJsonAtomic",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/stats.ts",
- "target": "src/claude/stats.ts#computeStats",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/stats.ts",
- "target": "src/claude/stats.ts#readWiring",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/stats.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/stats.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/stats.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/stats.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/statusline.ts",
- "target": "src/claude/statusline.ts#main",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/statusline.ts",
- "target": "src/claude/statusline.ts#resolveStats",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/statusline.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/statusline.ts",
- "target": "src/claude/format.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/statusline.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/statusline.ts",
- "target": "src/claude/stats.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/statusline.ts#main",
- "target": "src/claude/format.ts#renderStatusline",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/statusline.ts#main",
- "target": "src/claude/format.ts#renderSubagent",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/statusline.ts#main",
- "target": "src/claude/state.ts#readSession",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/statusline.ts#main",
- "target": "src/claude/statusline.ts#resolveStats",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/statusline.ts#resolveStats",
- "target": "src/claude/state.ts#emptyStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/statusline.ts#resolveStats",
- "target": "src/claude/state.ts#readStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/statusline.ts#resolveStats",
- "target": "src/claude/stats.ts#computeStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/statusline.ts#resolveStats",
- "target": "src/claude/stats.ts#readWiring",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/sync-run.ts#main",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/sync-run.ts#main",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/sync-run.ts#realBuild",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/sync-run.ts#runSync",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/sync-run.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/sync-run.ts",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/paths.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/stats.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/sync-run.ts#main",
- "target": "src/claude/sync-run.ts#runSync",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/sync-run.ts#realBuild",
- "target": "src/claude/paths.ts#graftCliPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/sync-run.ts#runSync",
- "target": "src/claude/state.ts#patchStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/sync-run.ts#runSync",
- "target": "src/claude/state.ts#releaseLock",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/sync-run.ts#runSync",
- "target": "src/claude/stats.ts#computeStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/sync-run.ts#runSync",
- "target": "src/claude/stats.ts#readWiring",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli-epilogue.ts",
- "target": "src/cli-epilogue.ts#formatInitEpilogue",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-epilogue.ts",
- "target": "src/cli-epilogue.ts#indigo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-epilogue.ts",
- "target": "src/cli-epilogue.ts#InitEpilogueOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-epilogue.ts",
- "target": "src/cli-epilogue.ts#muted",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-epilogue.ts",
- "target": "src/cli-epilogue.ts#Step",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-epilogue.ts#formatInitEpilogue",
- "target": "src/cli-epilogue.ts#indigo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-epilogue.ts#formatInitEpilogue",
- "target": "src/cli-epilogue.ts#muted",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#formatUpgradeReport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#formatVersionReport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#getNpmViewVersion",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#globalRoot",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#isRunningViaNpx",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#NpmViewResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#readCurrentVersion",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#readGlobalInstalledVersion",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#resolvePackageJsonPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#runUpgrade",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#UpgradeResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts#readCurrentVersion",
- "target": "src/cli-meta.ts#resolvePackageJsonPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts#readGlobalInstalledVersion",
- "target": "src/cli-meta.ts#globalRoot",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts#runUpgrade",
- "target": "src/cli-meta.ts#getNpmViewVersion",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts#runUpgrade",
- "target": "src/cli-meta.ts#isRunningViaNpx",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts#runUpgrade",
- "target": "src/cli-meta.ts#readCurrentVersion",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli-meta.ts#runUpgrade",
- "target": "src/cli-meta.ts#readGlobalInstalledVersion",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/ai/providers.ts#resolveConfig",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/ask/ask.ts#formatSkeleton",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/ask/ask.ts#skeleton",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/claude/init.ts#runInit",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli-epilogue.ts#formatInitEpilogue",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts#formatUpgradeReport",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts#formatVersionReport",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts#getNpmViewVersion",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts#readCurrentVersion",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts#runUpgrade",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#cliConfig",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#engineFrom",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#fmt",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/context/check.ts#formatCheckReport",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.check",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.checkGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.graph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.init",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/check.ts#formatGraphCheckReport",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/map.ts#buildRepoMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/map.ts#formatRepoMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/traverse-cli.ts#runCallersCommand",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceBuild",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceCallers",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceCheck",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceGrep",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/workspace.ts#isWorkspaceBuildRoot",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/workspace.ts#readWorkspace",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/hosts/init.ts#runHostsInit",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/hosts/registry.ts#hostIds",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/mcp/server.ts#startMcpServer",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/search/grep-cli.ts#runGrepCommand",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/viz/serve.ts#startVizServer",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#cliConfig",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#engineFrom",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#fmt",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli.ts#GlobalOpts",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "commander",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "dotenv/config",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/ai/llm/factory.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/ai/providers.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/claude/init.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli-epilogue.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/context/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/engine.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/workspace-cli.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/graph/workspace.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/hosts/init.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts",
- "target": "src/hosts/registry.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/cli.ts#engineFrom",
- "target": "src/cli.ts#cliConfig",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#batchBySize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#batchKey",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildCache",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#buildContext",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildProgress",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#cachePath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#errMsg",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#FileWork",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#loadCache",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#mapWithConcurrency",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#NodeDraft",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#registerName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#resolveSlug",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#saveCache",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/ai/summarize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/ai/synthesize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#batchKey",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#batchBySize",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#batchKey",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#errMsg",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#loadCache",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#mapWithConcurrency",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#registerName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#resolveSlug",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#saveCache",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#deleteNode",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#digestSources",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#existingNodeSlugs",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#slugify",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#writeManifest",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#writeNode",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#buildContext",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#loadCache",
- "target": "src/context/build.ts#cachePath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/build.ts#registerName",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/build.ts#saveCache",
- "target": "src/context/build.ts#cachePath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#checkContext",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#CheckOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#CheckResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#formatCheckReport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#short",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/check.ts#short",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/node-file.ts#readManifest",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/node-file.ts#readNodes",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#ContextNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#defaultHuman",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#deleteNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#digestSources",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#existingNodeSlugs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#Manifest",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#NodeLink",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#ParsedNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#preserveHuman",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#readManifest",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#readNodes",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#renderGenerated",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#renderNodeFile",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#slugify",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#SourceRef",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#writeManifest",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#writeNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "gray-matter",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts#digestSources",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/node-file.ts#preserveHuman",
- "target": "src/context/node-file.ts#defaultHuman",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts#renderNodeFile",
- "target": "src/context/node-file.ts#renderGenerated",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts#slugify",
- "target": "src/util/id.ts#normalizeName",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/node-file.ts#writeNode",
- "target": "src/context/node-file.ts#defaultHuman",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts#writeNode",
- "target": "src/context/node-file.ts#preserveHuman",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/node-file.ts#writeNode",
- "target": "src/context/node-file.ts#renderNodeFile",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/savings.ts",
- "target": "src/context/savings.ts#fileSizes",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/savings.ts",
- "target": "src/context/savings.ts#Savings",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/savings.ts",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/savings.ts",
- "target": "src/context/savings.ts#savingsFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/savings.ts",
- "target": "src/context/savings.ts#toTokens",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/context/savings.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/savings.ts#savingsFooter",
- "target": "src/context/savings.ts#toTokens",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/savings.ts#savingsFor",
- "target": "src/context/savings.ts#fileSizes",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/engine.ts#CheckRunOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/engine.ts#Graft",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/engine.ts#GraphRunOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/engine.ts#InitOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ai/llm/factory.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ai/providers.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ai/summarize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ai/synthesize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/context/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/context/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts",
- "target": "src/graph/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.ask",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.chatModel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.check",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.checkGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.cruxSummarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.graph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.init",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.modelLabel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.summarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.synthesizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.ask",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.chatModel",
- "target": "src/ai/llm/factory.ts#createChatModel",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.check",
- "target": "src/context/check.ts#checkContext",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.checkGraph",
- "target": "src/graph/check.ts#checkGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.constructor",
- "target": "src/ai/providers.ts#resolveConfig",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.cruxSummarizer",
- "target": "src/engine.ts#Graft.chatModel",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.graph",
- "target": "src/engine.ts#Graft.cruxSummarizer",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.graph",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.init",
- "target": "src/context/build.ts#buildContext",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/engine.ts#Graft.init",
- "target": "src/engine.ts#Graft.modelLabel",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.init",
- "target": "src/engine.ts#Graft.summarizer",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.init",
- "target": "src/engine.ts#Graft.synthesizer",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.summarizer",
- "target": "src/engine.ts#Graft.chatModel",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/engine.ts#Graft.synthesizer",
- "target": "src/engine.ts#Graft.chatModel",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#callTypeName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#collectAliases",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#collectBindings",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#defName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#FileBindings",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#goReceiverTypeOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#goReceiverVarOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#handleGo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#handlePy",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#handleTs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#isClassNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#pyTypeName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#resolveAlias",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#resolveRecvType",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#tsAnnotationTypeName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#tsNewTypeName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#visit",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "tree-sitter",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#collectAliases",
- "target": "src/graph/bindings.ts#collectAliases",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#collectAliases",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#collectBindings",
- "target": "src/graph/bindings.ts#collectAliases",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#collectBindings",
- "target": "src/graph/bindings.ts#visit",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#defName",
- "target": "src/graph/bindings.ts#goReceiverTypeOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#FileBindings",
- "target": "src/graph/bindings.ts#FileBindings.lookup",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#FileBindings",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handleGo",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handlePy",
- "target": "src/graph/bindings.ts#callTypeName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handlePy",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handlePy",
- "target": "src/graph/bindings.ts#pyTypeName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handleTs",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handleTs",
- "target": "src/graph/bindings.ts#tsAnnotationTypeName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handleTs",
- "target": "src/graph/bindings.ts#tsNewTypeName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#pyTypeName",
- "target": "src/graph/bindings.ts#resolveAlias",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#resolveRecvType",
- "target": "src/graph/bindings.ts#FileBindings.lookup",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#tsAnnotationTypeName",
- "target": "src/graph/bindings.ts#resolveAlias",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#defName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#handleGo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#handlePy",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#handleTs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#isClassNode",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#visit",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#applyMinSubstanceGuard",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#GraphBuildOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#GraphBuildResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#listSourceFiles",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#readGoModules",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/ask/index-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/cards.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/enrich.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/resolve.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/scopes.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts#applyMinSubstanceGuard",
- "target": "src/graph/scopes.ts#scopeOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/ask/index-file.ts#writeAskIndex",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/build.ts#applyMinSubstanceGuard",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/build.ts#listSourceFiles",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/build.ts#readGoModules",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/cards.ts#writeCards",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/cards.ts#writeCovers",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/cards.ts#writeIndex",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/enrich.ts#enrichGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/extract.ts#extractFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/resolve.ts#resolveEdges",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/scopes.ts#discoverScopes",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/write.ts#writeGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#listSourceFiles",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#listSourceFiles",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/build.ts#readGoModules",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#CardFileInfo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#cardPathFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#CardStats",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#conceptsByPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#CoverRef",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#listExistingCards",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#oneLiner",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#pruneEmptyDirs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#renderCard",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#spanStart",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#writeCards",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#writeCovers",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#writeIndex",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "gray-matter",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#conceptsByPath",
- "target": "src/context/node-file.ts#readNodes",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/cards.ts#listExistingCards",
- "target": "src/graph/cards.ts#listExistingCards.walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#listExistingCards",
- "target": "src/graph/cards.ts#listExistingCards.walk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#listExistingCards.walk",
- "target": "src/graph/cards.ts#listExistingCards.walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#pruneEmptyDirs",
- "target": "src/graph/cards.ts#pruneEmptyDirs.visit",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#pruneEmptyDirs",
- "target": "src/graph/cards.ts#pruneEmptyDirs.visit",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#pruneEmptyDirs.visit",
- "target": "src/graph/cards.ts#pruneEmptyDirs.visit",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#renderCard",
- "target": "src/graph/cards.ts#oneLiner",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#renderCard",
- "target": "src/graph/cards.ts#spanStart",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#writeCards",
- "target": "src/graph/cards.ts#cardPathFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#writeCards",
- "target": "src/graph/cards.ts#conceptsByPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#writeCards",
- "target": "src/graph/cards.ts#listExistingCards",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#writeCards",
- "target": "src/graph/cards.ts#pruneEmptyDirs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#writeCards",
- "target": "src/graph/cards.ts#renderCard",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#writeCovers",
- "target": "src/graph/cards.ts#spanStart",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/cards.ts#writeIndex",
- "target": "src/context/node-file.ts#readNodes",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#checkGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#formatGraphCheckReport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#GraphCheckOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#GraphCheckResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/build.ts#listSourceFiles",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/extract.ts#extractFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#buildCrux",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#collectFileCrux",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#enrichGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#EnrichOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#EnrichStats",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#mapWithConcurrency",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#spanLines",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts#buildCrux",
- "target": "src/graph/enrich.ts#spanLines",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts#collectFileCrux",
- "target": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#buildCrux",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#collectFileCrux",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#mapWithConcurrency",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#spanLines",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#calleeName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#clean",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#DefDescriptor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#describe",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#describeGo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#extractFile",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#ExtractResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#fileResidual",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#goExported",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#goReceiverType",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#heritageEdges",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#importSpecifier",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#isImport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#Language",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#parseSource",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#pyReceiver",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#RawEdge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#searchBody",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#tsExported",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#tsReceiver",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#walk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#WalkCtx",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/bindings.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "tree-sitter",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "tree-sitter-go",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "tree-sitter-python",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts",
- "target": "tree-sitter-typescript",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#calleeName",
- "target": "src/graph/extract.ts#pyReceiver",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#calleeName",
- "target": "src/graph/extract.ts#tsReceiver",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#describe",
- "target": "src/graph/extract.ts#describeGo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#describeGo",
- "target": "src/graph/extract.ts#goReceiverType",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/graph/bindings.ts#collectBindings",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/graph/extract.ts#fileResidual",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/graph/extract.ts#parseSource",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/graph/extract.ts#walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/extract.ts#fileResidual",
- "target": "src/graph/extract.ts#searchBody",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/bindings.ts#goReceiverVarOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/bindings.ts#resolveRecvType",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#calleeName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#clean",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#describe",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#goExported",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#goReceiverType",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#heritageEdges",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#importSpecifier",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#isImport",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#searchBody",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#tsExported",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/extract.ts#walk",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#__resetParseCounts",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#CacheEntry",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#loadAskIndexCached",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#loadCached",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#statOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts",
- "target": "src/ask/index-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts#loadAskIndexCached",
- "target": "src/ask/index-file.ts#askIndexPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/load.ts#loadAskIndexCached",
- "target": "src/ask/index-file.ts#readAskIndex",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/load.ts#loadAskIndexCached",
- "target": "src/graph/load.ts#loadCached",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts#loadCached",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse.parse",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/load.ts#loadCached",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/load.ts#loadCached",
- "target": "src/graph/load.ts#statOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts#loadGraphCached",
- "target": "src/graph/load.ts#loadCached",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/load.ts#loadGraphCached",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/load.ts#loadGraphCached",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#basenameOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#buildRepoMap",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#BuildRepoMapOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#computeDirEntries",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#computeInDegree",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#DirEntry",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#dirKey",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#droppedNote",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#formatDirHub",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#formatDirLine",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#formatHotspot",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#formatRepoMap",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#Hub",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#RepoMap",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#ScopeGroup",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#sortedLanguages",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#topHubs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/context/savings.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/relations.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/scopes.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/context/savings.ts#savingsFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/map.ts#computeDirEntries",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/map.ts#computeInDegree",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/map.ts#sortedLanguages",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/map.ts#topHubs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/scopes.ts#scopeLabel",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/scopes.ts#scopeOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/scopes.ts#scopesOfGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/map.ts#computeDirEntries",
- "target": "src/graph/map.ts#computeDirEntries.depthFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#computeDirEntries",
- "target": "src/graph/map.ts#computeDirEntries.fullPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#computeDirEntries",
- "target": "src/graph/map.ts#computeDirEntries.relPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#computeDirEntries",
- "target": "src/graph/map.ts#dirKey",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#computeDirEntries",
- "target": "src/graph/map.ts#sortedLanguages",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#computeDirEntries",
- "target": "src/graph/map.ts#topHubs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#computeDirEntries",
- "target": "src/graph/map.ts#computeDirEntries.depthFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#computeDirEntries",
- "target": "src/graph/map.ts#computeDirEntries.fullPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#computeDirEntries",
- "target": "src/graph/map.ts#computeDirEntries.relPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#computeDirEntries.depthFor",
- "target": "src/graph/map.ts#dirKey",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#formatDirHub",
- "target": "src/graph/map.ts#basenameOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#formatRepoMap",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/map.ts#formatRepoMap",
- "target": "src/graph/map.ts#droppedNote",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#formatRepoMap",
- "target": "src/graph/map.ts#formatDirLine",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/map.ts#sortedLanguages",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/relations.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#GoModule",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#push",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveEdges",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveGoImport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveImport",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#ResolveOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveTypedMember",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#push",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#push",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveEdges.add",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveGoImport",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveImport",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveTypedMember",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveEdges.add",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#Candidate",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#collectDirs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#discoverScopes",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#discoverWorkspaceChildren",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#parsePnpmPackagesList",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#pathUnderPrefix",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#readWorkspaceGlobs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#resolveGlob",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#scopeLabel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#scopeOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#scopesHereClause",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#scopesOfGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#collectDirs",
- "target": "src/graph/scopes.ts#collectDirs.walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#collectDirs",
- "target": "src/graph/scopes.ts#collectDirs.walk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#collectDirs.walk",
- "target": "src/graph/scopes.ts#collectDirs.walk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#discoverScopes",
- "target": "src/graph/scopes.ts#collectDirs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#discoverScopes",
- "target": "src/graph/scopes.ts#discoverScopes.findNearestAncestorCandidate",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#discoverScopes",
- "target": "src/graph/scopes.ts#readWorkspaceGlobs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#discoverScopes",
- "target": "src/graph/scopes.ts#resolveGlob",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#discoverScopes",
- "target": "src/graph/scopes.ts#discoverScopes.findNearestAncestorCandidate",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#readWorkspaceGlobs",
- "target": "src/graph/scopes.ts#parsePnpmPackagesList",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#resolveGlob",
- "target": "src/graph/scopes.ts#resolveGlob.listDirs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#resolveGlob",
- "target": "src/graph/scopes.ts#resolveGlob.listDirs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/scopes.ts#scopesHereClause",
- "target": "src/graph/scopes.ts#scopeLabel",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#CallersCliOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#callersSavings",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#headerOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#hitJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#HitJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#hitLine",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#looseNoteFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#MatchJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#resolveDirection",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#runCallersCommand",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#symbolJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#SymbolJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/context/savings.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts#callersSavings",
- "target": "src/context/savings.ts#savingsFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#callersSavings",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#headerOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#hitLine",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#looseNoteFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#resolveDirection",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#symbolJson",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse.ts#edgeWalk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse.ts#resolveSymbol",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#calleesOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#callersOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#Direction",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#EdgeHit",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#edgeWalk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#impactOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#impactOfFile",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#impactOfMany",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#resolveSymbol",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#ResolveSymbolOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#SymbolMatch",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#symbolMatches",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#symbolsInFile",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/relations.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts#edgeWalk",
- "target": "src/graph/traverse.ts#calleesOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts#edgeWalk",
- "target": "src/graph/traverse.ts#callersOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts#edgeWalk",
- "target": "src/graph/traverse.ts#impactOfFile",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts#edgeWalk",
- "target": "src/graph/traverse.ts#impactOfMany",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts#impactOf",
- "target": "src/graph/traverse.ts#impactOfMany",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts#impactOfFile",
- "target": "src/graph/traverse.ts#impactOfMany",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts#impactOfFile",
- "target": "src/graph/traverse.ts#symbolsInFile",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts#resolveSymbol",
- "target": "src/graph/traverse.ts#symbolMatches",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Confidence",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Crux",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#EdgeV1",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#GraphV1",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Kind",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#NodeV1",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Relation",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#ScopeV1",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#SummaryState",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceAsk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceBuild",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceCallers",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceCheck",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceGrep",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/graph/workspace-cli.ts#runWorkspaceMap",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/graph/workspace-cli.ts#WorkspaceBuildOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/ai/providers.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/engine.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/graph/traverse.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts",
- "target": "src/graph/workspace.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceAsk",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceAsk",
- "target": "src/graph/workspace.ts#federateAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceBuild",
- "target": "src/graph/workspace.ts#migrationNote",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceBuild",
- "target": "src/graph/workspace.ts#splitWorkspace",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceBuild",
- "target": "src/graph/workspace-cli.ts#runWorkspaceBuild.buildChild",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceBuild.buildChild",
- "target": "src/engine.ts#Graft.graph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceBuild.buildChild",
- "target": "src/engine.ts#Graft.init",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceCallers",
- "target": "src/graph/workspace.ts#federateCallers",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceCheck",
- "target": "src/graph/workspace.ts#federateCheck",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceGrep",
- "target": "src/graph/workspace.ts#federateGrep",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceGrep",
- "target": "src/search/grep-cli.ts#formatGrepResult",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceGrep",
- "target": "src/search/grep-cli.ts#zeroHitNote",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace-cli.ts#runWorkspaceMap",
- "target": "src/graph/workspace.ts#federateMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#ChildRun",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#clearParentGraft",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#coverageNote",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#federateAsk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#FederateAskOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#federateCallers",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#federateCheck",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#federateGrep",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#federateMap",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#hasMegaGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#isWorkspaceBuildRoot",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#LoadedChild",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#migrationNote",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#prefixPointer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#readWorkspace",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#splitWorkspace",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#WorkspaceGraphs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#workspacePath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#WorkspaceV1",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/workspace.ts#writeWorkspace",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/ask/fuse.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/context/savings.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/map.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/scopes.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/traverse-cli.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/traverse.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/search/grep-cli.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts",
- "target": "src/search/grep.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#clearParentGraft",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateAsk",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateAsk",
- "target": "src/ask/fuse.ts#fuseScopes",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateAsk",
- "target": "src/graph/workspace.ts#coverageNote",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#federateAsk",
- "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#federateAsk",
- "target": "src/graph/workspace.ts#prefixPointer",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#federateCallers",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateCallers",
- "target": "src/graph/traverse-cli.ts#callersSavings",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateCallers",
- "target": "src/graph/traverse-cli.ts#headerOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateCallers",
- "target": "src/graph/traverse-cli.ts#hitLine",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateCallers",
- "target": "src/graph/traverse-cli.ts#looseNoteFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateCallers",
- "target": "src/graph/traverse.ts#edgeWalk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateCallers",
- "target": "src/graph/traverse.ts#resolveSymbol",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateCallers",
- "target": "src/graph/workspace.ts#coverageNote",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#federateCallers",
- "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#federateCheck",
- "target": "src/graph/check.ts#checkGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateCheck",
- "target": "src/graph/workspace.ts#coverageNote",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#federateCheck",
- "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#federateGrep",
- "target": "src/graph/workspace.ts#coverageNote",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#federateGrep",
- "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#federateGrep",
- "target": "src/search/grep.ts#grepGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateMap",
- "target": "src/graph/map.ts#buildRepoMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateMap",
- "target": "src/graph/map.ts#formatRepoMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#federateMap",
- "target": "src/graph/workspace.ts#coverageNote",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#federateMap",
- "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#hasMegaGraph",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#hasMegaGraph",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#isWorkspaceBuildRoot",
- "target": "src/graph/scopes.ts#discoverWorkspaceChildren",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#isWorkspaceBuildRoot",
- "target": "src/graph/workspace.ts#readWorkspace",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "target": "src/graph/scopes.ts#discoverWorkspaceChildren",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "target": "src/graph/workspace.ts#readWorkspace",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#readWorkspace",
- "target": "src/graph/workspace.ts#workspacePath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#splitWorkspace",
- "target": "src/graph/scopes.ts#discoverWorkspaceChildren",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#splitWorkspace",
- "target": "src/graph/workspace-cli.ts#runWorkspaceBuild.buildChild",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#splitWorkspace",
- "target": "src/graph/workspace.ts#clearParentGraft",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#splitWorkspace",
- "target": "src/graph/workspace.ts#hasMegaGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#splitWorkspace",
- "target": "src/graph/workspace.ts#writeWorkspace",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/workspace.ts#workspacePath",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/workspace.ts#writeWorkspace",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/write.ts",
- "target": "src/graph/write.ts#edgeOrder",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "src/graph/write.ts#readGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "src/graph/write.ts#stripBodyText",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "src/graph/write.ts#writeGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/write.ts#writeGraph",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts",
- "target": "src/hosts/codex-hooks.ts#dirExists",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts",
- "target": "src/hosts/codex-hooks.ts#HookWrite",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts",
- "target": "src/hosts/codex-hooks.ts#installCodexHooks",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts",
- "target": "src/hosts/codex-hooks.ts#isGraftEntry",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts",
- "target": "src/hosts/codex-hooks.ts#writeOwned",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts",
- "target": "src/claude/paths.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts",
- "target": "src/claude/shim-template.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts#installCodexHooks",
- "target": "src/claude/paths.ts#claudeDistDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/hosts/codex-hooks.ts#installCodexHooks",
- "target": "src/claude/shim-template.ts#hooksShim",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/hosts/codex-hooks.ts#installCodexHooks",
- "target": "src/hosts/codex-hooks.ts#dirExists",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts#installCodexHooks",
- "target": "src/hosts/codex-hooks.ts#isGraftEntry",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/codex-hooks.ts#installCodexHooks",
- "target": "src/hosts/codex-hooks.ts#writeOwned",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "src/hosts/init.ts#HostsInitResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "src/hosts/init.ts#probeFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "src/hosts/init.ts#runHostsInit",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "src/hosts/init.ts#writeOwned",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "src/hosts/codex-hooks.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "src/hosts/mcp-config.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "src/hosts/registry.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts",
- "target": "src/hosts/sections.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts#runHostsInit",
- "target": "src/hosts/codex-hooks.ts#installCodexHooks",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/hosts/init.ts#runHostsInit",
- "target": "src/hosts/init.ts#probeFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts#runHostsInit",
- "target": "src/hosts/init.ts#writeOwned",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/init.ts#runHostsInit",
- "target": "src/hosts/mcp-config.ts#registerMcpConfigs",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/hosts/init.ts#runHostsInit",
- "target": "src/hosts/registry.ts#detectHosts",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/hosts/init.ts#runHostsInit",
- "target": "src/hosts/sections.ts#upsertSection",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/hosts/instructions.ts",
- "target": "src/hosts/instructions.ts#cursorRule",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/instructions.ts",
- "target": "src/hosts/instructions.ts#instructionBody",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/instructions.ts",
- "target": "src/hosts/instructions.ts#kiroSteering",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/instructions.ts",
- "target": "src/hosts/instructions.ts#windsurfRule",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/instructions.ts#cursorRule",
- "target": "src/hosts/instructions.ts#instructionBody",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/instructions.ts#kiroSteering",
- "target": "src/hosts/instructions.ts#instructionBody",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/instructions.ts#windsurfRule",
- "target": "src/hosts/instructions.ts#instructionBody",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts",
- "target": "src/hosts/mcp-config.ts#dirExists",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts",
- "target": "src/hosts/mcp-config.ts#McpWrite",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts",
- "target": "src/hosts/mcp-config.ts#mergeJsonKey",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts",
- "target": "src/hosts/mcp-config.ts#registerMcpConfigs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts",
- "target": "src/hosts/mcp-config.ts#upsertCodexToml",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts#registerMcpConfigs",
- "target": "src/hosts/mcp-config.ts#dirExists",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts#registerMcpConfigs",
- "target": "src/hosts/mcp-config.ts#mergeJsonKey",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/mcp-config.ts#registerMcpConfigs",
- "target": "src/hosts/mcp-config.ts#upsertCodexToml",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/registry.ts",
- "target": "src/hosts/registry.ts#detectHosts",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/registry.ts",
- "target": "src/hosts/registry.ts#DetectProbe",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/registry.ts",
- "target": "src/hosts/registry.ts#hostIds",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/registry.ts",
- "target": "src/hosts/registry.ts#HostTarget",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/registry.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/registry.ts",
- "target": "src/hosts/instructions.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts",
- "target": "src/hosts/sections.ts#detectEol",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts",
- "target": "src/hosts/sections.ts#fencedBlock",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts",
- "target": "src/hosts/sections.ts#LineEnding",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts",
- "target": "src/hosts/sections.ts#markerLineIndex",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts",
- "target": "src/hosts/sections.ts#UpsertAction",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts",
- "target": "src/hosts/sections.ts#upsertSection",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts#upsertSection",
- "target": "src/hosts/sections.ts#detectEol",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts#upsertSection",
- "target": "src/hosts/sections.ts#fencedBlock",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/hosts/sections.ts#upsertSection",
- "target": "src/hosts/sections.ts#markerLineIndex",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ingest/fs.ts",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ingest/fs.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ingest/fs.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/ingest/fs.ts#walkDir",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts",
- "target": "src/mcp/server.ts#reply",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts",
- "target": "src/mcp/server.ts#replyError",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts",
- "target": "src/mcp/server.ts#send",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts",
- "target": "src/mcp/server.ts#startMcpServer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts",
- "target": "node:readline",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts",
- "target": "src/mcp/tools.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts#reply",
- "target": "src/mcp/server.ts#send",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts#replyError",
- "target": "src/mcp/server.ts#send",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts#startMcpServer",
- "target": "src/mcp/server.ts#reply",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts#startMcpServer",
- "target": "src/mcp/server.ts#replyError",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/server.ts#startMcpServer",
- "target": "src/mcp/tools.ts#callTool",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/mcp/tools.ts#callTool",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/mcp/tools.ts#callWorkspaceTool",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/mcp/tools.ts#renderMatches",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/mcp/tools.ts#ToolDef",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/mcp/tools.ts#unknownSymbolText",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/context/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/context/savings.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/engine.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/graph/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/graph/map.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/graph/traverse-cli.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/graph/traverse.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/graph/workspace.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/search/grep-cli.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts",
- "target": "src/search/grep.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/ask/ask.ts#formatSkeleton",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/ask/ask.ts#skeleton",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/context/check.ts#formatCheckReport",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/engine.ts#Graft.ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/engine.ts#Graft.check",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/engine.ts#Graft.checkGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/graph/check.ts#formatGraphCheckReport",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/graph/map.ts#buildRepoMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/graph/map.ts#formatRepoMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/graph/traverse-cli.ts#callersSavings",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/graph/traverse.ts#edgeWalk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/graph/traverse.ts#resolveSymbol",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/graph/workspace.ts#readWorkspace",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/mcp/tools.ts#callWorkspaceTool",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/mcp/tools.ts#renderMatches",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/mcp/tools.ts#unknownSymbolText",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/search/grep-cli.ts#formatGrepResult",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/search/grep-cli.ts#zeroHitNote",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/search/grep.ts#grepGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callWorkspaceTool",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callWorkspaceTool",
- "target": "src/graph/workspace.ts#federateAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callWorkspaceTool",
- "target": "src/graph/workspace.ts#federateCallers",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callWorkspaceTool",
- "target": "src/graph/workspace.ts#federateCheck",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callWorkspaceTool",
- "target": "src/graph/workspace.ts#federateGrep",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callWorkspaceTool",
- "target": "src/graph/workspace.ts#federateMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callWorkspaceTool",
- "target": "src/search/grep-cli.ts#formatGrepResult",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#callWorkspaceTool",
- "target": "src/search/grep-cli.ts#zeroHitNote",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#renderMatches",
- "target": "src/graph/traverse-cli.ts#headerOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#renderMatches",
- "target": "src/graph/traverse-cli.ts#hitLine",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/mcp/tools.ts#renderMatches",
- "target": "src/graph/traverse-cli.ts#looseNoteFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/search/grep-cli.ts#formatGrepHeader",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/search/grep-cli.ts#formatGrepResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/search/grep-cli.ts#formatGroup",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/search/grep-cli.ts#GrepCliOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/search/grep-cli.ts#groupHeader",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/search/grep-cli.ts#runGrepCommand",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/search/grep-cli.ts#truncationNote",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/search/grep-cli.ts#zeroHitNote",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/context/savings.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts",
- "target": "src/search/grep.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts#formatGrepResult",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/search/grep-cli.ts#formatGrepResult",
- "target": "src/search/grep-cli.ts#formatGrepHeader",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts#formatGrepResult",
- "target": "src/search/grep-cli.ts#formatGroup",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts#formatGrepResult",
- "target": "src/search/grep-cli.ts#truncationNote",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts#formatGroup",
- "target": "src/search/grep-cli.ts#groupHeader",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts#runGrepCommand",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/search/grep-cli.ts#runGrepCommand",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/search/grep-cli.ts#runGrepCommand",
- "target": "src/search/grep-cli.ts#formatGrepResult",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts#runGrepCommand",
- "target": "src/search/grep-cli.ts#zeroHitNote",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep-cli.ts#runGrepCommand",
- "target": "src/search/grep.ts#grepGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#computeInDegree",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#enclosingSymbol",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#escapeRegExp",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#grepGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#GrepGroup",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#GrepHit",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#GrepOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#GrepResult",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#GrepSymbolRef",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#spanBounds",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#symbolsOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#SymbolSpan",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/search/grep.ts#toSymbolRef",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/context/savings.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/graph/relations.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts#grepGraph",
- "target": "src/context/savings.ts#savingsFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/search/grep.ts#grepGraph",
- "target": "src/search/grep.ts#computeInDegree",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts#grepGraph",
- "target": "src/search/grep.ts#enclosingSymbol",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts#grepGraph",
- "target": "src/search/grep.ts#escapeRegExp",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts#grepGraph",
- "target": "src/search/grep.ts#symbolsOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts#grepGraph",
- "target": "src/search/grep.ts#toSymbolRef",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/search/grep.ts#symbolsOf",
- "target": "src/search/grep.ts#spanBounds",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/util/id.ts",
- "target": "src/util/id.ts#contentHash",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/util/id.ts",
- "target": "src/util/id.ts#newId",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/util/id.ts",
- "target": "src/util/id.ts#normalizeName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/util/id.ts",
- "target": "node:crypto",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#assembleContextGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#extractSummary",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#normalizeRelation",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#VizEdge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#VizGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/viz/assemble.ts#VizNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "gray-matter",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts#assembleContextGraph",
- "target": "src/viz/assemble.ts#extractSummary",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/assemble.ts#assembleContextGraph",
- "target": "src/viz/assemble.ts#normalizeRelation",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/serve.ts#listen",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/serve.ts#sendJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/serve.ts#startVizServer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/serve.ts#VizServer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/serve.ts#VizServerOptions",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "node:http",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts",
- "target": "src/viz/assemble.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts#listen",
- "target": "src/viz/serve.ts#listen.onError",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts#startVizServer",
- "target": "src/viz/assemble.ts#assembleContextGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/viz/serve.ts#startVizServer",
- "target": "src/viz/serve.ts#listen",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts#startVizServer",
- "target": "src/viz/serve.ts#sendJson",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts#startVizServer",
- "target": "src/viz/serve.ts#startVizServer.close",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/viz/serve.ts#startVizServer.close",
- "target": "src/viz/serve.ts#startVizServer.close",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "src/ask/fuse.ts#fuseScopes",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "src/ask/fuse.ts#rankScopesAndFuse",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "test/ask-fusion.test.ts#makeOps",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "test/ask-fusion.test.ts#scopeDocs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "test/ask-fusion.test.ts#makeOps",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "test/ask-fusion.test.ts#scopeDocs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-fusion.test.ts",
- "target": "src/ask/fuse.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/ask/index-file.ts#askIndexPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/ask/index-file.ts#counts",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/ask/index-file.ts#readAskIndex",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/ask/index-file.ts#tokenize",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/ask/index-file.ts#writeAskIndex",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/graph/extract.ts#extractFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "test/ask-index.test.ts#makeFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "test/ask-index.test.ts#reinjectBodyText",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "test/ask-index.test.ts#sortPairs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "test/ask-index.test.ts#makeFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "test/ask-index.test.ts#reinjectBodyText",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "test/ask-index.test.ts#sortPairs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/ask/index-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask-index.test.ts#reinjectBodyText",
- "target": "src/graph/extract.ts#extractFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts#reinjectBodyText",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask-index.test.ts#reinjectBodyText",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask.test.ts",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask.test.ts",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask.test.ts",
- "target": "src/ask/ask.ts#formatSkeleton",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask.test.ts",
- "target": "src/ask/ask.ts#skeleton",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask.test.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#crossSeamMonorepoFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#duplicateNameFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#idfShiftFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#makeFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#multiScopeFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#qualifiedFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#rankOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#siblingPrefixFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#stampCrux",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#crossSeamMonorepoFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#duplicateNameFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#idfShiftFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#makeFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#multiScopeFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#qualifiedFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#rankOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#siblingPrefixFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "test/ask.test.ts#stampCrux",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/ask.test.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/format.ts#enrichedSegment",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/format.ts#formatBlastRadius",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/format.ts#formatOrientation",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/format.ts#formatRetrieval",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/format.ts#incomingEdges",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/format.ts#relevantRetrieval",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/format.ts#renderStatusline",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/format.ts#renderSubagent",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/state.ts#emptyStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "test/claude-format.test.ts#freshSession",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "test/claude-format.test.ts#gateAsk",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "test/claude-format.test.ts#strip",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "test/claude-format.test.ts#freshSession",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "test/claude-format.test.ts#gateAsk",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "test/claude-format.test.ts#strip",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/format.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-format.test.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/hooks.ts#lastFileScopeHint",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/hooks.ts#underGraft",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/state.ts#acquireLock",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/state.ts#emptyStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/state.ts#readSession",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/state.ts#readStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/state.ts#writeStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/sync-run.ts#runSync",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "test/claude-hooks.test.ts#runWithStdin",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "test/claude-hooks.test.ts#writeAskArgsStub",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "test/claude-hooks.test.ts#writeMultiScopeWiring",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "test/claude-hooks.test.ts#fakeBuild",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "test/claude-hooks.test.ts#runWithStdin",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "test/claude-hooks.test.ts#writeAskArgsStub",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "test/claude-hooks.test.ts#writeMultiScopeWiring",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/hooks.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/claude/sync-run.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-hooks.test.ts",
- "target": "src/context/savings.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "src/claude/init.ts#runInit",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "src/cli-epilogue.ts#formatInitEpilogue",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "test/claude-init.test.ts#col",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "test/claude-init.test.ts#fresh",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "test/claude-init.test.ts#runPostinstall",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "test/claude-init.test.ts#col",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "test/claude-init.test.ts#fresh",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "test/claude-init.test.ts#runPostinstall",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "src/claude/init.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-init.test.ts",
- "target": "src/cli-epilogue.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-paths.test.ts",
- "target": "src/claude/paths.ts#claudeScriptPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-paths.test.ts",
- "target": "src/claude/paths.ts#graftCliPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-paths.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-paths.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-paths.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-paths.test.ts",
- "target": "src/claude/paths.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-settings-merge.test.ts",
- "target": "src/claude/settings-merge.ts#mergeGraftSettings",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-settings-merge.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-settings-merge.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-settings-merge.test.ts",
- "target": "src/claude/settings-merge.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-shim-template.test.ts",
- "target": "src/claude/shim-template.ts#hooksShim",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-shim-template.test.ts",
- "target": "src/claude/shim-template.ts#statuslineShim",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-shim-template.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-shim-template.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-shim-template.test.ts",
- "target": "node:vm",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-shim-template.test.ts",
- "target": "src/claude/shim-template.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-skill-template.test.ts",
- "target": "src/claude/skill-template.ts#skillTemplate",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-skill-template.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-skill-template.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-skill-template.test.ts",
- "target": "src/claude/skill-template.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "src/claude/state.ts#acquireLock",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "src/claude/state.ts#cacheDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "src/claude/state.ts#emptyStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "src/claude/state.ts#patchStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "src/claude/state.ts#readSession",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "src/claude/state.ts#readStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "src/claude/state.ts#releaseLock",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "src/claude/state.ts#writeSession",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "src/claude/state.ts#writeStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "test/claude-state.test.ts#fresh",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "test/claude-state.test.ts#fresh",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-state.test.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-stats.test.ts",
- "target": "src/claude/stats.ts#computeStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-stats.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-stats.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-stats.test.ts",
- "target": "src/claude/stats.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "src/claude/state.ts#emptyStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "src/claude/state.ts#writeStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "src/claude/statusline.ts#resolveStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "test/claude-statusline.test.ts#repo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "test/claude-statusline.test.ts#writeWiring",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "test/claude-statusline.test.ts#repo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "test/claude-statusline.test.ts#writeWiring",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/claude-statusline.test.ts",
- "target": "src/claude/statusline.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "src/cli-meta.ts#formatUpgradeReport",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "src/cli-meta.ts#formatVersionReport",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "src/cli-meta.ts#isRunningViaNpx",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "src/cli-meta.ts#readCurrentVersion",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "src/cli-meta.ts#resolvePackageJsonPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "node:url",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/cli-meta.test.ts",
- "target": "src/cli-meta.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "src/context/build.ts#buildContext",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/context.test.ts",
- "target": "src/context/check.ts#checkContext",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/context.test.ts#buildOpts",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/context.test.ts#makeFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/context.test.ts#runCli",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/context.test.ts#buildOpts",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/context.test.ts#makeFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/context.test.ts#runCli",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "src/context/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "src/context/check.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts",
- "target": "test/helpers.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/context.test.ts#buildOpts",
- "target": "test/helpers.ts#fakeProviders",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/covers.test.ts",
- "target": "src/context/build.ts#buildContext",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/covers.test.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/covers.test.ts",
- "target": "test/covers.test.ts#makeFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/covers.test.ts",
- "target": "test/helpers.ts#fakeProviders",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/covers.test.ts",
- "target": "test/covers.test.ts#makeFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/covers.test.ts",
- "target": "gray-matter",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/covers.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/covers.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/covers.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/covers.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/covers.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/covers.test.ts",
- "target": "src/context/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/covers.test.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/covers.test.ts",
- "target": "test/helpers.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-bindings.test.ts",
- "target": "test/graph-bindings.test.ts#callEdges",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-bindings.test.ts",
- "target": "test/graph-bindings.test.ts#callEdges",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-bindings.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-bindings.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-bindings.test.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-bindings.test.ts#callEdges",
- "target": "src/graph/extract.ts#extractFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "test/graph-go.test.ts#makeFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "test/graph-go.test.ts#nodeById",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "test/graph-go.test.ts#makeFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "test/graph-go.test.ts#nodeById",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-go.test.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/ask/index-file.ts#askIndexPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/ask/index-file.ts#writeAskIndex",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/graph/load.ts#__resetParseCounts",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/graph/load.ts#loadAskIndexCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/graph/write.ts#writeGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/mcp/tools.ts#callTool",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "test/graph-load.test.ts#bump",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "test/graph-load.test.ts#fixtureDir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "test/graph-load.test.ts#node",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "test/graph-load.test.ts#bump",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "test/graph-load.test.ts#fixtureDir",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "test/graph-load.test.ts#node",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/ask/index-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-load.test.ts",
- "target": "src/mcp/tools.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "src/graph/map.ts#buildRepoMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "src/graph/map.ts#formatRepoMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#bigFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#edge",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#fileNode",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#graphOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#graphOfWithScopes",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#symNode",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#twoScopeFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#bigFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#edge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#fileNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#graphOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#graphOfWithScopes",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#symNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "test/graph-map.test.ts#twoScopeFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "src/graph/map.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts#bigFixture",
- "target": "test/graph-map.test.ts#edge",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts#bigFixture",
- "target": "test/graph-map.test.ts#fileNode",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts#bigFixture",
- "target": "test/graph-map.test.ts#graphOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts#bigFixture",
- "target": "test/graph-map.test.ts#symNode",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts#graphOfWithScopes",
- "target": "test/graph-map.test.ts#graphOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts#twoScopeFixture",
- "target": "test/graph-map.test.ts#fileNode",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts#twoScopeFixture",
- "target": "test/graph-map.test.ts#graphOfWithScopes",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-map.test.ts#twoScopeFixture",
- "target": "test/graph-map.test.ts#symNode",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-resolve-typed.test.ts",
- "target": "src/graph/resolve.ts#resolveEdges",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-resolve-typed.test.ts",
- "target": "test/graph-resolve-typed.test.ts#n",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-resolve-typed.test.ts",
- "target": "test/graph-resolve-typed.test.ts#n",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-resolve-typed.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-resolve-typed.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-resolve-typed.test.ts",
- "target": "src/graph/resolve.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-resolve-typed.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/scopes.ts#discoverScopes",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/scopes.ts#discoverWorkspaceChildren",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/scopes.ts#scopeOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/scopes.ts#scopesOfGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/write.ts#writeGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "test/graph-scopes.test.ts#fx",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "test/graph-scopes.test.ts#normalize",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "test/graph-scopes.test.ts#pyFns",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "test/graph-scopes.test.ts#run",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "test/graph-scopes.test.ts#tsFns",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "test/graph-scopes.test.ts#fx",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "test/graph-scopes.test.ts#normalize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "test/graph-scopes.test.ts#pyFns",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "test/graph-scopes.test.ts#run",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "test/graph-scopes.test.ts#tsFns",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/scopes.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-scopes.test.ts#run",
- "target": "src/graph/scopes.ts#discoverScopes",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-scopes.test.ts#run",
- "target": "test/graph-scopes.test.ts#fx",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse-cli.test.ts",
- "target": "test/graph-traverse-cli.test.ts#builtRepo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse-cli.test.ts",
- "target": "test/graph-traverse-cli.test.ts#runCli",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse-cli.test.ts",
- "target": "test/graph-traverse-cli.test.ts#builtRepo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse-cli.test.ts",
- "target": "test/graph-traverse-cli.test.ts#runCli",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse-cli.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse-cli.test.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse-cli.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse-cli.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse-cli.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse-cli.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "src/graph/traverse.ts#calleesOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "src/graph/traverse.ts#callersOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "src/graph/traverse.ts#impactOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "src/graph/traverse.ts#impactOfFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "src/graph/traverse.ts#impactOfMany",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "src/graph/traverse.ts#resolveSymbol",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#baseGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#diamondGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#edge",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#fileAndSymbolGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#graphOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#nodeStub",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#baseGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#diamondGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#edge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#fileAndSymbolGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#graphOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "test/graph-traverse.test.ts#nodeStub",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "src/graph/traverse.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts#baseGraph",
- "target": "test/graph-traverse.test.ts#edge",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts#baseGraph",
- "target": "test/graph-traverse.test.ts#graphOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts#diamondGraph",
- "target": "test/graph-traverse.test.ts#edge",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts#diamondGraph",
- "target": "test/graph-traverse.test.ts#graphOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts#diamondGraph",
- "target": "test/graph-traverse.test.ts#nodeStub",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts#fileAndSymbolGraph",
- "target": "test/graph-traverse.test.ts#edge",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts#fileAndSymbolGraph",
- "target": "test/graph-traverse.test.ts#graphOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-traverse.test.ts#fileAndSymbolGraph",
- "target": "test/graph-traverse.test.ts#nodeStub",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "src/graph/write.ts#writeGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "test/graph-write.test.ts#makeNode",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "test/graph-write.test.ts#makeNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graph-write.test.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "src/ask/graphrank.ts#personalizedPageRank",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "test/graphrank.test.ts#edge",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "test/graphrank.test.ts#graphOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "test/graphrank.test.ts#makeCollisionFixture",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "test/graphrank.test.ts#rank",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "test/graphrank.test.ts#edge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "test/graphrank.test.ts#graphOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "test/graphrank.test.ts#makeCollisionFixture",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "test/graphrank.test.ts#node",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "test/graphrank.test.ts#rank",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "src/ask/graphrank.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/graphrank.test.ts#rank",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/helpers.ts",
- "target": "test/helpers.ts#BracketSynthesizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts",
- "target": "test/helpers.ts#fakeProviders",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts",
- "target": "test/helpers.ts#PassthroughSummarizer",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts",
- "target": "src/index.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts#BracketSynthesizer",
- "target": "test/helpers.ts#BracketSynthesizer.synthesize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts#BracketSynthesizer",
- "target": "src/ai/synthesize.ts#Synthesizer",
- "relation": "implements",
- "confidence": "inferred"
- },
- {
- "source": "test/helpers.ts#BracketSynthesizer.synthesize",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/helpers.ts#BracketSynthesizer.synthesize",
- "target": "test/helpers.ts#BracketSynthesizer.synthesize.ensure",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts#BracketSynthesizer.synthesize",
- "target": "test/helpers.ts#BracketSynthesizer.synthesize.ensure",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts#PassthroughSummarizer",
- "target": "test/helpers.ts#PassthroughSummarizer.summarize",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/helpers.ts#PassthroughSummarizer",
- "target": "src/ai/summarize.ts#Summarizer",
- "relation": "implements",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-codex-hooks.test.ts",
- "target": "src/hosts/codex-hooks.ts#installCodexHooks",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-codex-hooks.test.ts",
- "target": "test/hosts-codex-hooks.test.ts#fresh",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-codex-hooks.test.ts",
- "target": "test/hosts-codex-hooks.test.ts#fresh",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-codex-hooks.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-codex-hooks.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-codex-hooks.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-codex-hooks.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-codex-hooks.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-codex-hooks.test.ts",
- "target": "src/hosts/codex-hooks.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-init.test.ts",
- "target": "src/hosts/init.ts#runHostsInit",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-init.test.ts",
- "target": "test/hosts-init.test.ts#fresh",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-init.test.ts",
- "target": "test/hosts-init.test.ts#fresh",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-init.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-init.test.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-init.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-init.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-init.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-init.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-init.test.ts",
- "target": "src/hosts/init.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-instructions.test.ts",
- "target": "src/hosts/instructions.ts#cursorRule",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-instructions.test.ts",
- "target": "src/hosts/instructions.ts#instructionBody",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-instructions.test.ts",
- "target": "src/hosts/instructions.ts#kiroSteering",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-instructions.test.ts",
- "target": "src/hosts/instructions.ts#windsurfRule",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-instructions.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-instructions.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-instructions.test.ts",
- "target": "src/hosts/instructions.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-mcp-config.test.ts",
- "target": "src/hosts/mcp-config.ts#registerMcpConfigs",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-mcp-config.test.ts",
- "target": "test/hosts-mcp-config.test.ts#fresh",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-mcp-config.test.ts",
- "target": "test/hosts-mcp-config.test.ts#fresh",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-mcp-config.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-mcp-config.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-mcp-config.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-mcp-config.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-mcp-config.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-mcp-config.test.ts",
- "target": "src/hosts/mcp-config.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "src/hosts/registry.ts#detectHosts",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "src/hosts/registry.ts#hostIds",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "test/hosts-registry.test.ts#fresh",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "test/hosts-registry.test.ts#probeFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "test/hosts-registry.test.ts#fresh",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "test/hosts-registry.test.ts#probeFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-registry.test.ts",
- "target": "src/hosts/registry.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-sections.test.ts",
- "target": "src/hosts/sections.ts#fencedBlock",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-sections.test.ts",
- "target": "src/hosts/sections.ts#upsertSection",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/hosts-sections.test.ts",
- "target": "test/hosts-sections.test.ts#fresh",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-sections.test.ts",
- "target": "test/hosts-sections.test.ts#fresh",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-sections.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-sections.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-sections.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-sections.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-sections.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/hosts-sections.test.ts",
- "target": "src/hosts/sections.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "test/llm-adapters.test.ts#anthropicResp",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "test/llm-adapters.test.ts#fakeAnthropic",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "test/llm-adapters.test.ts#fakeOpenAI",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "test/llm-adapters.test.ts#openAiResp",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "test/llm-adapters.test.ts#anthropicResp",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "test/llm-adapters.test.ts#fakeAnthropic",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "test/llm-adapters.test.ts#fakeOpenAI",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "test/llm-adapters.test.ts#openAiResp",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "@anthropic-ai/sdk",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "openai",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "src/ai/llm/anthropic.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "src/ai/llm/openai.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-adapters.test.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-ops.test.ts",
- "target": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/llm-ops.test.ts",
- "target": "test/llm-ops.test.ts#FakeChatModel",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-ops.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-ops.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-ops.test.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-ops.test.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-ops.test.ts",
- "target": "src/ai/summarize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-ops.test.ts",
- "target": "src/ai/synthesize.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-ops.test.ts#FakeChatModel",
- "target": "test/llm-ops.test.ts#FakeChatModel.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-ops.test.ts#FakeChatModel",
- "target": "test/llm-ops.test.ts#FakeChatModel.create",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/llm-ops.test.ts#FakeChatModel",
- "target": "src/ai/llm/types.ts#ChatModel",
- "relation": "implements",
- "confidence": "inferred"
- },
- {
- "source": "test/mcp-server.test.ts",
- "target": "test/mcp-server.test.ts#rpc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-server.test.ts",
- "target": "test/mcp-server.test.ts#rpc",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-server.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-server.test.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-server.test.ts",
- "target": "node:events",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-server.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-server.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-server.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-server.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "src/mcp/tools.ts#callTool",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#builtRepo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#chainRepo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#customDirRepo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#fileScopeRepo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#multiDirRepo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#builtRepo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#chainRepo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#customDirRepo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#fileScopeRepo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#multiDirRepo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/mcp-tools.test.ts",
- "target": "src/mcp/tools.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/load.ts#loadGraphCached",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/map.ts#buildRepoMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/map.ts#formatRepoMap",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/scopes.ts#scopesOfGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/traverse.ts#callersOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/traverse.ts#resolveSymbol",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/search/grep.ts#grepGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "test/regression-single-repo.test.ts#assertScopeFreeText",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "test/regression-single-repo.test.ts#fx",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "test/regression-single-repo.test.ts#assertScopeFreeText",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "test/regression-single-repo.test.ts#fx",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/map.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/scopes.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/traverse.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/regression-single-repo.test.ts",
- "target": "src/search/grep.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/savings.test.ts",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/savings.test.ts",
- "target": "src/context/savings.ts#savingsFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/savings.test.ts",
- "target": "test/savings.test.ts#fileNode",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/savings.test.ts",
- "target": "test/savings.test.ts#graphOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/savings.test.ts",
- "target": "test/savings.test.ts#fileNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/savings.test.ts",
- "target": "test/savings.test.ts#graphOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/savings.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/savings.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/savings.test.ts",
- "target": "src/context/savings.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/savings.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "src/search/grep-cli.ts#zeroHitNote",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "src/search/grep.ts#grepGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "test/search-grep.test.ts#fileNode",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "test/search-grep.test.ts#graphOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "test/search-grep.test.ts#loadBuiltGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "test/search-grep.test.ts#needleRepo",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "test/search-grep.test.ts#fileNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "test/search-grep.test.ts#graphOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "test/search-grep.test.ts#loadBuiltGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "test/search-grep.test.ts#needleRepo",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "node:child_process",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "src/graph/relations.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "src/search/grep-cli.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts",
- "target": "src/search/grep.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/search-grep.test.ts#loadBuiltGraph",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/search-grep.test.ts#loadBuiltGraph",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "src/viz/assemble.ts#assembleContextGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "src/viz/assemble.ts#normalizeRelation",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "test/viz-assemble.test.ts#makeContextDir",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "test/viz-assemble.test.ts#makeContextDir",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-assemble.test.ts",
- "target": "src/viz/assemble.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "src/viz/serve.ts#startVizServer",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "src/viz/serve.ts#startVizServer.close",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "test/viz-serve.test.ts#makeDirs",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "test/viz-serve.test.ts#makeDirs",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:http",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/viz-serve.test.ts",
- "target": "src/viz/serve.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts#coverageNote",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts#federateAsk",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts#federateCallers",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts#federateCheck",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts#federateGrep",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts#isWorkspaceBuildRoot",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts#migrationNote",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts#readWorkspace",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts#writeWorkspace",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/write.ts#writeGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "test/workspace.test.ts#buildWorkspace",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "test/workspace.test.ts#pad",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "test/workspace.test.ts#workspaceFx",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "test/workspace.test.ts#buildWorkspace",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "test/workspace.test.ts#pad",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "test/workspace.test.ts#workspaceFx",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "node:assert/strict",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/workspace.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "test/workspace.test.ts#buildWorkspace",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "test/workspace.test.ts#buildWorkspace",
- "target": "src/graph/workspace.ts#splitWorkspace",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#chipKey",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#CodeGraphV1",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#colorToken",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#cvar",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#Family",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#famOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#loadCodeGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#loadContextGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#onServerChange",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#VizEdge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#VizGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts",
- "target": "viewer/data.ts#VizNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/data.ts#chipKey",
- "target": "viewer/data.ts#famOf",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts",
- "target": "viewer/detail.ts#esc",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts",
- "target": "viewer/detail.ts#renderDetail",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts",
- "target": "viewer/data.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/data.ts#colorToken",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/data.ts#cvar",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/detail.ts#esc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/detail.ts#renderDetail.linkList",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/detail.ts#renderDetail.linkList",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail",
- "target": "viewer/detail.ts#renderDetail.name",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail.linkList",
- "target": "viewer/detail.ts#esc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/detail.ts#renderDetail.linkList",
- "target": "viewer/detail.ts#renderDetail.name",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "viewer/graph.ts#el",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "viewer/graph.ts#GraphView",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "viewer/graph.ts#SimEdge",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "viewer/graph.ts#SimNode",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "d3-force",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts",
- "target": "viewer/data.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.applyView",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.bindDrag",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.bindPanZoom",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.buildChrome",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.buildElements",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.constructor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.ensureMarkers",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.firstMatch",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.focus",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.reheat",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.resetView",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.select",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.setData",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.tick",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView",
- "target": "viewer/graph.ts#GraphView.zoomBy",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.bindDrag",
- "target": "viewer/graph.ts#GraphView.bindDrag.move",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.bindDrag",
- "target": "viewer/graph.ts#GraphView.bindDrag.up",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.bindPanZoom",
- "target": "viewer/graph.ts#GraphView.applyView",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildChrome",
- "target": "viewer/graph.ts#el",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildChrome",
- "target": "viewer/graph.ts#GraphView.select",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildElements",
- "target": "viewer/graph.ts#el",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildElements",
- "target": "viewer/graph.ts#GraphView.bindDrag",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildElements",
- "target": "viewer/graph.ts#GraphView.ensureMarkers",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.buildElements",
- "target": "viewer/graph.ts#GraphView.select",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.constructor",
- "target": "viewer/graph.ts#GraphView.bindPanZoom",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.constructor",
- "target": "viewer/graph.ts#GraphView.buildChrome",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.ensureMarkers",
- "target": "viewer/data.ts#cvar",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.ensureMarkers",
- "target": "viewer/graph.ts#el",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.focus",
- "target": "viewer/graph.ts#GraphView.applyView",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.focus",
- "target": "viewer/graph.ts#GraphView.select",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.resetView",
- "target": "viewer/graph.ts#GraphView.applyView",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/data.ts#chipKey",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/data.ts#colorToken",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/data.ts#cvar",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/data.ts#famOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/graph.ts#GraphView.ensureMarkers",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/graph.ts#GraphView.restyle.nodeShown",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.restyle",
- "target": "viewer/graph.ts#GraphView.restyle.nodeShown",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.select",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.setData",
- "target": "viewer/data.ts#famOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/graph.ts#GraphView.setData",
- "target": "viewer/graph.ts#GraphView.buildElements",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.setData",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.setData",
- "target": "viewer/graph.ts#GraphView.tick",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/graph.ts#GraphView.zoomBy",
- "target": "viewer/graph.ts#GraphView.applyView",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/data.ts#onServerChange",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts#GraphView.firstMatch",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts#GraphView.focus",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts#GraphView.resetView",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts#GraphView.zoomBy",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#loadAll",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#renderChips",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#renderLegend",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#setTab",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#showDetail",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#$",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#activeGraph",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#glyphFor",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#graphTab",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#loadAll",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#renderChips",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#renderLegend",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#setTab",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#showDetail",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#showEmpty",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#Tab",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#updateCounts",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/main.ts#updateShownCount",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/data.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/detail.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/graph.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts",
- "target": "viewer/tree.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#glyphFor",
- "target": "viewer/data.ts#famOf",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#loadAll",
- "target": "viewer/data.ts#loadCodeGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#loadAll",
- "target": "viewer/data.ts#loadContextGraph",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#loadAll",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#loadAll",
- "target": "viewer/main.ts#setTab",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/data.ts#chipKey",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#activeGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#glyphFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#renderChips",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#renderChips.rank",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#updateShownCount",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderChips",
- "target": "viewer/main.ts#renderChips.rank",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/data.ts#colorToken",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/data.ts#cvar",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/graph.ts#GraphView.restyle",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/main.ts#activeGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/main.ts#graphTab",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/main.ts#renderLegend",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#renderLegend",
- "target": "viewer/main.ts#updateShownCount",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/graph.ts#GraphView.reheat",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/graph.ts#GraphView.resetView",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/graph.ts#GraphView.setData",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#activeGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#graphTab",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#renderChips",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#renderLegend",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#showDetail",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#showEmpty",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#updateCounts",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/main.ts#updateShownCount",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#setTab",
- "target": "viewer/tree.ts#renderOutline",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/detail.ts#renderDetail",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/graph.ts#GraphView.focus",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/main.ts#graphTab",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/main.ts#showDetail",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#showDetail",
- "target": "viewer/tree.ts#renderOutline",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/main.ts#showEmpty",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#updateCounts",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#updateCounts",
- "target": "viewer/main.ts#activeGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#updateShownCount",
- "target": "viewer/main.ts#$",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/main.ts#updateShownCount",
- "target": "viewer/main.ts#activeGraph",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts",
- "target": "viewer/tree.ts#esc",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts",
- "target": "viewer/tree.ts#renderOutline",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts",
- "target": "viewer/data.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline",
- "target": "viewer/tree.ts#renderOutline",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline",
- "target": "viewer/tree.ts#renderOutline.countDesc",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline",
- "target": "viewer/tree.ts#renderOutline.kids",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline",
- "target": "viewer/tree.ts#renderOutline.row",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline.countDesc",
- "target": "viewer/tree.ts#renderOutline.countDesc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline.countDesc",
- "target": "viewer/tree.ts#renderOutline.kids",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline.row",
- "target": "viewer/data.ts#colorToken",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/tree.ts#renderOutline.row",
- "target": "viewer/data.ts#cvar",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "viewer/tree.ts#renderOutline.row",
- "target": "viewer/tree.ts#esc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline.row",
- "target": "viewer/tree.ts#renderOutline.countDesc",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "viewer/tree.ts#renderOutline.row",
- "target": "viewer/tree.ts#renderOutline.kids",
- "relation": "calls",
- "confidence": "extracted"
- }
- ]
-}
diff --git a/graft/INDEX.md b/graft/INDEX.md
deleted file mode 100644
index 05a69e9f..00000000
--- a/graft/INDEX.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# graft — repo map
-
-Small markdown nodes summarising this repo. `grep` any term, symbol, or
-filename here, or run `graft ask "<task>"`. Each node carries prose plus exact
-`file:line`; open a source file only to edit the named span.
-
-## Concepts
-
-- [agent](agent.md) — Agent · bench/agent.ts
-- [benchmarking-system](benchmarking-system.md) — Benchmarking System · bench/agent.ts, bench/judge.ts, bench/llm.ts, bench/report.ts, bench/run.ts, bench/selfcheck.ts, bench/tasks.ts, bench/token-ab.ts
-- [code-summarization](code-summarization.md) — Code Summarization · src/ai/crux.ts, src/ai/summarize.ts, src/ai/synthesize.ts
-- [configuration-management](configuration-management.md) — Configuration Management · src/ai/providers.ts, src/claude/settings-merge.ts
-- [deterministic-testing](deterministic-testing.md) — Deterministic Testing · test/helpers.ts
-- [error-handling-and-reporting](error-handling-and-reporting.md) — Error Handling and Reporting · bench/run.ts, src/engine.ts, src/graph/build.ts
-- [graph-data-integrity](graph-data-integrity.md) — Graph Data Integrity · test/graph-write.test.ts
-- [graph-extraction-and-loading](graph-extraction-and-loading.md) — Graph Extraction and Loading · src/graph/extract.ts, src/graph/load.ts, src/graph/relations.ts, src/graph/resolve.ts, src/graph/types.ts
-- [graph-ranking](graph-ranking.md) — Graph Ranking · test/graphrank.test.ts
-- [graph-representation](graph-representation.md) — Graph Representation · src/graph/relations.ts, src/graph/types.ts
-- [graph-serialization](graph-serialization.md) — Graph Serialization · test/graph-write.test.ts
-- [graph-synchronization](graph-synchronization.md) — Graph Synchronization · src/context/check.ts, src/graph/check.ts
-- [graph-traversal-and-analysis](graph-traversal-and-analysis.md) — Graph Traversal and Analysis · src/graph/traverse-cli.ts, src/graph/traverse.ts, src/search/grep-cli.ts, src/search/grep.ts
-- [graph-traversal-and-impact-analysis](graph-traversal-and-impact-analysis.md) — Graph Traversal and Impact Analysis · test/graph-traverse.test.ts
-- [graph-visualization](graph-visualization.md) — Graph Visualization · viewer/data.ts, viewer/detail.ts, viewer/graph.ts, viewer/main.ts, viewer/tree.ts
-- [host-configuration-management](host-configuration-management.md) — Host Configuration Management · test/hosts-codex-hooks.test.ts, test/hosts-init.test.ts, test/hosts-mcp-config.test.ts, test/hosts-registry.test.ts, test/hosts-sections.test.ts
-- [host-management-and-configuration](host-management-and-configuration.md) — Host Management and Configuration · src/hosts/codex-hooks.ts, src/hosts/init.ts, src/hosts/instructions.ts, src/hosts/mcp-config.ts, src/hosts/registry.ts, src/hosts/sections.ts
-- [idempotent-host-initialization](idempotent-host-initialization.md) — Idempotent Host Initialization · test/hosts-init.test.ts
-- [judge](judge.md) — Judge · bench/judge.ts
-- [llm-integration](llm-integration.md) — LLM Integration · bench/llm.ts
-- [mcp-server-and-tools](mcp-server-and-tools.md) — MCP Server and Tools · test/mcp-server.test.ts, test/mcp-tools.test.ts
-- [report](report.md) — Report · bench/report.ts
-- [self-check-mechanism](self-check-mechanism.md) — Self-Check Mechanism · bench/selfcheck.ts
-- [tasks](tasks.md) — Tasks · bench/tasks.ts
-- [test-helpers](test-helpers.md) — Test Helpers · test/helpers.ts
-- [testing-and-validation](testing-and-validation.md) — Testing and Validation · test/ask-index.test.ts, test/ask.test.ts, test/claude-format.test.ts, test/claude-hooks.test.ts, test/claude-init.test.ts, test/claude-paths.test.ts, test/claude-settings-merge.test.ts, test/claude-shim-template.test.ts, test/claude-skill-template.test.ts, test/claude-state.test.ts, test/claude-stats.test.ts, test/claude-statusline.test.ts, test/cli-meta.test.ts, test/context.test.ts, test/covers.test.ts, test/graph-bindings.test.ts, test/graph-go.test.ts, test/graph-load.test.ts, test/graph-map.test.ts, test/graph-resolve-typed.test.ts, test/graph-traverse-cli.test.ts
-- [token-a-b-testing](token-a-b-testing.md) — Token A/B Testing · bench/token-ab.ts
-- [user-interaction-in-visualization](user-interaction-in-visualization.md) — User Interaction in Visualization · viewer/detail.ts, viewer/graph.ts, viewer/main.ts
-- [visualization-and-serving](visualization-and-serving.md) — Visualization and Serving · src/viz/assemble.ts, src/viz/serve.ts
-
-## Files
-
-121 per-file wiring cards mirror the source tree under `graft/` (110 carry extracted symbols). They are deliberately not enumerated here —
-`grep` a symbol or `find`/`ls` a filename under `graft/` to land on the card for that file.
diff --git a/graft/agent.md b/graft/agent.md
deleted file mode 100644
index c57a0215..00000000
--- a/graft/agent.md
+++ /dev/null
@@ -1,60 +0,0 @@
----
-name: Agent
-slug: agent
-type: system
-sources:
- - path: bench/agent.ts
- hash: 34a496d38f2dfc14688cb4f0981262d79dacef165bd1a4f9874b94c31e1819e9
-sources_digest: 989950aca29644904bb9a7040d36a735534f3b0d1b3854912a2303e5b0831423
-links:
- - to: llm-integration
- relation: uses
- description: The agent relies on language models for processing queries.
- - to: tasks
- relation: depends_on
- description: The agent executes tasks defined in the benchmark corpus.
-generator:
- version: 1
-covers:
- - symbol: AgentResult
- kind: interface
- at: 'bench/agent.ts:L20-L28'
- - symbol: RunAgentOptions
- kind: interface
- at: 'bench/agent.ts:L30-L42'
- - symbol: safePath
- kind: function
- at: 'bench/agent.ts:L51-L65'
- - symbol: listFiles
- kind: function
- at: 'bench/agent.ts:L67-L94'
- - symbol: walk
- kind: function
- at: 'bench/agent.ts:L69-L91'
- - symbol: globToRegExp
- kind: function
- at: 'bench/agent.ts:L97-L111'
- - symbol: runTool
- kind: function
- at: 'bench/agent.ts:L189-L259'
- - symbol: runAgent
- kind: function
- at: 'bench/agent.ts:L261-L341'
- - symbol: slideCacheBreakpoint
- kind: function
- at: 'bench/agent.ts:L289-L294'
----
-<!-- context:generated:start -->
-## Summary
-
-The agent component implements a benchmark agent that processes questions using filesystem tools and a language model, tracking metrics such as token usage and tool calls. It emphasizes safety and correctness in its operations, ensuring secure filesystem access and accurate reporting of resource usage.
-
-## Related
-
-- uses [[llm-integration]] — The agent relies on language models for processing queries.
-- depends on [[tasks]] — The agent executes tasks defined in the benchmark corpus.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/bench/agent.md b/graft/bench/agent.md
deleted file mode 100644
index 6c8150ce..00000000
--- a/graft/bench/agent.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# bench/agent.ts · [[agent]] [[benchmarking-system]]
-
-This file implements a benchmark agent that executes a loop for evaluating the performance of different AI models in answering questions based on a codebase.
-
-- AgentResult · interface · L20-L28 — Defines the structure of the result returned by the agent, encapsulating the answer and various metrics.
-- RunAgentOptions · interface · L30-L42 — Defines the options for running the agent, including the root directory and the question to be answered.
-- safePath · function · L51-L65 — Ensures that a given path is safely resolved within a specified root directory, preventing directory traversal attacks.
-- listFiles · function · L67-L94 — Recursively lists all files in a directory while respecting size limits and skipping specified directories.
-- walk · function · L69-L91 — A helper function that traverses a directory to collect file paths, avoiding hidden files and skipped directories.
-- globToRegExp · function · L97-L111 — Converts a glob pattern into a regular expression for matching file paths.
-- runTool · function · L189-L259 — Executes a specified tool with given input, handling various file operations and queries within a defined root directory.
-- runAgent · function · L261-L341 — Manages the execution of the agent, processing user questions and utilizing tools to generate answers while tracking performance metrics.
-- slideCacheBreakpoint · function · L289-L294 — Maintains the cache breakpoint on the most recent tool result to optimize performance during the agent's execution.
diff --git a/graft/bench/judge.md b/graft/bench/judge.md
deleted file mode 100644
index 124ba8b2..00000000
--- a/graft/bench/judge.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# bench/judge.ts · [[benchmarking-system]] [[judge]]
-
-This file implements a correctness scoring system that evaluates AI-generated answers against a reference answer, ensuring both keyword requirements and factual accuracy are met.
-
-- Verdict · interface · L18-L24 — The Verdict interface encapsulates the scoring results and correctness evaluation of an AI agent's answer.
-- JudgeInput · interface · L26-L32 — Defines the structure for input data required to evaluate an AI agent's answer, including the question, reference answer, and required keywords.
-- extractJson · function · L35-L49 — The extractJson function retrieves the first JSON object from a string, handling cases where the JSON is wrapped in additional text.
-- judge · function · L51-L86 — Evaluates an AI agent's answer against a reference answer, returning a verdict that indicates correctness based on both a judge's score and keyword requirements.
diff --git a/graft/bench/llm.md b/graft/bench/llm.md
deleted file mode 100644
index 9a544ed3..00000000
--- a/graft/bench/llm.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# bench/llm.ts · [[benchmarking-system]] [[llm-integration]]
-
-This file provides a benchmark setup for LLMs, ensuring that the correct models and configurations are used based on environment variables.
-
-- makeChatModel · function · L16-L28 — Creates a chat model instance while enforcing the requirement of a valid API key for the provider.
diff --git a/graft/bench/report.md b/graft/bench/report.md
deleted file mode 100644
index 6c4ac056..00000000
--- a/graft/bench/report.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# bench/report.ts · [[benchmarking-system]] [[report]]
-
-This file aggregates and reports benchmark results for different agent configurations, providing insights into performance metrics.
-
-- Arm · type · L6-L6 — Defines the possible execution arms for the benchmarking process, categorizing the types of agent runs.
-- Row · interface · L8-L30 — Represents a single trial's data, encapsulating all relevant metrics for benchmarking an agent's performance.
-- costOf · function · L37-L42 — Calculates the approximate cost of running an agent based on input and output tokens and cache operations.
-- mean · function · L44-L46 — Computes the mean of an array of numbers, returning zero for an empty array.
-- ArmAgg · interface · L48-L58 — Represents aggregated metrics for a specific arm of the benchmark, including totals and averages.
-- aggregate · function · L60-L72 — Aggregates multiple benchmark rows into a single ArmAgg object, calculating averages for various metrics.
-- pctDelta · function · L74-L78 — Calculates the percentage delta between two values, handling the case where the first value is zero.
-- fmt · function · L80-L82 — Formats a number for display, adjusting for thousands and decimal precision.
-- metricTable · function · L88-L114 — Generates a formatted metric table comparing performance across different agent arms, highlighting key metrics and deltas.
-- cells · function · L93-L102 — Constructs individual cells for the metric table, calculating values and formatting them for display.
-- verdictFor · function · L117-L127 — Evaluates and compares the cost and correctness of two agent configurations, providing a verdict on their performance.
-- buildMarkdown · function · L129-L175 — Compiles the overall benchmark results into a markdown format for easy readability and presentation.
diff --git a/graft/bench/run.md b/graft/bench/run.md
deleted file mode 100644
index c30b3c5d..00000000
--- a/graft/bench/run.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# bench/run.ts · [[benchmarking-system]] [[error-handling-and-reporting]]
-
-Orchestrates benchmarking tasks across different configurations and trials, ensuring efficient execution and result collection.
-
-- Args · interface · L39-L45 — Defines the structure for command-line arguments to configure the benchmarking process.
-- parseArgs · function · L47-L67 — Parses command-line arguments to set up the benchmarking configuration, ensuring valid options are provided.
-- pool · function · L70-L81 — Executes a function on a set of items concurrently, limiting the number of simultaneous operations.
-- worker · function · L73-L78 — Processes items in the pool function, handling each item asynchronously.
-- main · function · L83-L204 — Coordinates the overall benchmarking process, including argument parsing, corpus handling, and result generation.
diff --git a/graft/bench/selfcheck.md b/graft/bench/selfcheck.md
deleted file mode 100644
index aa35e497..00000000
--- a/graft/bench/selfcheck.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# bench/selfcheck.ts · [[benchmarking-system]] [[self-check-mechanism]]
-
-This file provides an offline verification mechanism for the harness plumbing, ensuring control flow integrity without requiring an API key.
-
-- makeStubModel · function · L20-L39 — Creates a stubbed ChatModel that simulates agent behavior for testing purposes, allowing for controlled responses during the agent loop.
-- create · method · L24-L37 — Handles requests by returning predefined responses based on the request format, simulating the agent's decision-making process.
-- main · function · L41-L105 — Coordinates the self-check process by setting up the environment, running the agent, and validating the results through assertions.
diff --git a/graft/bench/tasks.md b/graft/bench/tasks.md
deleted file mode 100644
index b938a14a..00000000
--- a/graft/bench/tasks.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# bench/tasks.ts · [[benchmarking-system]] [[tasks]]
-
-This file defines benchmark tasks and their associated metadata to ensure verifiable answers for codebase questions.
-
-- repoPath · function · L30-L33 — This function determines the file path for sibling repositories, allowing for environment variable overrides.
-- Task · interface · L35-L45 — The Task interface structures the data for individual benchmark questions, ensuring they include necessary details for validation.
-- Corpus · interface · L47-L53 — This interface defines a corpus of benchmark tasks, specifying its ID, type, path, and associated tasks.
diff --git a/graft/bench/token-ab.md b/graft/bench/token-ab.md
deleted file mode 100644
index 17273810..00000000
--- a/graft/bench/token-ab.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# bench/token-ab.ts · [[benchmarking-system]] [[token-a-b-testing]]
-
-This script benchmarks the performance of an agent using two different approaches (COLD and GRAFT) to determine if providing pre-computed context saves tokens during code exploration.
-
-- Metrics · interface · L55-L64 — Defines the structure for capturing metrics related to the A/B testing of the agent's performance.
-- runSearch · function · L98-L128 — Executes a regex search across the repository to find relevant code snippets based on a given pattern.
-- runRead · function · L130-L147 — Reads a specified source file or a range of lines from it, ensuring it is within the repository's bounds.
-- runAgent · function · L150-L207 — Manages the agent's execution loop, handling user queries and tool calls while tracking performance metrics.
-- graftPack · function · L210-L221 — Generates a context pack using the graft tool to provide pre-computed information for the agent.
-- cost · function · L223-L227 — Calculates the estimated cost of the agent's operations based on token usage and pricing configuration.
-- row · function · L229-L231 — Formats a row of metrics for display in the output table comparing the COLD and GRAFT arms.
-- main · function · L233-L273 — Coordinates the overall execution of the A/B test, including generating the graft pack and running both agent arms.
-- pct · function · L253-L253 — Calculates the percentage improvement in token usage between the COLD and GRAFT arms.
diff --git a/graft/benchmarking-system.md b/graft/benchmarking-system.md
deleted file mode 100644
index deff437b..00000000
--- a/graft/benchmarking-system.md
+++ /dev/null
@@ -1,197 +0,0 @@
----
-name: Benchmarking System
-slug: benchmarking-system
-type: system
-sources:
- - path: bench/agent.ts
- hash: 34a496d38f2dfc14688cb4f0981262d79dacef165bd1a4f9874b94c31e1819e9
- - path: bench/judge.ts
- hash: bb48a8012b929bc0237f4d900d0ab7aa9a98f96777d72a89ce5305c6c57e6c47
- - path: bench/llm.ts
- hash: 6fc86553ce48879cb28b411747fe3ffaa2ad5c269e5de50d83e4ed8b629cae2b
- - path: bench/report.ts
- hash: 17c0be550f9712165177d070f58cbe7a0f60fcb2c1dc5830eb1a4dde97ec12f3
- - path: bench/run.ts
- hash: fd4445eb0d6d3c1a8b994c7e4be42522c3214612a8499e4f76bfc10d0030f9da
- - path: bench/selfcheck.ts
- hash: 858ec7cce92c9105c4e111ae58f1d1a1b1b57372b96768804308009760c9b2f6
- - path: bench/tasks.ts
- hash: efb90e69f52adcb08bfe45fb5a983fc676df68befdc455513e2581a24f46807e
- - path: bench/token-ab.ts
- hash: b033a023d063cccc329103fbd11d4e1a6ab16c5eb027e1dd85c47a63a7df4ff1
-sources_digest: 918b737414aae73bb0f84df38880140028a61e8bf27b89b544943394d05bb10f
-links:
- - to: agent
- relation: part_of
- description: The agent is responsible for executing tasks and collecting metrics.
- - to: judge
- relation: part_of
- description: The judge evaluates the correctness of the agent's responses.
- - to: llm-integration
- relation: part_of
- description: Integrates various language models for benchmarking.
- - to: report
- relation: part_of
- description: The report aggregates and presents benchmarking results.
- - to: tasks
- relation: part_of
- description: Tasks define the benchmark questions and expected answers.
-generator:
- version: 1
-covers:
- - symbol: AgentResult
- kind: interface
- at: 'bench/agent.ts:L20-L28'
- - symbol: RunAgentOptions
- kind: interface
- at: 'bench/agent.ts:L30-L42'
- - symbol: safePath
- kind: function
- at: 'bench/agent.ts:L51-L65'
- - symbol: listFiles
- kind: function
- at: 'bench/agent.ts:L67-L94'
- - symbol: walk
- kind: function
- at: 'bench/agent.ts:L69-L91'
- - symbol: globToRegExp
- kind: function
- at: 'bench/agent.ts:L97-L111'
- - symbol: runTool
- kind: function
- at: 'bench/agent.ts:L189-L259'
- - symbol: runAgent
- kind: function
- at: 'bench/agent.ts:L261-L341'
- - symbol: slideCacheBreakpoint
- kind: function
- at: 'bench/agent.ts:L289-L294'
- - symbol: Verdict
- kind: interface
- at: 'bench/judge.ts:L18-L24'
- - symbol: JudgeInput
- kind: interface
- at: 'bench/judge.ts:L26-L32'
- - symbol: extractJson
- kind: function
- at: 'bench/judge.ts:L35-L49'
- - symbol: judge
- kind: function
- at: 'bench/judge.ts:L51-L86'
- - symbol: makeChatModel
- kind: function
- at: 'bench/llm.ts:L16-L28'
- - symbol: Arm
- kind: type
- at: 'bench/report.ts:L6-L6'
- - symbol: Row
- kind: interface
- at: 'bench/report.ts:L8-L30'
- - symbol: costOf
- kind: function
- at: 'bench/report.ts:L37-L42'
- - symbol: mean
- kind: function
- at: 'bench/report.ts:L44-L46'
- - symbol: ArmAgg
- kind: interface
- at: 'bench/report.ts:L48-L58'
- - symbol: aggregate
- kind: function
- at: 'bench/report.ts:L60-L72'
- - symbol: pctDelta
- kind: function
- at: 'bench/report.ts:L74-L78'
- - symbol: fmt
- kind: function
- at: 'bench/report.ts:L80-L82'
- - symbol: metricTable
- kind: function
- at: 'bench/report.ts:L88-L114'
- - symbol: cells
- kind: function
- at: 'bench/report.ts:L93-L102'
- - symbol: verdictFor
- kind: function
- at: 'bench/report.ts:L117-L127'
- - symbol: buildMarkdown
- kind: function
- at: 'bench/report.ts:L129-L175'
- - symbol: Args
- kind: interface
- at: 'bench/run.ts:L39-L45'
- - symbol: parseArgs
- kind: function
- at: 'bench/run.ts:L47-L67'
- - symbol: pool
- kind: function
- at: 'bench/run.ts:L70-L81'
- - symbol: worker
- kind: function
- at: 'bench/run.ts:L73-L78'
- - symbol: main
- kind: function
- at: 'bench/run.ts:L83-L204'
- - symbol: makeStubModel
- kind: function
- at: 'bench/selfcheck.ts:L20-L39'
- - symbol: create
- kind: method
- at: 'bench/selfcheck.ts:L24-L37'
- - symbol: main
- kind: function
- at: 'bench/selfcheck.ts:L41-L105'
- - symbol: repoPath
- kind: function
- at: 'bench/tasks.ts:L30-L33'
- - symbol: Task
- kind: interface
- at: 'bench/tasks.ts:L35-L45'
- - symbol: Corpus
- kind: interface
- at: 'bench/tasks.ts:L47-L53'
- - symbol: Metrics
- kind: interface
- at: 'bench/token-ab.ts:L55-L64'
- - symbol: runSearch
- kind: function
- at: 'bench/token-ab.ts:L98-L128'
- - symbol: runRead
- kind: function
- at: 'bench/token-ab.ts:L130-L147'
- - symbol: runAgent
- kind: function
- at: 'bench/token-ab.ts:L150-L207'
- - symbol: graftPack
- kind: function
- at: 'bench/token-ab.ts:L210-L221'
- - symbol: cost
- kind: function
- at: 'bench/token-ab.ts:L223-L227'
- - symbol: row
- kind: function
- at: 'bench/token-ab.ts:L229-L231'
- - symbol: main
- kind: function
- at: 'bench/token-ab.ts:L233-L273'
- - symbol: pct
- kind: function
- at: 'bench/token-ab.ts:L253-L253'
----
-<!-- context:generated:start -->
-## Summary
-
-This system orchestrates the benchmarking of AI agents and language models, facilitating comparisons of performance metrics such as token usage, latency, and correctness across different execution arms. It integrates various components including agents, judges, and reporting tools to provide a comprehensive evaluation framework.
-
-## Related
-
-- part of [[agent]] — The agent is responsible for executing tasks and collecting metrics.
-- part of [[judge]] — The judge evaluates the correctness of the agent's responses.
-- part of [[llm-integration]] — Integrates various language models for benchmarking.
-- part of [[report]] — The report aggregates and presents benchmarking results.
-- part of [[tasks]] — Tasks define the benchmark questions and expected answers.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/code-summarization.md b/graft/code-summarization.md
deleted file mode 100644
index 995acb47..00000000
--- a/graft/code-summarization.md
+++ /dev/null
@@ -1,108 +0,0 @@
----
-name: Code Summarization
-slug: code-summarization
-type: concept
-sources:
- - path: src/ai/crux.ts
- hash: 81323b622400aadae1fd584ea09c2016ccf1bf4f14654b648ee50b1b13bd4c68
- - path: src/ai/summarize.ts
- hash: 8dbec8d421f079ec67c81701d28ed1eb648b64e074b338538d03b9063941cffd
- - path: src/ai/synthesize.ts
- hash: 7c6124323d5112abb15f0adea21962e083ea38234a8771832a71a59350fdc362
-sources_digest: 2df073fd00fbefc26907027a923c10609cf005d9cbb727ff2917374d03b251dc
-links:
- - to: benchmarking-system
- relation: validates
- description: Summarization is validated through benchmarking results.
-generator:
- version: 1
-covers:
- - symbol: NodeRef
- kind: interface
- at: 'src/ai/crux.ts:L21-L27'
- - symbol: FileCruxInput
- kind: interface
- at: 'src/ai/crux.ts:L29-L33'
- - symbol: NodeCrux
- kind: interface
- at: 'src/ai/crux.ts:L35-L40'
- - symbol: CruxSummarizer
- kind: interface
- at: 'src/ai/crux.ts:L42-L44'
- - symbol: numberLines
- kind: function
- at: 'src/ai/crux.ts:L81-L88'
- - symbol: userContent
- kind: function
- at: 'src/ai/crux.ts:L90-L99'
- - symbol: parseResults
- kind: function
- at: 'src/ai/crux.ts:L102-L114'
- - symbol: num
- kind: function
- at: 'src/ai/crux.ts:L104-L104'
- - symbol: ChatCruxSummarizer
- kind: class
- at: 'src/ai/crux.ts:L117-L140'
- - symbol: constructor
- kind: method
- at: 'src/ai/crux.ts:L118-L118'
- - symbol: describeFile
- kind: method
- at: 'src/ai/crux.ts:L120-L139'
- - symbol: Summarizer
- kind: interface
- at: 'src/ai/summarize.ts:L13-L15'
- - symbol: userContent
- kind: function
- at: 'src/ai/summarize.ts:L28-L34'
- - symbol: ChatSummarizer
- kind: class
- at: 'src/ai/summarize.ts:L37-L51'
- - symbol: constructor
- kind: method
- at: 'src/ai/summarize.ts:L38-L38'
- - symbol: summarize
- kind: method
- at: 'src/ai/summarize.ts:L40-L50'
- - symbol: SynthLink
- kind: interface
- at: 'src/ai/synthesize.ts:L12-L16'
- - symbol: SynthNode
- kind: interface
- at: 'src/ai/synthesize.ts:L19-L27'
- - symbol: FileSummary
- kind: interface
- at: 'src/ai/synthesize.ts:L30-L33'
- - symbol: Synthesizer
- kind: interface
- at: 'src/ai/synthesize.ts:L35-L37'
- - symbol: userContent
- kind: function
- at: 'src/ai/synthesize.ts:L93-L98'
- - symbol: clean
- kind: function
- at: 'src/ai/synthesize.ts:L101-L123'
- - symbol: ChatSynthesizer
- kind: class
- at: 'src/ai/synthesize.ts:L128-L154'
- - symbol: constructor
- kind: method
- at: 'src/ai/synthesize.ts:L129-L129'
- - symbol: synthesize
- kind: method
- at: 'src/ai/synthesize.ts:L131-L153'
----
-<!-- context:generated:start -->
-## Summary
-
-This concept encompasses the methods and strategies used to summarize code definitions and generate meaningful insights from source files, enhancing code navigation and understanding for engineers.
-
-## Related
-
-- validates [[benchmarking-system]] — Summarization is validated through benchmarking results.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/configuration-management.md b/graft/configuration-management.md
deleted file mode 100644
index 54e75c01..00000000
--- a/graft/configuration-management.md
+++ /dev/null
@@ -1,55 +0,0 @@
----
-name: Configuration Management
-slug: configuration-management
-type: concept
-sources:
- - path: src/ai/providers.ts
- hash: ba27e2c6d98b088685946371971e9f82c7a54bba9eaa432d44881880274eb1d6
- - path: src/claude/settings-merge.ts
- hash: eda59409ff8c470e7d3726a6740ba19e36e511ab40c67234aa794fabd9eacb8d
-sources_digest: cbca57735b2ad73fb6d62dde432844f8879809265ad6f5274082ab955c08b5b8
-links:
- - to: llm-integration
- relation: configures
- description: Configuration management affects how language models are instantiated.
-generator:
- version: 1
-covers:
- - symbol: EngineConfig
- kind: interface
- at: 'src/ai/providers.ts:L17-L39'
- - symbol: ResolvedConfig
- kind: interface
- at: 'src/ai/providers.ts:L42-L55'
- - symbol: resolveConfig
- kind: function
- at: 'src/ai/providers.ts:L71-L106'
- - symbol: Json
- kind: type
- at: 'src/claude/settings-merge.ts:L1-L1'
- - symbol: hookCmd
- kind: function
- at: 'src/claude/settings-merge.ts:L7-L9'
- - symbol: graftBlocks
- kind: function
- at: 'src/claude/settings-merge.ts:L10-L24'
- - symbol: isGraftHookEntry
- kind: function
- at: 'src/claude/settings-merge.ts:L25-L27'
- - symbol: mergeGraftSettings
- kind: function
- at: 'src/claude/settings-merge.ts:L29-L62'
----
-<!-- context:generated:start -->
-## Summary
-
-This concept involves managing and merging configuration settings for various AI model providers, ensuring that user-defined settings are correctly applied and integrated into the system.
-
-## Related
-
-- configures [[llm-integration]] — Configuration management affects how language models are instantiated.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/deterministic-testing.md b/graft/deterministic-testing.md
deleted file mode 100644
index 7c16a36d..00000000
--- a/graft/deterministic-testing.md
+++ /dev/null
@@ -1,49 +0,0 @@
----
-name: Deterministic Testing
-slug: deterministic-testing
-type: concept
-sources:
- - path: test/helpers.ts
- hash: e45af1d38d7c6d4abc804fc74e9ae4c3373cf78769c17b16b185c3ee0e2c3228
-sources_digest: ddc97a2b9b5b7ea60c6a55b3c250ddc0dffa3b335c4b43ddc9152dc900f56744
-links:
- - to: test-helpers
- relation: implements
- description: >-
- The test helpers embody the principles of deterministic testing by
- providing controlled environments.
-generator:
- version: 1
-covers:
- - symbol: PassthroughSummarizer
- kind: class
- at: 'test/helpers.ts:L9-L13'
- - symbol: summarize
- kind: method
- at: 'test/helpers.ts:L10-L12'
- - symbol: BracketSynthesizer
- kind: class
- at: 'test/helpers.ts:L21-L50'
- - symbol: synthesize
- kind: method
- at: 'test/helpers.ts:L22-L49'
- - symbol: ensure
- kind: function
- at: 'test/helpers.ts:L24-L31'
- - symbol: fakeProviders
- kind: function
- at: 'test/helpers.ts:L52-L54'
----
-<!-- context:generated:start -->
-## Summary
-
-This concept emphasizes the importance of creating tests that are isolated from external dependencies, ensuring that tests can be reliably executed without variability in results.
-
-## Related
-
-- implements [[test-helpers]] — The test helpers embody the principles of deterministic testing by providing controlled environments.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/error-handling-and-reporting.md b/graft/error-handling-and-reporting.md
deleted file mode 100644
index ac39f20f..00000000
--- a/graft/error-handling-and-reporting.md
+++ /dev/null
@@ -1,113 +0,0 @@
----
-name: Error Handling and Reporting
-slug: error-handling-and-reporting
-type: concept
-sources:
- - path: bench/run.ts
- hash: fd4445eb0d6d3c1a8b994c7e4be42522c3214612a8499e4f76bfc10d0030f9da
- - path: src/engine.ts
- hash: 55e2191dd67d1e4369c2a872f1b908937bd6034ce6f8f4b03e6c86a059e271c7
- - path: src/graph/build.ts
- hash: 10ae2a085b299a56cb90d41289a956065dd8eef358ae2abbc39db59b82a12dc9
-sources_digest: 616914a6531c73b635ea2da8eba71b3f12bdae64d0e10c2618cdd7c1ebfc658b
-links:
- - to: benchmarking-system
- relation: validates
- description: >-
- Error handling is crucial for maintaining the integrity of benchmarking
- results.
-generator:
- version: 1
-covers:
- - symbol: Args
- kind: interface
- at: 'bench/run.ts:L39-L45'
- - symbol: parseArgs
- kind: function
- at: 'bench/run.ts:L47-L67'
- - symbol: pool
- kind: function
- at: 'bench/run.ts:L70-L81'
- - symbol: worker
- kind: function
- at: 'bench/run.ts:L73-L78'
- - symbol: main
- kind: function
- at: 'bench/run.ts:L83-L204'
- - symbol: InitOptions
- kind: interface
- at: 'src/engine.ts:L28-L33'
- - symbol: CheckRunOptions
- kind: interface
- at: 'src/engine.ts:L35-L37'
- - symbol: GraphRunOptions
- kind: interface
- at: 'src/engine.ts:L39-L45'
- - symbol: Graft
- kind: class
- at: 'src/engine.ts:L47-L146'
- - symbol: constructor
- kind: method
- at: 'src/engine.ts:L50-L52'
- - symbol: init
- kind: method
- at: 'src/engine.ts:L55-L64'
- - symbol: check
- kind: method
- at: 'src/engine.ts:L67-L69'
- - symbol: checkGraph
- kind: method
- at: 'src/engine.ts:L72-L74'
- - symbol: graph
- kind: method
- at: 'src/engine.ts:L81-L88'
- - symbol: ask
- kind: method
- at: 'src/engine.ts:L95-L103'
- - symbol: chatModel
- kind: method
- at: 'src/engine.ts:L108-L125'
- - symbol: synthesizer
- kind: method
- at: 'src/engine.ts:L127-L129'
- - symbol: cruxSummarizer
- kind: method
- at: 'src/engine.ts:L132-L134'
- - symbol: summarizer
- kind: method
- at: 'src/engine.ts:L136-L138'
- - symbol: modelLabel
- kind: method
- at: 'src/engine.ts:L141-L145'
- - symbol: applyMinSubstanceGuard
- kind: function
- at: 'src/graph/build.ts:L32-L47'
- - symbol: GraphBuildOptions
- kind: interface
- at: 'src/graph/build.ts:L49-L62'
- - symbol: GraphBuildResult
- kind: interface
- at: 'src/graph/build.ts:L64-L77'
- - symbol: listSourceFiles
- kind: function
- at: 'src/graph/build.ts:L80-L82'
- - symbol: readGoModules
- kind: function
- at: 'src/graph/build.ts:L88-L102'
- - symbol: buildGraph
- kind: function
- at: 'src/graph/build.ts:L104-L215'
----
-<!-- context:generated:start -->
-## Summary
-
-This concept focuses on the strategies employed to handle errors gracefully throughout the system, ensuring that failures do not disrupt the user experience and that meaningful feedback is provided.
-
-## Related
-
-- validates [[benchmarking-system]] — Error handling is crucial for maintaining the integrity of benchmarking results.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/graph-data-integrity.md b/graft/graph-data-integrity.md
deleted file mode 100644
index 1db1eadd..00000000
--- a/graft/graph-data-integrity.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-name: Graph Data Integrity
-slug: graph-data-integrity
-type: concept
-sources:
- - path: test/graph-write.test.ts
- hash: cbbf9c3591519993ec89298444d34732f08eb16f90ba1c1cd33bd39d5512f9ff
-sources_digest: 34c4a4eb40884a5f3072352f37d7efb647f89cb7fe8b9ba43d91eacbbad0c0c0
-links:
- - to: graph-serialization
- relation: implements
- description: >-
- The serialization process must ensure that in-memory node objects remain
- unchanged.
-generator:
- version: 1
-covers:
- - symbol: makeNode
- kind: function
- at: 'test/graph-write.test.ts:L19-L35'
----
-<!-- context:generated:start -->
-## Summary
-
-This principle focuses on maintaining the integrity of graph data during serialization and deserialization processes, ensuring that no unintended mutations occur.
-
-## Related
-
-- implements [[graph-serialization]] — The serialization process must ensure that in-memory node objects remain unchanged.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/graph-extraction-and-loading.md b/graft/graph-extraction-and-loading.md
deleted file mode 100644
index ca356136..00000000
--- a/graft/graph-extraction-and-loading.md
+++ /dev/null
@@ -1,182 +0,0 @@
----
-name: Graph Extraction and Loading
-slug: graph-extraction-and-loading
-type: system
-sources:
- - path: src/graph/extract.ts
- hash: 8449958d4b5fd74c8eafeb488ae16cb60dcaf3e5fcaf1e3069cebf4cf9ef48d9
- - path: src/graph/load.ts
- hash: 115b75e947618be7755ac59310f898943cb4c1d8266bdf5a4a30fdca4956914a
- - path: src/graph/relations.ts
- hash: e62bc9934057bf232f86edcf942e71b0a2f4c44b57ffd78ddb935b85ab75aca8
- - path: src/graph/resolve.ts
- hash: 23e2e29f6e907f079f0d214ac6ce24b6105c403a51da30c2f4d39494f4b6b110
- - path: src/graph/types.ts
- hash: 27a9bdbef7783e5da94c860bc83525ef788e38a2176bc1184c8adbee539b1b51
-sources_digest: acfd590d81e375dfc632bbf862a013b910daf352d7ff1739e70ef80fd841fcfa
-links:
- - to: graph-representation
- relation: part_of
- description: This system is part of the overall graph representation architecture.
- - to: graph-representation
- relation: produces
- description: It produces structured graph representations from source code.
-generator:
- version: 1
-covers:
- - symbol: Language
- kind: type
- at: 'src/graph/extract.ts:L18-L18'
- - symbol: languageOf
- kind: function
- at: 'src/graph/extract.ts:L21-L28'
- - symbol: RawEdge
- kind: interface
- at: 'src/graph/extract.ts:L34-L45'
- - symbol: ExtractResult
- kind: interface
- at: 'src/graph/extract.ts:L47-L50'
- - symbol: searchBody
- kind: function
- at: 'src/graph/extract.ts:L67-L70'
- - symbol: fileResidual
- kind: function
- at: 'src/graph/extract.ts:L78-L89'
- - symbol: WalkCtx
- kind: interface
- at: 'src/graph/extract.ts:L136-L147'
- - symbol: DefDescriptor
- kind: interface
- at: 'src/graph/extract.ts:L150-L156'
- - symbol: parseSource
- kind: function
- at: 'src/graph/extract.ts:L164-L166'
- - symbol: extractFile
- kind: function
- at: 'src/graph/extract.ts:L168-L209'
- - symbol: walk
- kind: function
- at: 'src/graph/extract.ts:L211-L278'
- - symbol: describe
- kind: function
- at: 'src/graph/extract.ts:L282-L313'
- - symbol: describeGo
- kind: function
- at: 'src/graph/extract.ts:L318-L356'
- - symbol: goReceiverType
- kind: function
- at: 'src/graph/extract.ts:L360-L366'
- - symbol: goExported
- kind: function
- at: 'src/graph/extract.ts:L370-L374'
- - symbol: heritageEdges
- kind: function
- at: 'src/graph/extract.ts:L376-L403'
- - symbol: calleeName
- kind: function
- at: 'src/graph/extract.ts:L405-L428'
- - symbol: pyReceiver
- kind: function
- at: 'src/graph/extract.ts:L432-L441'
- - symbol: tsReceiver
- kind: function
- at: 'src/graph/extract.ts:L444-L454'
- - symbol: isImport
- kind: function
- at: 'src/graph/extract.ts:L456-L461'
- - symbol: importSpecifier
- kind: function
- at: 'src/graph/extract.ts:L463-L479'
- - symbol: clean
- kind: function
- at: 'src/graph/extract.ts:L482-L489'
- - symbol: tsExported
- kind: function
- at: 'src/graph/extract.ts:L492-L499'
- - symbol: CacheEntry
- kind: interface
- at: 'src/graph/load.ts:L31-L35'
- - symbol: __resetParseCounts
- kind: function
- at: 'src/graph/load.ts:L45-L48'
- - symbol: statOf
- kind: function
- at: 'src/graph/load.ts:L50-L57'
- - symbol: loadCached
- kind: function
- at: 'src/graph/load.ts:L59-L81'
- - symbol: loadGraphCached
- kind: function
- at: 'src/graph/load.ts:L86-L91'
- - symbol: loadAskIndexCached
- kind: function
- at: 'src/graph/load.ts:L95-L100'
- - symbol: GoModule
- kind: interface
- at: 'src/graph/resolve.ts:L39-L42'
- - symbol: ResolveOptions
- kind: interface
- at: 'src/graph/resolve.ts:L44-L49'
- - symbol: resolveEdges
- kind: function
- at: 'src/graph/resolve.ts:L51-L140'
- - symbol: add
- kind: function
- at: 'src/graph/resolve.ts:L97-L102'
- - symbol: push
- kind: function
- at: 'src/graph/resolve.ts:L142-L146'
- - symbol: resolveName
- kind: function
- at: 'src/graph/resolve.ts:L152-L164'
- - symbol: resolveTypedMember
- kind: function
- at: 'src/graph/resolve.ts:L180-L213'
- - symbol: resolveImport
- kind: function
- at: 'src/graph/resolve.ts:L219-L231'
- - symbol: resolveGoImport
- kind: function
- at: 'src/graph/resolve.ts:L243-L258'
- - symbol: Kind
- kind: type
- at: 'src/graph/types.ts:L15-L23'
- - symbol: Confidence
- kind: type
- at: 'src/graph/types.ts:L26-L26'
- - symbol: SummaryState
- kind: type
- at: 'src/graph/types.ts:L29-L29'
- - symbol: Crux
- kind: interface
- at: 'src/graph/types.ts:L33-L36'
- - symbol: NodeV1
- kind: interface
- at: 'src/graph/types.ts:L38-L63'
- - symbol: Relation
- kind: type
- at: 'src/graph/types.ts:L65-L71'
- - symbol: EdgeV1
- kind: interface
- at: 'src/graph/types.ts:L73-L78'
- - symbol: ScopeV1
- kind: interface
- at: 'src/graph/types.ts:L84-L88'
- - symbol: GraphV1
- kind: interface
- at: 'src/graph/types.ts:L90-L102'
----
-<!-- context:generated:start -->
-## Summary
-
-This component encompasses the extraction and loading of source code into a structured graph format, utilizing tree-sitter for parsing and caching mechanisms to optimize performance. It includes functionalities for tier-1 extraction, caching of graphs, and efficient loading of ask indices, ensuring that changes in source files are accurately reflected in the graph representation.
-
-## Related
-
-- part of [[graph-representation]] — This system is part of the overall graph representation architecture.
-- produces [[graph-representation]] — It produces structured graph representations from source code.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/graph-ranking.md b/graft/graph-ranking.md
deleted file mode 100644
index 5e3e3cc3..00000000
--- a/graft/graph-ranking.md
+++ /dev/null
@@ -1,46 +0,0 @@
----
-name: Graph Ranking
-slug: graph-ranking
-type: system
-sources:
- - path: test/graphrank.test.ts
- hash: 9b6450a705fd5bbe7ddead7ae29f87fcb839599d34b6bd0c8ebcb0091ee70c47
-sources_digest: 891283b4808759d18bf39767763a60e2529b6e7559323f4115f409ab61912eaa
-links:
- - to: graph-traversal-and-impact-analysis
- relation: depends_on
- description: >-
- The ranking algorithm relies on the graph structure established by the
- traversal utilities.
-generator:
- version: 1
-covers:
- - symbol: node
- kind: function
- at: 'test/graphrank.test.ts:L23-L38'
- - symbol: edge
- kind: function
- at: 'test/graphrank.test.ts:L39-L41'
- - symbol: graphOf
- kind: function
- at: 'test/graphrank.test.ts:L42-L48'
- - symbol: makeCollisionFixture
- kind: function
- at: 'test/graphrank.test.ts:L182-L192'
- - symbol: rank
- kind: function
- at: 'test/graphrank.test.ts:L194-L195'
----
-<!-- context:generated:start -->
-## Summary
-
-This component implements the personalized PageRank algorithm to rank nodes based on their connectivity, enhancing the query results by prioritizing relevant nodes in the graph.
-
-## Related
-
-- depends on [[graph-traversal-and-impact-analysis]] — The ranking algorithm relies on the graph structure established by the traversal utilities.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/graph-representation.md b/graft/graph-representation.md
deleted file mode 100644
index 60d0b330..00000000
--- a/graft/graph-representation.md
+++ /dev/null
@@ -1,64 +0,0 @@
----
-name: Graph Representation
-slug: graph-representation
-type: system
-sources:
- - path: src/graph/relations.ts
- hash: e62bc9934057bf232f86edcf942e71b0a2f4c44b57ffd78ddb935b85ab75aca8
- - path: src/graph/types.ts
- hash: 27a9bdbef7783e5da94c860bc83525ef788e38a2176bc1184c8adbee539b1b51
-sources_digest: 45b44b0500854924c7bf69043e5f45af360c55776bcf957442700620d7a3b1f4
-links:
- - to: graph-extraction-and-loading
- relation: depends_on
- description: >-
- This system relies on the types defined here for graph extraction and
- loading.
- - to: graph-traversal-and-analysis
- relation: part_of
- description: It serves as the foundational structure for graph traversal and analysis.
-generator:
- version: 1
-covers:
- - symbol: Kind
- kind: type
- at: 'src/graph/types.ts:L15-L23'
- - symbol: Confidence
- kind: type
- at: 'src/graph/types.ts:L26-L26'
- - symbol: SummaryState
- kind: type
- at: 'src/graph/types.ts:L29-L29'
- - symbol: Crux
- kind: interface
- at: 'src/graph/types.ts:L33-L36'
- - symbol: NodeV1
- kind: interface
- at: 'src/graph/types.ts:L38-L63'
- - symbol: Relation
- kind: type
- at: 'src/graph/types.ts:L65-L71'
- - symbol: EdgeV1
- kind: interface
- at: 'src/graph/types.ts:L73-L78'
- - symbol: ScopeV1
- kind: interface
- at: 'src/graph/types.ts:L84-L88'
- - symbol: GraphV1
- kind: interface
- at: 'src/graph/types.ts:L90-L102'
----
-<!-- context:generated:start -->
-## Summary
-
-This component defines the schema and types for the graph representation, including nodes and edges that represent programming constructs and their relationships. It ensures that the graph can accommodate multiple programming languages and maintains a clear structure for graph traversal and manipulation.
-
-## Related
-
-- depends on [[graph-extraction-and-loading]] — This system relies on the types defined here for graph extraction and loading.
-- part of [[graph-traversal-and-analysis]] — It serves as the foundational structure for graph traversal and analysis.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/graph-serialization.md b/graft/graph-serialization.md
deleted file mode 100644
index c37567b2..00000000
--- a/graft/graph-serialization.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-name: Graph Serialization
-slug: graph-serialization
-type: system
-sources:
- - path: test/graph-write.test.ts
- hash: cbbf9c3591519993ec89298444d34732f08eb16f90ba1c1cd33bd39d5512f9ff
-sources_digest: 34c4a4eb40884a5f3072352f37d7efb647f89cb7fe8b9ba43d91eacbbad0c0c0
-links:
- - to: graph-traversal-and-impact-analysis
- relation: uses
- description: >-
- The serialization process must accurately reflect the relationships
- defined by the graph traversal utilities.
-generator:
- version: 1
-covers:
- - symbol: makeNode
- kind: function
- at: 'test/graph-write.test.ts:L19-L35'
----
-<!-- context:generated:start -->
-## Summary
-
-This component manages the serialization and deserialization of graph data, ensuring that the in-memory representation remains intact while providing efficient storage and retrieval mechanisms.
-
-## Related
-
-- uses [[graph-traversal-and-impact-analysis]] — The serialization process must accurately reflect the relationships defined by the graph traversal utilities.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/graph-synchronization.md b/graft/graph-synchronization.md
deleted file mode 100644
index ac3bdc10..00000000
--- a/graft/graph-synchronization.md
+++ /dev/null
@@ -1,58 +0,0 @@
----
-name: Graph Synchronization
-slug: graph-synchronization
-type: concept
-sources:
- - path: src/context/check.ts
- hash: 2444e1f4dfd78208a9b54942364ee1811d064459857c6d6cee178426e278d481
- - path: src/graph/check.ts
- hash: 5358023fe498fb2878e3aa9b6756272c39926dda865c6495d8f33d13c5ceb376
-sources_digest: 9a6d9714cc8b93725ff7e5702bd59dca1a96a6a3ebb7cec5c2f2e7e72eb9f093
-links:
- - to: benchmarking-system
- relation: validates
- description: Synchronization checks are part of the overall benchmarking process.
-generator:
- version: 1
-covers:
- - symbol: CheckResult
- kind: interface
- at: 'src/context/check.ts:L22-L30'
- - symbol: CheckOptions
- kind: interface
- at: 'src/context/check.ts:L32-L35'
- - symbol: checkContext
- kind: function
- at: 'src/context/check.ts:L37-L107'
- - symbol: formatCheckReport
- kind: function
- at: 'src/context/check.ts:L110-L135'
- - symbol: short
- kind: function
- at: 'src/context/check.ts:L137-L139'
- - symbol: GraphCheckResult
- kind: interface
- at: 'src/graph/check.ts:L27-L37'
- - symbol: GraphCheckOptions
- kind: interface
- at: 'src/graph/check.ts:L39-L41'
- - symbol: checkGraph
- kind: function
- at: 'src/graph/check.ts:L43-L101'
- - symbol: formatGraphCheckReport
- kind: function
- at: 'src/graph/check.ts:L104-L135'
----
-<!-- context:generated:start -->
-## Summary
-
-This concept addresses the verification of synchronization between the context graph and the source code, ensuring that the graph accurately reflects the current state of the codebase.
-
-## Related
-
-- validates [[benchmarking-system]] — Synchronization checks are part of the overall benchmarking process.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/graph-traversal-and-analysis.md b/graft/graph-traversal-and-analysis.md
deleted file mode 100644
index 274e9dd7..00000000
--- a/graft/graph-traversal-and-analysis.md
+++ /dev/null
@@ -1,177 +0,0 @@
----
-name: Graph Traversal and Analysis
-slug: graph-traversal-and-analysis
-type: system
-sources:
- - path: src/graph/traverse-cli.ts
- hash: 080714fc91e5caefe4548e87c071b2010fdc593a670366db941d9fd2907b08e2
- - path: src/graph/traverse.ts
- hash: dd38bef08a175c1db6751823f7f6f1eaae3952227737b063373987f69c52d7fa
- - path: src/search/grep-cli.ts
- hash: 70bcb32d3ae5e4e9e39eb8b07151da7145a08756015e91f215edcadce5bddef8
- - path: src/search/grep.ts
- hash: e0ba3aaa565892e2772e4de0492931a568fc3f3724f8fca44b2a188a24e5eeb4
-sources_digest: 0d510fdb8ad732a39d2c989024794702526f50a3a8555dce95314cb5b80d3a0a
-links:
- - to: graph-extraction-and-loading
- relation: uses
- description: It utilizes the extracted graph data for traversal and analysis.
- - to: graph-representation
- relation: depends_on
- description: It depends on the graph representation defined in the previous component.
-generator:
- version: 1
-covers:
- - symbol: CallersCliOptions
- kind: interface
- at: 'src/graph/traverse-cli.ts:L21-L30'
- - symbol: headerOf
- kind: function
- at: 'src/graph/traverse-cli.ts:L38-L40'
- - symbol: hitLine
- kind: function
- at: 'src/graph/traverse-cli.ts:L44-L49'
- - symbol: callersSavings
- kind: function
- at: 'src/graph/traverse-cli.ts:L55-L65'
- - symbol: looseNoteFor
- kind: function
- at: 'src/graph/traverse-cli.ts:L68-L72'
- - symbol: SymbolJson
- kind: interface
- at: 'src/graph/traverse-cli.ts:L74-L80'
- - symbol: MatchJson
- kind: interface
- at: 'src/graph/traverse-cli.ts:L82-L86'
- - symbol: HitJson
- kind: interface
- at: 'src/graph/traverse-cli.ts:L88-L96'
- - symbol: symbolJson
- kind: function
- at: 'src/graph/traverse-cli.ts:L98-L100'
- - symbol: hitJson
- kind: function
- at: 'src/graph/traverse-cli.ts:L102-L111'
- - symbol: resolveDirection
- kind: function
- at: 'src/graph/traverse-cli.ts:L114-L119'
- - symbol: runCallersCommand
- kind: function
- at: 'src/graph/traverse-cli.ts:L127-L182'
- - symbol: Direction
- kind: type
- at: 'src/graph/traverse.ts:L21-L21'
- - symbol: SymbolMatch
- kind: interface
- at: 'src/graph/traverse.ts:L25-L27'
- - symbol: ResolveSymbolOptions
- kind: interface
- at: 'src/graph/traverse.ts:L29-L32'
- - symbol: resolveSymbol
- kind: function
- at: 'src/graph/traverse.ts:L53-L78'
- - symbol: symbolMatches
- kind: function
- at: 'src/graph/traverse.ts:L80-L89'
- - symbol: EdgeHit
- kind: interface
- at: 'src/graph/traverse.ts:L94-L99'
- - symbol: callersOf
- kind: function
- at: 'src/graph/traverse.ts:L102-L110'
- - symbol: calleesOf
- kind: function
- at: 'src/graph/traverse.ts:L113-L121'
- - symbol: impactOf
- kind: function
- at: 'src/graph/traverse.ts:L129-L131'
- - symbol: impactOfMany
- kind: function
- at: 'src/graph/traverse.ts:L149-L184'
- - symbol: symbolsInFile
- kind: function
- at: 'src/graph/traverse.ts:L188-L190'
- - symbol: impactOfFile
- kind: function
- at: 'src/graph/traverse.ts:L201-L203'
- - symbol: edgeWalk
- kind: function
- at: 'src/graph/traverse.ts:L218-L222'
- - symbol: GrepCliOptions
- kind: interface
- at: 'src/search/grep-cli.ts:L16-L23'
- - symbol: groupHeader
- kind: function
- at: 'src/search/grep-cli.ts:L25-L28'
- - symbol: formatGroup
- kind: function
- at: 'src/search/grep-cli.ts:L30-L34'
- - symbol: formatGrepHeader
- kind: function
- at: 'src/search/grep-cli.ts:L37-L40'
- - symbol: truncationNote
- kind: function
- at: 'src/search/grep-cli.ts:L43-L50'
- - symbol: formatGrepResult
- kind: function
- at: 'src/search/grep-cli.ts:L54-L62'
- - symbol: zeroHitNote
- kind: function
- at: 'src/search/grep-cli.ts:L72-L77'
- - symbol: runGrepCommand
- kind: function
- at: 'src/search/grep-cli.ts:L86-L115'
- - symbol: GrepHit
- kind: interface
- at: 'src/search/grep.ts:L18-L22'
- - symbol: GrepSymbolRef
- kind: interface
- at: 'src/search/grep.ts:L24-L32'
- - symbol: GrepGroup
- kind: interface
- at: 'src/search/grep.ts:L34-L43'
- - symbol: GrepResult
- kind: interface
- at: 'src/search/grep.ts:L45-L62'
- - symbol: GrepOptions
- kind: interface
- at: 'src/search/grep.ts:L64-L73'
- - symbol: escapeRegExp
- kind: function
- at: 'src/search/grep.ts:L79-L81'
- - symbol: spanBounds
- kind: function
- at: 'src/search/grep.ts:L83-L87'
- - symbol: SymbolSpan
- kind: interface
- at: 'src/search/grep.ts:L89-L93'
- - symbol: symbolsOf
- kind: function
- at: 'src/search/grep.ts:L97-L106'
- - symbol: enclosingSymbol
- kind: function
- at: 'src/search/grep.ts:L112-L119'
- - symbol: computeInDegree
- kind: function
- at: 'src/search/grep.ts:L123-L130'
- - symbol: toSymbolRef
- kind: function
- at: 'src/search/grep.ts:L132-L135'
- - symbol: grepGraph
- kind: function
- at: 'src/search/grep.ts:L137-L200'
----
-<!-- context:generated:start -->
-## Summary
-
-This component provides core functionalities for traversing the graph structure, enabling symbol resolution, impact analysis, and dependency tracking within the codebase. It includes CLI tools for user interaction and ensures that graph traversal is efficient and testable.
-
-## Related
-
-- uses [[graph-extraction-and-loading]] — It utilizes the extracted graph data for traversal and analysis.
-- depends on [[graph-representation]] — It depends on the graph representation defined in the previous component.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/graph-traversal-and-impact-analysis.md b/graft/graph-traversal-and-impact-analysis.md
deleted file mode 100644
index 95e57b19..00000000
--- a/graft/graph-traversal-and-impact-analysis.md
+++ /dev/null
@@ -1,55 +0,0 @@
----
-name: Graph Traversal and Impact Analysis
-slug: graph-traversal-and-impact-analysis
-type: system
-sources:
- - path: test/graph-traverse.test.ts
- hash: 9683b55f739af4afbb3840cee333eed0b1869494b66fe9cddfae1153df246947
-sources_digest: 488464ccc2ad9ea80719012d014ea2836db6f60a1b0335e18545affa4a04a7b2
-links:
- - to: graph-ranking
- relation: depends_on
- description: >-
- Impact analysis relies on the graph structure, which is influenced by the
- ranking of nodes.
- - to: graph-serialization
- relation: depends_on
- description: >-
- The graph traversal utilities are essential for validating the serialized
- output of the graph.
-generator:
- version: 1
-covers:
- - symbol: nodeStub
- kind: function
- at: 'test/graph-traverse.test.ts:L15-L30'
- - symbol: edge
- kind: function
- at: 'test/graph-traverse.test.ts:L32-L34'
- - symbol: graphOf
- kind: function
- at: 'test/graph-traverse.test.ts:L36-L42'
- - symbol: baseGraph
- kind: function
- at: 'test/graph-traverse.test.ts:L57-L66'
- - symbol: diamondGraph
- kind: function
- at: 'test/graph-traverse.test.ts:L167-L179'
- - symbol: fileAndSymbolGraph
- kind: function
- at: 'test/graph-traverse.test.ts:L221-L231'
----
-<!-- context:generated:start -->
-## Summary
-
-This component encompasses the core functionality for graph traversal, symbol resolution, and impact analysis, providing essential utilities for understanding node relationships and their implications within the graph structure.
-
-## Related
-
-- depends on [[graph-ranking]] — Impact analysis relies on the graph structure, which is influenced by the ranking of nodes.
-- depends on [[graph-serialization]] — The graph traversal utilities are essential for validating the serialized output of the graph.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/graph-visualization.md b/graft/graph-visualization.md
deleted file mode 100644
index 27c41c15..00000000
--- a/graft/graph-visualization.md
+++ /dev/null
@@ -1,213 +0,0 @@
----
-name: Graph Visualization
-slug: graph-visualization
-type: system
-sources:
- - path: viewer/data.ts
- hash: e9c5c89ad933e06004cbeddc1b1d7b60a6057726a463c66f9673ba20a3c61afd
- - path: viewer/detail.ts
- hash: fe8df7c5561f2a8588cf4e1ecb367d19cb6b480fe4855f05e4f96137d8078884
- - path: viewer/graph.ts
- hash: 192a59b16da8327457de6723893fd9207dd9570a35cd664f96534a7b85e73e01
- - path: viewer/main.ts
- hash: ab45ce4dfe66aafbe779b71d49d6370b3fe64482307b994e857ce34d3f317325
- - path: viewer/tree.ts
- hash: d66e0157f4c2a1525c16505306eb3aabce82565c3d0e56199ea5b7a860290b01
-sources_digest: fd0623540e7f7eed9942e3db2bc219f9a08b3814ac219dfb2b9a74f8c1aea966
-links:
- - to: graph-traversal-and-impact-analysis
- relation: uses
- description: >-
- The visualization relies on the traversal utilities to accurately
- represent node relationships.
-generator:
- version: 1
-covers:
- - symbol: VizNode
- kind: interface
- at: 'viewer/data.ts:L6-L12'
- - symbol: VizEdge
- kind: interface
- at: 'viewer/data.ts:L14-L20'
- - symbol: VizGraph
- kind: interface
- at: 'viewer/data.ts:L22-L26'
- - symbol: Family
- kind: type
- at: 'viewer/data.ts:L29-L29'
- - symbol: famOf
- kind: function
- at: 'viewer/data.ts:L39-L41'
- - symbol: chipKey
- kind: function
- at: 'viewer/data.ts:L47-L51'
- - symbol: colorToken
- kind: function
- at: 'viewer/data.ts:L72-L75'
- - symbol: cvar
- kind: function
- at: 'viewer/data.ts:L77-L79'
- - symbol: loadContextGraph
- kind: function
- at: 'viewer/data.ts:L81-L84'
- - symbol: CodeGraphV1
- kind: interface
- at: 'viewer/data.ts:L86-L93'
- - symbol: loadCodeGraph
- kind: function
- at: 'viewer/data.ts:L96-L113'
- - symbol: onServerChange
- kind: function
- at: 'viewer/data.ts:L116-L121'
- - symbol: esc
- kind: function
- at: 'viewer/detail.ts:L8-L10'
- - symbol: renderDetail
- kind: function
- at: 'viewer/detail.ts:L12-L58'
- - symbol: name
- kind: function
- at: 'viewer/detail.ts:L29-L29'
- - symbol: linkList
- kind: function
- at: 'viewer/detail.ts:L40-L50'
- - symbol: SimNode
- kind: interface
- at: 'viewer/graph.ts:L22-L30'
- - symbol: SimEdge
- kind: interface
- at: 'viewer/graph.ts:L32-L38'
- - symbol: el
- kind: function
- at: 'viewer/graph.ts:L42-L46'
- - symbol: GraphView
- kind: class
- at: 'viewer/graph.ts:L48-L334'
- - symbol: constructor
- kind: method
- at: 'viewer/graph.ts:L65-L69'
- - symbol: buildChrome
- kind: method
- at: 'viewer/graph.ts:L71-L78'
- - symbol: ensureMarkers
- kind: method
- at: 'viewer/graph.ts:L80-L91'
- - symbol: setData
- kind: method
- at: 'viewer/graph.ts:L94-L136'
- - symbol: buildElements
- kind: method
- at: 'viewer/graph.ts:L138-L164'
- - symbol: tick
- kind: method
- at: 'viewer/graph.ts:L166-L182'
- - symbol: restyle
- kind: method
- at: 'viewer/graph.ts:L185-L243'
- - symbol: nodeShown
- kind: function
- at: 'viewer/graph.ts:L195-L195'
- - symbol: select
- kind: method
- at: 'viewer/graph.ts:L245-L249'
- - symbol: focus
- kind: method
- at: 'viewer/graph.ts:L252-L261'
- - symbol: firstMatch
- kind: method
- at: 'viewer/graph.ts:L263-L266'
- - symbol: applyView
- kind: method
- at: 'viewer/graph.ts:L268-L270'
- - symbol: zoomBy
- kind: method
- at: 'viewer/graph.ts:L272-L279'
- - symbol: resetView
- kind: method
- at: 'viewer/graph.ts:L281-L284'
- - symbol: reheat
- kind: method
- at: 'viewer/graph.ts:L286-L288'
- - symbol: bindDrag
- kind: method
- at: 'viewer/graph.ts:L290-L309'
- - symbol: move
- kind: function
- at: 'viewer/graph.ts:L294-L299'
- - symbol: up
- kind: function
- at: 'viewer/graph.ts:L300-L305'
- - symbol: bindPanZoom
- kind: method
- at: 'viewer/graph.ts:L311-L333'
- - symbol: Tab
- kind: type
- at: 'viewer/main.ts:L10-L10'
- - symbol: $
- kind: function
- at: 'viewer/main.ts:L12-L12'
- - symbol: activeGraph
- kind: function
- at: 'viewer/main.ts:L23-L25'
- - symbol: graphTab
- kind: function
- at: 'viewer/main.ts:L27-L29'
- - symbol: renderChips
- kind: function
- at: 'viewer/main.ts:L32-L60'
- - symbol: rank
- kind: function
- at: 'viewer/main.ts:L43-L43'
- - symbol: glyphFor
- kind: function
- at: 'viewer/main.ts:L62-L71'
- - symbol: renderLegend
- kind: function
- at: 'viewer/main.ts:L74-L94'
- - symbol: updateShownCount
- kind: function
- at: 'viewer/main.ts:L96-L101'
- - symbol: updateCounts
- kind: function
- at: 'viewer/main.ts:L103-L112'
- - symbol: showDetail
- kind: function
- at: 'viewer/main.ts:L115-L124'
- - symbol: setTab
- kind: function
- at: 'viewer/main.ts:L129-L167'
- - symbol: showEmpty
- kind: function
- at: 'viewer/main.ts:L169-L173'
- - symbol: loadAll
- kind: function
- at: 'viewer/main.ts:L216-L223'
- - symbol: esc
- kind: function
- at: 'viewer/tree.ts:L7-L9'
- - symbol: renderOutline
- kind: function
- at: 'viewer/tree.ts:L11-L66'
- - symbol: kids
- kind: function
- at: 'viewer/tree.ts:L18-L22'
- - symbol: countDesc
- kind: function
- at: 'viewer/tree.ts:L23-L26'
- - symbol: row
- kind: function
- at: 'viewer/tree.ts:L29-L42'
----
-<!-- context:generated:start -->
-## Summary
-
-This component is responsible for rendering and displaying the graph data, providing interactive visualizations that allow users to explore node relationships and details effectively.
-
-## Related
-
-- uses [[graph-traversal-and-impact-analysis]] — The visualization relies on the traversal utilities to accurately represent node relationships.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/host-configuration-management.md b/graft/host-configuration-management.md
deleted file mode 100644
index e09a3d49..00000000
--- a/graft/host-configuration-management.md
+++ /dev/null
@@ -1,57 +0,0 @@
----
-name: Host Configuration Management
-slug: host-configuration-management
-type: system
-sources:
- - path: test/hosts-codex-hooks.test.ts
- hash: ed49a8a106eeb458ad2dd071071cefae17dd4d0eabd1b74006047feadef9a89a
- - path: test/hosts-init.test.ts
- hash: 56f8988468cb716296b40c939bf58d079015d135fcb3f2c1481e64bce7f67324
- - path: test/hosts-mcp-config.test.ts
- hash: 5b3ec5afd61079f051d8063f06701ddac608f48b706e72f9ee607e8da673fb06
- - path: test/hosts-registry.test.ts
- hash: 6490cbdc54b870d670adf28b5b469e07360a474073b08d692601ef1c4b7ea47e
- - path: test/hosts-sections.test.ts
- hash: a780abe63074737d40bcd556df06b7b541d2694df75c307daabd280f64f9dba4
-sources_digest: bc0c33ccee8f4a029f0fb4af261138907cc7b85f4f063f18ef3cb49d03076555
-links:
- - to: graph-serialization
- relation: produces
- description: >-
- Host configurations may influence the structure and serialization of the
- graph.
-generator:
- version: 1
-covers:
- - symbol: fresh
- kind: function
- at: 'test/hosts-codex-hooks.test.ts:L8-L8'
- - symbol: fresh
- kind: function
- at: 'test/hosts-init.test.ts:L9-L9'
- - symbol: fresh
- kind: function
- at: 'test/hosts-mcp-config.test.ts:L8-L8'
- - symbol: probeFor
- kind: function
- at: 'test/hosts-registry.test.ts:L9-L14'
- - symbol: fresh
- kind: function
- at: 'test/hosts-registry.test.ts:L15-L15'
- - symbol: fresh
- kind: function
- at: 'test/hosts-sections.test.ts:L8-L8'
----
-<!-- context:generated:start -->
-## Summary
-
-This component manages the initialization and configuration of hosts within the repository, ensuring that host-specific settings are correctly applied and maintained across different environments.
-
-## Related
-
-- produces [[graph-serialization]] — Host configurations may influence the structure and serialization of the graph.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/host-management-and-configuration.md b/graft/host-management-and-configuration.md
deleted file mode 100644
index dc57c604..00000000
--- a/graft/host-management-and-configuration.md
+++ /dev/null
@@ -1,131 +0,0 @@
----
-name: Host Management and Configuration
-slug: host-management-and-configuration
-type: system
-sources:
- - path: src/hosts/codex-hooks.ts
- hash: 0b9ba9ba677876d1adf4ce8d05aa534cddfbdeb7060ed11a92111a41a76d1512
- - path: src/hosts/init.ts
- hash: cd3ef307f207a48b82fa81ea55e34fdc97b8663612ad639a3256336d5531afa0
- - path: src/hosts/instructions.ts
- hash: 1dddea660f4d5e65952faf2beee42f04153ccab893658e75bda1dce6c0245b18
- - path: src/hosts/mcp-config.ts
- hash: c3a3dea18371806ed352e7cab582265db2341b7d4ea5797578e495b512a9b0b3
- - path: src/hosts/registry.ts
- hash: 0a8a2b82f0e4e1010943eb69d2eee7d9c4549f884967d5af1b8317c38ef99c18
- - path: src/hosts/sections.ts
- hash: f172618889d5a02683032df8c69dd85b71c00c72a8b76958305ade22d6cda714
-sources_digest: da51b260a6b5e65f9dc1fa578e44a81309e6379f05f575b42378a1a646d63bb7
-links:
- - to: graph-extraction-and-loading
- relation: part_of
- description: >-
- This system is part of the overall architecture that supports host
- interactions.
- - to: graph-representation
- relation: configures
- description: >-
- It configures the behavior of the graph representation based on host
- settings.
-generator:
- version: 1
-covers:
- - symbol: HookWrite
- kind: interface
- at: 'src/hosts/codex-hooks.ts:L11-L15'
- - symbol: dirExists
- kind: function
- at: 'src/hosts/codex-hooks.ts:L17-L19'
- - symbol: writeOwned
- kind: function
- at: 'src/hosts/codex-hooks.ts:L21-L31'
- - symbol: isGraftEntry
- kind: function
- at: 'src/hosts/codex-hooks.ts:L33-L35'
- - symbol: installCodexHooks
- kind: function
- at: 'src/hosts/codex-hooks.ts:L37-L74'
- - symbol: HostsInitResult
- kind: interface
- at: 'src/hosts/init.ts:L14-L20'
- - symbol: probeFor
- kind: function
- at: 'src/hosts/init.ts:L22-L27'
- - symbol: writeOwned
- kind: function
- at: 'src/hosts/init.ts:L29-L35'
- - symbol: runHostsInit
- kind: function
- at: 'src/hosts/init.ts:L37-L72'
- - symbol: instructionBody
- kind: function
- at: 'src/hosts/instructions.ts:L6-L46'
- - symbol: cursorRule
- kind: function
- at: 'src/hosts/instructions.ts:L48-L55'
- - symbol: kiroSteering
- kind: function
- at: 'src/hosts/instructions.ts:L57-L63'
- - symbol: windsurfRule
- kind: function
- at: 'src/hosts/instructions.ts:L65-L68'
- - symbol: McpWrite
- kind: interface
- at: 'src/hosts/mcp-config.ts:L10-L14'
- - symbol: dirExists
- kind: function
- at: 'src/hosts/mcp-config.ts:L19-L21'
- - symbol: mergeJsonKey
- kind: function
- at: 'src/hosts/mcp-config.ts:L23-L43'
- - symbol: upsertCodexToml
- kind: function
- at: 'src/hosts/mcp-config.ts:L45-L54'
- - symbol: registerMcpConfigs
- kind: function
- at: 'src/hosts/mcp-config.ts:L56-L87'
- - symbol: DetectProbe
- kind: interface
- at: 'src/hosts/registry.ts:L12-L16'
- - symbol: HostTarget
- kind: interface
- at: 'src/hosts/registry.ts:L18-L26'
- - symbol: hostIds
- kind: function
- at: 'src/hosts/registry.ts:L82-L84'
- - symbol: detectHosts
- kind: function
- at: 'src/hosts/registry.ts:L86-L88'
- - symbol: UpsertAction
- kind: type
- at: 'src/hosts/sections.ts:L11-L11'
- - symbol: LineEnding
- kind: type
- at: 'src/hosts/sections.ts:L13-L13'
- - symbol: fencedBlock
- kind: function
- at: 'src/hosts/sections.ts:L15-L21'
- - symbol: detectEol
- kind: function
- at: 'src/hosts/sections.ts:L24-L26'
- - symbol: markerLineIndex
- kind: function
- at: 'src/hosts/sections.ts:L29-L34'
- - symbol: upsertSection
- kind: function
- at: 'src/hosts/sections.ts:L36-L67'
----
-<!-- context:generated:start -->
-## Summary
-
-This component manages the configuration and initialization of various coding hosts, allowing the Graft system to interact with different environments. It includes functionality for setting up hooks, managing instruction files, and ensuring that the environment is correctly configured for user interactions.
-
-## Related
-
-- part of [[graph-extraction-and-loading]] — This system is part of the overall architecture that supports host interactions.
-- configures [[graph-representation]] — It configures the behavior of the graph representation based on host settings.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/idempotent-host-initialization.md b/graft/idempotent-host-initialization.md
deleted file mode 100644
index 5acc73f0..00000000
--- a/graft/idempotent-host-initialization.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-name: Idempotent Host Initialization
-slug: idempotent-host-initialization
-type: concept
-sources:
- - path: test/hosts-init.test.ts
- hash: 56f8988468cb716296b40c939bf58d079015d135fcb3f2c1481e64bce7f67324
-sources_digest: f7070057632565b4c1a7232ff4218cdefd56e5b26dacbe4e874e1c73a6ffb332
-links:
- - to: host-configuration-management
- relation: implements
- description: >-
- The host initialization process must adhere to idempotency to maintain
- configuration integrity.
-generator:
- version: 1
-covers:
- - symbol: fresh
- kind: function
- at: 'test/hosts-init.test.ts:L9-L9'
----
-<!-- context:generated:start -->
-## Summary
-
-This design principle ensures that host initialization functions do not alter already configured repositories, allowing for safe repeated executions without unintended side effects.
-
-## Related
-
-- implements [[host-configuration-management]] — The host initialization process must adhere to idempotency to maintain configuration integrity.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/judge.md b/graft/judge.md
deleted file mode 100644
index 2c0d02c6..00000000
--- a/graft/judge.md
+++ /dev/null
@@ -1,41 +0,0 @@
----
-name: Judge
-slug: judge
-type: system
-sources:
- - path: bench/judge.ts
- hash: bb48a8012b929bc0237f4d900d0ab7aa9a98f96777d72a89ce5305c6c57e6c47
-sources_digest: b7c143d704da46109b37f03f603d29dcdd327ce19900ddfdf1b58ac4ead126ba
-links:
- - to: llm-integration
- relation: uses
- description: The judge uses language models to evaluate answers.
-generator:
- version: 1
-covers:
- - symbol: Verdict
- kind: interface
- at: 'bench/judge.ts:L18-L24'
- - symbol: JudgeInput
- kind: interface
- at: 'bench/judge.ts:L26-L32'
- - symbol: extractJson
- kind: function
- at: 'bench/judge.ts:L35-L49'
- - symbol: judge
- kind: function
- at: 'bench/judge.ts:L51-L86'
----
-<!-- context:generated:start -->
-## Summary
-
-The judge component evaluates the correctness of the agent's responses against reference answers, utilizing a two-layer scoring system that includes keyword checks and model evaluations. It ensures robust and consistent assessment of AI-generated answers.
-
-## Related
-
-- uses [[llm-integration]] — The judge uses language models to evaluate answers.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/llm-integration.md b/graft/llm-integration.md
deleted file mode 100644
index 51169ffc..00000000
--- a/graft/llm-integration.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-name: LLM Integration
-slug: llm-integration
-type: system
-sources:
- - path: bench/llm.ts
- hash: 6fc86553ce48879cb28b411747fe3ffaa2ad5c269e5de50d83e4ed8b629cae2b
-sources_digest: 4f4e246df7420566c35c5613d87662927000d8a548af5960275c64cc0a6e125e
-links:
- - to: agent
- relation: produces
- description: The LLM integration provides models that the agent uses for processing.
- - to: judge
- relation: produces
- description: The LLM integration provides models that the judge uses for evaluation.
-generator:
- version: 1
-covers:
- - symbol: makeChatModel
- kind: function
- at: 'bench/llm.ts:L16-L28'
----
-<!-- context:generated:start -->
-## Summary
-
-This component serves as the integration layer for various language models used in the benchmarking process, allowing for flexible configuration and interaction with different AI providers. It ensures that models are correctly instantiated and utilized across the system.
-
-## Related
-
-- produces [[agent]] — The LLM integration provides models that the agent uses for processing.
-- produces [[judge]] — The LLM integration provides models that the judge uses for evaluation.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/manifest.json b/graft/manifest.json
deleted file mode 100644
index d537a2dc..00000000
--- a/graft/manifest.json
+++ /dev/null
@@ -1,776 +0,0 @@
-{
- "version": 1,
- "model": "openai:openai/gpt-4o-mini",
- "repoDigest": "35887975b3454c31ed185360b52aa4b8e96a0a27c5422961a28cde187f125978",
- "files": [
- {
- "path": "bench/agent.ts",
- "hash": "34a496d38f2dfc14688cb4f0981262d79dacef165bd1a4f9874b94c31e1819e9"
- },
- {
- "path": "bench/judge.ts",
- "hash": "bb48a8012b929bc0237f4d900d0ab7aa9a98f96777d72a89ce5305c6c57e6c47"
- },
- {
- "path": "bench/llm.ts",
- "hash": "6fc86553ce48879cb28b411747fe3ffaa2ad5c269e5de50d83e4ed8b629cae2b"
- },
- {
- "path": "bench/report.ts",
- "hash": "17c0be550f9712165177d070f58cbe7a0f60fcb2c1dc5830eb1a4dde97ec12f3"
- },
- {
- "path": "bench/run.ts",
- "hash": "fd4445eb0d6d3c1a8b994c7e4be42522c3214612a8499e4f76bfc10d0030f9da"
- },
- {
- "path": "bench/selfcheck.ts",
- "hash": "858ec7cce92c9105c4e111ae58f1d1a1b1b57372b96768804308009760c9b2f6"
- },
- {
- "path": "bench/tasks.ts",
- "hash": "efb90e69f52adcb08bfe45fb5a983fc676df68befdc455513e2581a24f46807e"
- },
- {
- "path": "bench/token-ab.ts",
- "hash": "b033a023d063cccc329103fbd11d4e1a6ab16c5eb027e1dd85c47a63a7df4ff1"
- },
- {
- "path": "install.sh",
- "hash": "e320ae0015d2d1fa093b919c95a1c233ccb355888f3c8cadd2b6ef0d97559467"
- },
- {
- "path": "scripts/build-viewer.mjs",
- "hash": "fb4ba16d7815dbdbaf2fd818362f914671903132be5573fbdd9a7734549b833d"
- },
- {
- "path": "scripts/postinstall.mjs",
- "hash": "2836cb69bc03453bc22abcae91d58de0a06881ee7f975fe86967aedf5d2d6188"
- },
- {
- "path": "src/ai/crux.ts",
- "hash": "81323b622400aadae1fd584ea09c2016ccf1bf4f14654b648ee50b1b13bd4c68"
- },
- {
- "path": "src/ai/llm/anthropic.ts",
- "hash": "db2b6db5102af2045a3f85933faeac8ef9b0c17bc2fcbfd3b41629622bb9551b"
- },
- {
- "path": "src/ai/llm/factory.ts",
- "hash": "d7d22f3b6af8380ff1073ddd6934eda35b3c6b95a1976223751136c0cd26122a"
- },
- {
- "path": "src/ai/llm/openai.ts",
- "hash": "6cb2677125f9a2c8c617fb1aef072fad13b87413d5ec40bebf3e21e0acc784df"
- },
- {
- "path": "src/ai/llm/types.ts",
- "hash": "8cb0f2a715498ae396ca2f5d6f14711be026346b218e07da0b30909d3cd93c93"
- },
- {
- "path": "src/ai/providers.ts",
- "hash": "ba27e2c6d98b088685946371971e9f82c7a54bba9eaa432d44881880274eb1d6"
- },
- {
- "path": "src/ai/summarize.ts",
- "hash": "8dbec8d421f079ec67c81701d28ed1eb648b64e074b338538d03b9063941cffd"
- },
- {
- "path": "src/ai/synthesize.ts",
- "hash": "7c6124323d5112abb15f0adea21962e083ea38234a8771832a71a59350fdc362"
- },
- {
- "path": "src/ask/ask.ts",
- "hash": "62d693c39f77019e50437b5285fafe5802b8b077e7aa6545589a3b084f93e552"
- },
- {
- "path": "src/ask/graphrank.ts",
- "hash": "a8dfba7907ce7fea84669ddf9ca20f14392b7d1edb5b76db0acf522465078cd5"
- },
- {
- "path": "src/ask/index-file.ts",
- "hash": "8250b5189d515c4e4bf1573c4c44c96563e121c944951c5f16029c62da62d854"
- },
- {
- "path": "src/claude/format.ts",
- "hash": "de278daec7071243ac381603d43817c6589406a1c8d03cef4d0bcf58b4b1d902"
- },
- {
- "path": "src/claude/hooks.ts",
- "hash": "efe4393aec6f4ab0854042b1300e8e1af899d820e6819fd0ad2d2374d321ffee"
- },
- {
- "path": "src/claude/init.ts",
- "hash": "7a686f132722453ee18c4715e4ab563f1577ac41811b01cced574de075a452ee"
- },
- {
- "path": "src/claude/paths.ts",
- "hash": "d4bde8a45859c88921abd6fd06c700199bf1feaf2e5487e8e0e217cf9dab5026"
- },
- {
- "path": "src/claude/settings-merge.ts",
- "hash": "eda59409ff8c470e7d3726a6740ba19e36e511ab40c67234aa794fabd9eacb8d"
- },
- {
- "path": "src/claude/shim-template.ts",
- "hash": "53c468c5de89b06fb76439c756932592409eba5fc19ba07ff6a37403912033a9"
- },
- {
- "path": "src/claude/skill-template.ts",
- "hash": "4e951868562ef41f827b4828dc1931cf1e645d2e57999308b1919f62de5af7fb"
- },
- {
- "path": "src/claude/state.ts",
- "hash": "f8b8d93b534be15a3d71565e63a63caa302f036348d20dcd645fb49f25db3f61"
- },
- {
- "path": "src/claude/stats.ts",
- "hash": "fc205923682e656d3e68bf301ba25702b827262f12057910615b4b648de3338b"
- },
- {
- "path": "src/claude/statusline.ts",
- "hash": "0708f2f773f65b931d488688d898c56344cd930fae1af6614a579e6fb47fae16"
- },
- {
- "path": "src/claude/sync-run.ts",
- "hash": "7ee672e67d3167a38e9577a673656f7958c69b48e62ec715850a9b14599a1d2a"
- },
- {
- "path": "src/cli-epilogue.ts",
- "hash": "a4534c83c0a600020421be92882a83db7fda3e1626a38702fc372bb3c523a232"
- },
- {
- "path": "src/cli-meta.ts",
- "hash": "95ee44a152ed1936f0461b2452d9902fbf422555da9f01e8f5ff57fbb84a2f00"
- },
- {
- "path": "src/cli.ts",
- "hash": "2c7acb076bd022635defd0b67c5358edd3b662328050be6c2d976e6baa17fc9c"
- },
- {
- "path": "src/context/build.ts",
- "hash": "8c614e5dc6b1ef2d6949016ce7480099f95f021ea6b0882f2919397f97a68ce7"
- },
- {
- "path": "src/context/check.ts",
- "hash": "2444e1f4dfd78208a9b54942364ee1811d064459857c6d6cee178426e278d481"
- },
- {
- "path": "src/context/node-file.ts",
- "hash": "9e958d74597b4d6d31fa5391882ddab8faab4076d7d33f93de861ab6c2e0b93a"
- },
- {
- "path": "src/engine.ts",
- "hash": "55e2191dd67d1e4369c2a872f1b908937bd6034ce6f8f4b03e6c86a059e271c7"
- },
- {
- "path": "src/graph/bindings.ts",
- "hash": "5cfcbb66a1aa754f3b56d68c09d5bcf52f5002a67abd70cc8f1a8d0c1dddce6a"
- },
- {
- "path": "src/graph/build.ts",
- "hash": "10ae2a085b299a56cb90d41289a956065dd8eef358ae2abbc39db59b82a12dc9"
- },
- {
- "path": "src/graph/cards.ts",
- "hash": "c45f4bd1be271a9c5ff01c04bae2a2d4fd761eb85bd8d4a302738e6744e636b1"
- },
- {
- "path": "src/graph/check.ts",
- "hash": "5358023fe498fb2878e3aa9b6756272c39926dda865c6495d8f33d13c5ceb376"
- },
- {
- "path": "src/graph/enrich.ts",
- "hash": "c15a0aef99e54d4c24ac748a9b33373512f1511b1f5bcd830f9d2e407ff47917"
- },
- {
- "path": "src/graph/extract.ts",
- "hash": "8449958d4b5fd74c8eafeb488ae16cb60dcaf3e5fcaf1e3069cebf4cf9ef48d9"
- },
- {
- "path": "src/graph/load.ts",
- "hash": "115b75e947618be7755ac59310f898943cb4c1d8266bdf5a4a30fdca4956914a"
- },
- {
- "path": "src/graph/map.ts",
- "hash": "aa982e0a06ce4e8d3af76cec5847846d495f36ace8835fe6bf70805429346ffd"
- },
- {
- "path": "src/graph/relations.ts",
- "hash": "e62bc9934057bf232f86edcf942e71b0a2f4c44b57ffd78ddb935b85ab75aca8"
- },
- {
- "path": "src/graph/resolve.ts",
- "hash": "23e2e29f6e907f079f0d214ac6ce24b6105c403a51da30c2f4d39494f4b6b110"
- },
- {
- "path": "src/graph/traverse-cli.ts",
- "hash": "080714fc91e5caefe4548e87c071b2010fdc593a670366db941d9fd2907b08e2"
- },
- {
- "path": "src/graph/traverse.ts",
- "hash": "dd38bef08a175c1db6751823f7f6f1eaae3952227737b063373987f69c52d7fa"
- },
- {
- "path": "src/graph/types.ts",
- "hash": "27a9bdbef7783e5da94c860bc83525ef788e38a2176bc1184c8adbee539b1b51"
- },
- {
- "path": "src/graph/write.ts",
- "hash": "a8f0d1b3efed9ca1ac3c22175c46c7a737b91bf632930ebb4437ebf52326ed69"
- },
- {
- "path": "src/hosts/codex-hooks.ts",
- "hash": "0b9ba9ba677876d1adf4ce8d05aa534cddfbdeb7060ed11a92111a41a76d1512"
- },
- {
- "path": "src/hosts/init.ts",
- "hash": "cd3ef307f207a48b82fa81ea55e34fdc97b8663612ad639a3256336d5531afa0"
- },
- {
- "path": "src/hosts/instructions.ts",
- "hash": "1dddea660f4d5e65952faf2beee42f04153ccab893658e75bda1dce6c0245b18"
- },
- {
- "path": "src/hosts/mcp-config.ts",
- "hash": "c3a3dea18371806ed352e7cab582265db2341b7d4ea5797578e495b512a9b0b3"
- },
- {
- "path": "src/hosts/registry.ts",
- "hash": "0a8a2b82f0e4e1010943eb69d2eee7d9c4549f884967d5af1b8317c38ef99c18"
- },
- {
- "path": "src/hosts/sections.ts",
- "hash": "f172618889d5a02683032df8c69dd85b71c00c72a8b76958305ade22d6cda714"
- },
- {
- "path": "src/index.ts",
- "hash": "f66577d7952e061dd28f782e39f572fe9421a52758e9151f2620739894dd006d"
- },
- {
- "path": "src/ingest/fs.ts",
- "hash": "a8339532da34b44d35eb9ad16e7106adb1262d73d9895b1bd94574337fb2019f"
- },
- {
- "path": "src/mcp/server.ts",
- "hash": "0bdeba850ab62132a01b683cd2db7ee36a7509a67ebd58e73887a22a611ce100"
- },
- {
- "path": "src/mcp/tools.ts",
- "hash": "26d386319a711ec0eb758a2561513dc05e164f2c4d5828b6089b41db2b0a715b"
- },
- {
- "path": "src/search/grep-cli.ts",
- "hash": "70bcb32d3ae5e4e9e39eb8b07151da7145a08756015e91f215edcadce5bddef8"
- },
- {
- "path": "src/search/grep.ts",
- "hash": "e0ba3aaa565892e2772e4de0492931a568fc3f3724f8fca44b2a188a24e5eeb4"
- },
- {
- "path": "src/util/id.ts",
- "hash": "5fabc8ddcc3abc907ce69f04ad2ebe51933262cf44aa2dfd40589f71f1926e8a"
- },
- {
- "path": "src/viz/assemble.ts",
- "hash": "58ad5caed087bd7b929f5b625501a607e79e0476f998636bec241e0296706ece"
- },
- {
- "path": "src/viz/serve.ts",
- "hash": "14283762f454c01fc95cfbe9c2b41ef063fc17c4c3e5d120b5dc7f66f541fc1c"
- },
- {
- "path": "test/ask-index.test.ts",
- "hash": "c9cd7c011ebd661f35488c59dcd34801079f2786d56e96833f4da7c45dfa37d7"
- },
- {
- "path": "test/ask.test.ts",
- "hash": "3445f8b156ba6b2f0e9123e9fc45781da352ec6d5baeb985ee144fe5aecaafb3"
- },
- {
- "path": "test/claude-format.test.ts",
- "hash": "cfaa9f489dd95956e3c9917ebe29a46992dfdbab943b5971eecbd98f18b3268c"
- },
- {
- "path": "test/claude-hooks.test.ts",
- "hash": "875c10776da455499b58ebe861b3cb0ae797f751e4e838812cd0b4f3c13587c2"
- },
- {
- "path": "test/claude-init.test.ts",
- "hash": "b582cd79b2a1e4952ff83ac1b2e85f742756443c2896e08d96a75dc76e2971a5"
- },
- {
- "path": "test/claude-paths.test.ts",
- "hash": "205740f8110e72e4cb24652c09f763fad5e056dc77776bcfa95a1953731ed2c8"
- },
- {
- "path": "test/claude-settings-merge.test.ts",
- "hash": "4c8b800f02d1b72050082bdbcdcda0878e5d9760563d2e1ca4a31cb06ffaaabb"
- },
- {
- "path": "test/claude-shim-template.test.ts",
- "hash": "f787f99fef2dc6a5ed366419fc470e8e4f825e0bc590cf3550d39e01995e7619"
- },
- {
- "path": "test/claude-skill-template.test.ts",
- "hash": "49f60183a51f9c307a33b5d4da3a7ded2f55509407e6a85778f3512b27db7cde"
- },
- {
- "path": "test/claude-state.test.ts",
- "hash": "78e6a81af7642ea788072457ea181bc626c7a8a898cfebb882ab42fed7e9dd2e"
- },
- {
- "path": "test/claude-stats.test.ts",
- "hash": "f625d026d152a65017699e37e27534043dc0af0f43ba2d3ea778bac8ddab82c3"
- },
- {
- "path": "test/claude-statusline.test.ts",
- "hash": "07128b5b195af3a37c1e170a35c18378e36160d1a6f8e17be362bac315811cac"
- },
- {
- "path": "test/cli-meta.test.ts",
- "hash": "e7a05bf838e876a317276f94a26d92b0b1526e1ea7eabda4e68b804bdb0334e5"
- },
- {
- "path": "test/context.test.ts",
- "hash": "126861c136d48ed6a148e50226c96ec2935c52cf83ef56fbd43392e0d271db1f"
- },
- {
- "path": "test/covers.test.ts",
- "hash": "f5a75f405be1a01ad43fc806588858df3a8988fee62ad4ec024440d3f5e0fc0c"
- },
- {
- "path": "test/graph-bindings.test.ts",
- "hash": "b6892b1b6982547fc67d5b0e7812a536e47018ab3e38e4eda35a0f12f24ab8db"
- },
- {
- "path": "test/graph-go.test.ts",
- "hash": "bf11085a7edb03c00d52dca090af9c1ca4eb3cb34bb88904bbdd478171d3483d"
- },
- {
- "path": "test/graph-load.test.ts",
- "hash": "8df11988d049b5243d8c7a0d55045163b714965897448797b40c8ef458b0896b"
- },
- {
- "path": "test/graph-map.test.ts",
- "hash": "97c06030735d5dbb15270b73a594e1de8fb3ffba5c6551b6303a5357b8da31be"
- },
- {
- "path": "test/graph-resolve-typed.test.ts",
- "hash": "0c3760525cc61ee97de448fa26b4a5b9a3bb07c03b4acfbdf3608541b189cf81"
- },
- {
- "path": "test/graph-traverse-cli.test.ts",
- "hash": "d79347b0640178631235552105c0518029305ead4990726470d3adf5a1b52f09"
- },
- {
- "path": "test/graph-traverse.test.ts",
- "hash": "9683b55f739af4afbb3840cee333eed0b1869494b66fe9cddfae1153df246947"
- },
- {
- "path": "test/graph-write.test.ts",
- "hash": "cbbf9c3591519993ec89298444d34732f08eb16f90ba1c1cd33bd39d5512f9ff"
- },
- {
- "path": "test/graphrank.test.ts",
- "hash": "9b6450a705fd5bbe7ddead7ae29f87fcb839599d34b6bd0c8ebcb0091ee70c47"
- },
- {
- "path": "test/helpers.ts",
- "hash": "e45af1d38d7c6d4abc804fc74e9ae4c3373cf78769c17b16b185c3ee0e2c3228"
- },
- {
- "path": "test/hosts-codex-hooks.test.ts",
- "hash": "ed49a8a106eeb458ad2dd071071cefae17dd4d0eabd1b74006047feadef9a89a"
- },
- {
- "path": "test/hosts-init.test.ts",
- "hash": "56f8988468cb716296b40c939bf58d079015d135fcb3f2c1481e64bce7f67324"
- },
- {
- "path": "test/hosts-instructions.test.ts",
- "hash": "37ae3aae1157c1e1eb39ef5670b363d517aaf3028ca8fb56581193b81a83cad7"
- },
- {
- "path": "test/hosts-mcp-config.test.ts",
- "hash": "5b3ec5afd61079f051d8063f06701ddac608f48b706e72f9ee607e8da673fb06"
- },
- {
- "path": "test/hosts-registry.test.ts",
- "hash": "6490cbdc54b870d670adf28b5b469e07360a474073b08d692601ef1c4b7ea47e"
- },
- {
- "path": "test/hosts-sections.test.ts",
- "hash": "a780abe63074737d40bcd556df06b7b541d2694df75c307daabd280f64f9dba4"
- },
- {
- "path": "test/llm-adapters.test.ts",
- "hash": "53081583f9a2ef8a7f925fcce6554201fb8a10184ac835f3879cb3f04700f346"
- },
- {
- "path": "test/llm-ops.test.ts",
- "hash": "ef3ba575506602feeb3048a6bded8bd2a92e9a59054c569352e82d1a847b80af"
- },
- {
- "path": "test/mcp-server.test.ts",
- "hash": "4d828181f0a8c645f00097ab43c2bdcf5bc65da276e83b7503bc2888ae09f254"
- },
- {
- "path": "test/mcp-tools.test.ts",
- "hash": "22d3a32a85a0ba1542969786e8bda07d3df02ee068554d4070f705d30d7239dc"
- },
- {
- "path": "test/search-grep.test.ts",
- "hash": "a23b17c1a455374c4b4172834c51bb6c5e5ed5abbc891df16ee7cb4aeae9b5c0"
- },
- {
- "path": "test/viz-assemble.test.ts",
- "hash": "89a2a9f11f459a8110f9d89b2de780dfd164504f3b4c7dc61953a6c83c5911cb"
- },
- {
- "path": "test/viz-serve.test.ts",
- "hash": "d22168054844e83bc5257271c4cc80a6e3eb1315e600c03b48fe6b54afd5c243"
- },
- {
- "path": "viewer/data.ts",
- "hash": "e9c5c89ad933e06004cbeddc1b1d7b60a6057726a463c66f9673ba20a3c61afd"
- },
- {
- "path": "viewer/detail.ts",
- "hash": "fe8df7c5561f2a8588cf4e1ecb367d19cb6b480fe4855f05e4f96137d8078884"
- },
- {
- "path": "viewer/graph.ts",
- "hash": "192a59b16da8327457de6723893fd9207dd9570a35cd664f96534a7b85e73e01"
- },
- {
- "path": "viewer/main.ts",
- "hash": "ab45ce4dfe66aafbe779b71d49d6370b3fe64482307b994e857ce34d3f317325"
- },
- {
- "path": "viewer/tree.ts",
- "hash": "d66e0157f4c2a1525c16505306eb3aabce82565c3d0e56199ea5b7a860290b01"
- }
- ],
- "nodes": [
- {
- "slug": "agent",
- "name": "Agent",
- "type": "system",
- "sources": [
- "bench/agent.ts"
- ],
- "sourcesDigest": "989950aca29644904bb9a7040d36a735534f3b0d1b3854912a2303e5b0831423"
- },
- {
- "slug": "benchmarking-system",
- "name": "Benchmarking System",
- "type": "system",
- "sources": [
- "bench/agent.ts",
- "bench/judge.ts",
- "bench/llm.ts",
- "bench/report.ts",
- "bench/run.ts",
- "bench/selfcheck.ts",
- "bench/tasks.ts",
- "bench/token-ab.ts"
- ],
- "sourcesDigest": "918b737414aae73bb0f84df38880140028a61e8bf27b89b544943394d05bb10f"
- },
- {
- "slug": "code-summarization",
- "name": "Code Summarization",
- "type": "concept",
- "sources": [
- "src/ai/crux.ts",
- "src/ai/summarize.ts",
- "src/ai/synthesize.ts"
- ],
- "sourcesDigest": "2df073fd00fbefc26907027a923c10609cf005d9cbb727ff2917374d03b251dc"
- },
- {
- "slug": "configuration-management",
- "name": "Configuration Management",
- "type": "concept",
- "sources": [
- "src/ai/providers.ts",
- "src/claude/settings-merge.ts"
- ],
- "sourcesDigest": "cbca57735b2ad73fb6d62dde432844f8879809265ad6f5274082ab955c08b5b8"
- },
- {
- "slug": "deterministic-testing",
- "name": "Deterministic Testing",
- "type": "concept",
- "sources": [
- "test/helpers.ts"
- ],
- "sourcesDigest": "ddc97a2b9b5b7ea60c6a55b3c250ddc0dffa3b335c4b43ddc9152dc900f56744"
- },
- {
- "slug": "error-handling-and-reporting",
- "name": "Error Handling and Reporting",
- "type": "concept",
- "sources": [
- "bench/run.ts",
- "src/engine.ts",
- "src/graph/build.ts"
- ],
- "sourcesDigest": "616914a6531c73b635ea2da8eba71b3f12bdae64d0e10c2618cdd7c1ebfc658b"
- },
- {
- "slug": "graph-data-integrity",
- "name": "Graph Data Integrity",
- "type": "concept",
- "sources": [
- "test/graph-write.test.ts"
- ],
- "sourcesDigest": "34c4a4eb40884a5f3072352f37d7efb647f89cb7fe8b9ba43d91eacbbad0c0c0"
- },
- {
- "slug": "graph-extraction-and-loading",
- "name": "Graph Extraction and Loading",
- "type": "system",
- "sources": [
- "src/graph/extract.ts",
- "src/graph/load.ts",
- "src/graph/relations.ts",
- "src/graph/resolve.ts",
- "src/graph/types.ts"
- ],
- "sourcesDigest": "acfd590d81e375dfc632bbf862a013b910daf352d7ff1739e70ef80fd841fcfa"
- },
- {
- "slug": "graph-ranking",
- "name": "Graph Ranking",
- "type": "system",
- "sources": [
- "test/graphrank.test.ts"
- ],
- "sourcesDigest": "891283b4808759d18bf39767763a60e2529b6e7559323f4115f409ab61912eaa"
- },
- {
- "slug": "graph-representation",
- "name": "Graph Representation",
- "type": "system",
- "sources": [
- "src/graph/relations.ts",
- "src/graph/types.ts"
- ],
- "sourcesDigest": "45b44b0500854924c7bf69043e5f45af360c55776bcf957442700620d7a3b1f4"
- },
- {
- "slug": "graph-serialization",
- "name": "Graph Serialization",
- "type": "system",
- "sources": [
- "test/graph-write.test.ts"
- ],
- "sourcesDigest": "34c4a4eb40884a5f3072352f37d7efb647f89cb7fe8b9ba43d91eacbbad0c0c0"
- },
- {
- "slug": "graph-synchronization",
- "name": "Graph Synchronization",
- "type": "concept",
- "sources": [
- "src/context/check.ts",
- "src/graph/check.ts"
- ],
- "sourcesDigest": "9a6d9714cc8b93725ff7e5702bd59dca1a96a6a3ebb7cec5c2f2e7e72eb9f093"
- },
- {
- "slug": "graph-traversal-and-analysis",
- "name": "Graph Traversal and Analysis",
- "type": "system",
- "sources": [
- "src/graph/traverse-cli.ts",
- "src/graph/traverse.ts",
- "src/search/grep-cli.ts",
- "src/search/grep.ts"
- ],
- "sourcesDigest": "0d510fdb8ad732a39d2c989024794702526f50a3a8555dce95314cb5b80d3a0a"
- },
- {
- "slug": "graph-traversal-and-impact-analysis",
- "name": "Graph Traversal and Impact Analysis",
- "type": "system",
- "sources": [
- "test/graph-traverse.test.ts"
- ],
- "sourcesDigest": "488464ccc2ad9ea80719012d014ea2836db6f60a1b0335e18545affa4a04a7b2"
- },
- {
- "slug": "graph-visualization",
- "name": "Graph Visualization",
- "type": "system",
- "sources": [
- "viewer/data.ts",
- "viewer/detail.ts",
- "viewer/graph.ts",
- "viewer/main.ts",
- "viewer/tree.ts"
- ],
- "sourcesDigest": "fd0623540e7f7eed9942e3db2bc219f9a08b3814ac219dfb2b9a74f8c1aea966"
- },
- {
- "slug": "host-configuration-management",
- "name": "Host Configuration Management",
- "type": "system",
- "sources": [
- "test/hosts-codex-hooks.test.ts",
- "test/hosts-init.test.ts",
- "test/hosts-mcp-config.test.ts",
- "test/hosts-registry.test.ts",
- "test/hosts-sections.test.ts"
- ],
- "sourcesDigest": "bc0c33ccee8f4a029f0fb4af261138907cc7b85f4f063f18ef3cb49d03076555"
- },
- {
- "slug": "host-management-and-configuration",
- "name": "Host Management and Configuration",
- "type": "system",
- "sources": [
- "src/hosts/codex-hooks.ts",
- "src/hosts/init.ts",
- "src/hosts/instructions.ts",
- "src/hosts/mcp-config.ts",
- "src/hosts/registry.ts",
- "src/hosts/sections.ts"
- ],
- "sourcesDigest": "da51b260a6b5e65f9dc1fa578e44a81309e6379f05f575b42378a1a646d63bb7"
- },
- {
- "slug": "idempotent-host-initialization",
- "name": "Idempotent Host Initialization",
- "type": "concept",
- "sources": [
- "test/hosts-init.test.ts"
- ],
- "sourcesDigest": "f7070057632565b4c1a7232ff4218cdefd56e5b26dacbe4e874e1c73a6ffb332"
- },
- {
- "slug": "judge",
- "name": "Judge",
- "type": "system",
- "sources": [
- "bench/judge.ts"
- ],
- "sourcesDigest": "b7c143d704da46109b37f03f603d29dcdd327ce19900ddfdf1b58ac4ead126ba"
- },
- {
- "slug": "llm-integration",
- "name": "LLM Integration",
- "type": "system",
- "sources": [
- "bench/llm.ts"
- ],
- "sourcesDigest": "4f4e246df7420566c35c5613d87662927000d8a548af5960275c64cc0a6e125e"
- },
- {
- "slug": "mcp-server-and-tools",
- "name": "MCP Server and Tools",
- "type": "system",
- "sources": [
- "test/mcp-server.test.ts",
- "test/mcp-tools.test.ts"
- ],
- "sourcesDigest": "57fc202e973b1af8d9bf326a11a5008fb7c95c9ea5738c7dfecd511a8df4d9d0"
- },
- {
- "slug": "report",
- "name": "Report",
- "type": "system",
- "sources": [
- "bench/report.ts"
- ],
- "sourcesDigest": "38642e3446c662002dd4ca9bd1c6438520ecfe224cb0b2481b1c21d74dc32228"
- },
- {
- "slug": "self-check-mechanism",
- "name": "Self-Check Mechanism",
- "type": "system",
- "sources": [
- "bench/selfcheck.ts"
- ],
- "sourcesDigest": "9e4f820e588b39901b8509f53d03b4a0d5451ee79d098d970f3a88d7c6765c7c"
- },
- {
- "slug": "tasks",
- "name": "Tasks",
- "type": "system",
- "sources": [
- "bench/tasks.ts"
- ],
- "sourcesDigest": "bf5418660cc917f7af4f93b7ed71cfc4c37f06a27af5b61047b54ba572a3a2b0"
- },
- {
- "slug": "test-helpers",
- "name": "Test Helpers",
- "type": "system",
- "sources": [
- "test/helpers.ts"
- ],
- "sourcesDigest": "ddc97a2b9b5b7ea60c6a55b3c250ddc0dffa3b335c4b43ddc9152dc900f56744"
- },
- {
- "slug": "testing-and-validation",
- "name": "Testing and Validation",
- "type": "system",
- "sources": [
- "test/ask-index.test.ts",
- "test/ask.test.ts",
- "test/claude-format.test.ts",
- "test/claude-hooks.test.ts",
- "test/claude-init.test.ts",
- "test/claude-paths.test.ts",
- "test/claude-settings-merge.test.ts",
- "test/claude-shim-template.test.ts",
- "test/claude-skill-template.test.ts",
- "test/claude-state.test.ts",
- "test/claude-stats.test.ts",
- "test/claude-statusline.test.ts",
- "test/cli-meta.test.ts",
- "test/context.test.ts",
- "test/covers.test.ts",
- "test/graph-bindings.test.ts",
- "test/graph-go.test.ts",
- "test/graph-load.test.ts",
- "test/graph-map.test.ts",
- "test/graph-resolve-typed.test.ts",
- "test/graph-traverse-cli.test.ts"
- ],
- "sourcesDigest": "ec26f442eeea6bac55ed94939624004883ed25f71e6271fccd772f42743774f0"
- },
- {
- "slug": "token-a-b-testing",
- "name": "Token A/B Testing",
- "type": "system",
- "sources": [
- "bench/token-ab.ts"
- ],
- "sourcesDigest": "12c7bde30c776e231fe85e67e20d88c3b691c854a45b9bc463502f489874cdf7"
- },
- {
- "slug": "user-interaction-in-visualization",
- "name": "User Interaction in Visualization",
- "type": "concept",
- "sources": [
- "viewer/detail.ts",
- "viewer/graph.ts",
- "viewer/main.ts"
- ],
- "sourcesDigest": "949fbcf087492dc70392ec9143ab9070d6c27e57720cbb7fa1b4324d473e7423"
- },
- {
- "slug": "visualization-and-serving",
- "name": "Visualization and Serving",
- "type": "system",
- "sources": [
- "src/viz/assemble.ts",
- "src/viz/serve.ts"
- ],
- "sourcesDigest": "88ca5c49a63bfa8625974ff180102457ba16dd9538fa82d23bbe252becd035d8"
- }
- ]
-}
diff --git a/graft/mcp-server-and-tools.md b/graft/mcp-server-and-tools.md
deleted file mode 100644
index 78647684..00000000
--- a/graft/mcp-server-and-tools.md
+++ /dev/null
@@ -1,49 +0,0 @@
----
-name: MCP Server and Tools
-slug: mcp-server-and-tools
-type: system
-sources:
- - path: test/mcp-server.test.ts
- hash: 4d828181f0a8c645f00097ab43c2bdcf5bc65da276e83b7503bc2888ae09f254
- - path: test/mcp-tools.test.ts
- hash: 22d3a32a85a0ba1542969786e8bda07d3df02ee068554d4070f705d30d7239dc
-sources_digest: 57fc202e973b1af8d9bf326a11a5008fb7c95c9ea5738c7dfecd511a8df4d9d0
-links:
- - to: graph-serialization
- relation: validates
- description: The MCP tools may validate the integrity of the serialized graph data.
-generator:
- version: 1
-covers:
- - symbol: rpc
- kind: function
- at: 'test/mcp-server.test.ts:L9-L28'
- - symbol: builtRepo
- kind: function
- at: 'test/mcp-tools.test.ts:L9-L16'
- - symbol: chainRepo
- kind: function
- at: 'test/mcp-tools.test.ts:L22-L33'
- - symbol: customDirRepo
- kind: function
- at: 'test/mcp-tools.test.ts:L37-L45'
- - symbol: fileScopeRepo
- kind: function
- at: 'test/mcp-tools.test.ts:L50-L60'
- - symbol: multiDirRepo
- kind: function
- at: 'test/mcp-tools.test.ts:L65-L73'
----
-<!-- context:generated:start -->
-## Summary
-
-This component encompasses the Multi-Channel Protocol server and associated tools, facilitating RPC interactions and providing various utilities for analyzing and manipulating code repositories.
-
-## Related
-
-- validates [[graph-serialization]] — The MCP tools may validate the integrity of the serialized graph data.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/report.md b/graft/report.md
deleted file mode 100644
index 8e649d77..00000000
--- a/graft/report.md
+++ /dev/null
@@ -1,65 +0,0 @@
----
-name: Report
-slug: report
-type: system
-sources:
- - path: bench/report.ts
- hash: 17c0be550f9712165177d070f58cbe7a0f60fcb2c1dc5830eb1a4dde97ec12f3
-sources_digest: 38642e3446c662002dd4ca9bd1c6438520ecfe224cb0b2481b1c21d74dc32228
-links:
- - to: benchmarking-system
- relation: part_of
- description: The report is a key output of the benchmarking system.
-generator:
- version: 1
-covers:
- - symbol: Arm
- kind: type
- at: 'bench/report.ts:L6-L6'
- - symbol: Row
- kind: interface
- at: 'bench/report.ts:L8-L30'
- - symbol: costOf
- kind: function
- at: 'bench/report.ts:L37-L42'
- - symbol: mean
- kind: function
- at: 'bench/report.ts:L44-L46'
- - symbol: ArmAgg
- kind: interface
- at: 'bench/report.ts:L48-L58'
- - symbol: aggregate
- kind: function
- at: 'bench/report.ts:L60-L72'
- - symbol: pctDelta
- kind: function
- at: 'bench/report.ts:L74-L78'
- - symbol: fmt
- kind: function
- at: 'bench/report.ts:L80-L82'
- - symbol: metricTable
- kind: function
- at: 'bench/report.ts:L88-L114'
- - symbol: cells
- kind: function
- at: 'bench/report.ts:L93-L102'
- - symbol: verdictFor
- kind: function
- at: 'bench/report.ts:L117-L127'
- - symbol: buildMarkdown
- kind: function
- at: 'bench/report.ts:L129-L175'
----
-<!-- context:generated:start -->
-## Summary
-
-The report component aggregates benchmarking results from various trials, transforming raw data into a structured markdown report that highlights performance metrics and provides insights into the benchmarking context.
-
-## Related
-
-- part of [[benchmarking-system]] — The report is a key output of the benchmarking system.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/scripts/build-viewer.md b/graft/scripts/build-viewer.md
deleted file mode 100644
index 3781c1a3..00000000
--- a/graft/scripts/build-viewer.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# scripts/build-viewer.mjs
-
-This script automates the bundling of the viewer application and its static assets for deployment.
-
-_No extracted symbols in this file._
diff --git a/graft/scripts/postinstall.md b/graft/scripts/postinstall.md
deleted file mode 100644
index 9ae3f64d..00000000
--- a/graft/scripts/postinstall.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# scripts/postinstall.mjs
-
-This script provides a non-intrusive notification after installation, ensuring the install process is not interrupted by errors.
-
-_No extracted symbols in this file._
diff --git a/graft/self-check-mechanism.md b/graft/self-check-mechanism.md
deleted file mode 100644
index 2d343d67..00000000
--- a/graft/self-check-mechanism.md
+++ /dev/null
@@ -1,38 +0,0 @@
----
-name: Self-Check Mechanism
-slug: self-check-mechanism
-type: system
-sources:
- - path: bench/selfcheck.ts
- hash: 858ec7cce92c9105c4e111ae58f1d1a1b1b57372b96768804308009760c9b2f6
-sources_digest: 9e4f820e588b39901b8509f53d03b4a0d5451ee79d098d970f3a88d7c6765c7c
-links:
- - to: agent
- relation: uses
- description: The self-check mechanism simulates the agent's behavior.
-generator:
- version: 1
-covers:
- - symbol: makeStubModel
- kind: function
- at: 'bench/selfcheck.ts:L20-L39'
- - symbol: create
- kind: method
- at: 'bench/selfcheck.ts:L24-L37'
- - symbol: main
- kind: function
- at: 'bench/selfcheck.ts:L41-L105'
----
-<!-- context:generated:start -->
-## Summary
-
-This component allows for offline verification of the agent's control flow and tool execution without requiring an API key, using a stubbed model to simulate responses and evaluate correctness.
-
-## Related
-
-- uses [[agent]] — The self-check mechanism simulates the agent's behavior.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/src/ai/crux.md b/graft/src/ai/crux.md
deleted file mode 100644
index c7464a16..00000000
--- a/graft/src/ai/crux.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# src/ai/crux.ts · [[code-summarization]]
-
-This file defines a system for summarizing code definitions to aid engineers in navigating a codebase.
-
-- NodeRef · interface · L21-L27 — Defines the structure for referencing a node in the code graph.
-- FileCruxInput · interface · L29-L33 — Encapsulates the input data required for summarizing a file's code definitions.
-- NodeCrux · interface · L35-L40 — Represents the summarized information for a code definition in the file.
-- CruxSummarizer · interface · L42-L44 — Interface for summarizing code definitions from a file.
-- numberLines · function · L81-L88 — Formats the source code into a numbered string for better readability.
-- userContent · function · L90-L99 — Constructs a user content string that includes file details and target nodes.
-- parseResults · function · L102-L114 — Transforms the tool's parsed argument object into a structured list of NodeCrux objects for further processing.
-- num · function · L104-L104 — This function converts a potentially non-finite number to a finite integer or zero, ensuring valid numerical output.
-- ChatCruxSummarizer · class · L117-L140 — Implements a summarizer that utilizes a ChatModel to describe code definitions and their purposes in a file.
-- constructor · method · L118-L118 — Initializes the ChatCruxSummarizer with a specific ChatModel instance for generating summaries.
-- describeFile · method · L120-L139 — Processes a file input to generate summaries of its target definitions using the ChatModel.
diff --git a/graft/src/ai/llm/anthropic.md b/graft/src/ai/llm/anthropic.md
deleted file mode 100644
index 466322aa..00000000
--- a/graft/src/ai/llm/anthropic.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# src/ai/llm/anthropic.ts
-
-This module provides an adapter for the Anthropic Messages API, enabling seamless integration of Claude as a first-class AI provider while handling specific API differences.
-
-- AnthropicChatModelOptions · interface · L24-L31 — Defines the configuration options required to instantiate an Anthropic chat model, ensuring necessary parameters are provided.
-- CacheControl · type · L33-L33 — Specifies the cache control settings for ephemeral data management in the chat model.
-- cc · function · L34-L34 — Creates a cache control object based on a boolean flag to manage ephemeral caching behavior.
-- AnthropicChatModel · class · L36-L141 — Implements the chat model interface for interacting with the Anthropic API, encapsulating the logic for message handling and API communication.
-- constructor · method · L41-L45 — Initializes an instance of the AnthropicChatModel with the provided options, setting up the necessary API client and model details.
-- create · method · L47-L100 — Handles the creation of chat messages by processing input requests and formatting them for the Anthropic API, ensuring compliance with API requirements.
-- assistantParam · method · L103-L111 — Reconstructs the assistant's response from the original message blocks, preserving the context and structure of the conversation.
-- fromResponse · method · L113-L140 — Transforms the API response into a structured ChatResponse object, extracting relevant information and maintaining the original message format.
-- toAnthropicTool · function · L143-L145 — Converts a ToolSpec into the format required by the Anthropic API, facilitating the integration of tools into chat requests.
-- normalizeUsage · function · L148-L155 — Normalizes the usage statistics from the Anthropic API response, providing a consistent structure for input and output token counts.
diff --git a/graft/src/ai/llm/factory.md b/graft/src/ai/llm/factory.md
deleted file mode 100644
index bad36e75..00000000
--- a/graft/src/ai/llm/factory.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# src/ai/llm/factory.ts
-
-Creates instances of ChatModel based on the specified provider configuration, enabling flexible integration with different chat model APIs.
-
-- ProviderKind · type · L12-L12 — Defines the types of providers for chat models, ensuring compatibility with specific APIs.
-- ChatModelConfig · interface · L14-L21 — Specifies the configuration required to create a chat model, enforcing necessary parameters for initialization.
-- createChatModel · function · L23-L39 — Creates an instance of a chat model based on the specified provider, handling different implementations accordingly.
diff --git a/graft/src/ai/llm/openai.md b/graft/src/ai/llm/openai.md
deleted file mode 100644
index d0bcd8d9..00000000
--- a/graft/src/ai/llm/openai.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# src/ai/llm/openai.ts
-
-This module provides an adapter for interacting with various OpenAI-compatible endpoints, allowing users to send chat requests and receive responses while managing caching and formatting options.
-
-- OpenAIChatModelOptions · interface · L19-L29 — Defines the configuration options for the OpenAI chat model, including API key and model type.
-- ChatParams · type · L31-L31 — Defines the parameters required for creating a chat completion request, ensuring the correct structure is used for API calls.
-- ChatMessage · type · L32-L32 — Represents a message in the chat, encapsulating the role and content to facilitate communication between users and the AI.
-- textPart · function · L35-L39 — Constructs a text message part with optional cache control for OpenRouter passthrough.
-- toChatMessage · function · L41-L67 — Transforms a message object into a format suitable for OpenAI's chat API, handling different roles appropriately.
-- toChatTool · function · L69-L71 — Converts a tool specification into a format compatible with OpenAI's chat completion API, enabling the use of external tools in chat interactions.
-- OpenAIChatModel · class · L73-L162 — Implements the chat model interface for interacting with OpenAI's chat completions API.
-- constructor · method · L78-L88 — Initializes an OpenAIChatModel instance with the specified options, setting up the necessary API client and model parameters for chat interactions.
-- create · method · L90-L115 — Creates a chat completion request to the OpenAI API using the provided messages and parameters.
-- fromResponse · method · L117-L161 — Processes the response from the OpenAI API to extract relevant chat information and tool calls.
-- parse · function · L127-L133 — Safely parses a JSON string into an object, handling errors to ensure robust processing of responses from the chat API.
-- normalizeUsage · function · L165-L174 — Normalizes usage statistics by calculating uncached input tokens from the OpenAI API response.
diff --git a/graft/src/ai/llm/types.md b/graft/src/ai/llm/types.md
deleted file mode 100644
index 54c96977..00000000
--- a/graft/src/ai/llm/types.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# src/ai/llm/types.ts
-
-Defines interfaces and types for a provider-neutral chat transport system that facilitates communication with various language model providers.
-
-- ToolCall · interface · L23-L28 — Represents a single invocation of a tool requested by the model, encapsulating its ID, name, and parsed arguments.
-- Message · interface · L31-L52 — Defines a turn in a conversation, allowing for structured communication between users and the assistant, including tool calls and raw provider data.
-- ToolSpec · interface · L55-L59 — Describes a tool that the model can call, including its name, description, and parameters, facilitating interaction with various tools.
-- ResponseFormat · type · L68-L71 — Specifies the format in which the model must respond, ensuring compatibility across different output types like text, JSON, or tool calls.
-- Usage · interface · L78-L83 — Tracks token usage across providers, normalizing input and output counts to facilitate consistent accounting in multi-provider environments.
-- ChatRequest · interface · L85-L94 — Encapsulates a request to the chat model, including messages, tools, and response format, to standardize interactions with the model.
-- ChatResponse · interface · L96-L104 — Represents the response from the chat model, including the assistant's text, tool calls made, and usage statistics, to provide a complete interaction result.
-- ChatModel · interface · L110-L113 — Defines a connection to a specific model, providing a method to create chat requests and ensuring consistent interaction with the model.
diff --git a/graft/src/ai/providers.md b/graft/src/ai/providers.md
deleted file mode 100644
index 93aa24b5..00000000
--- a/graft/src/ai/providers.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# src/ai/providers.ts · [[configuration-management]]
-
-This module provides configuration management for AI model providers, allowing users to specify settings and defaults for various AI services.
-
-- EngineConfig · interface · L17-L39 — Defines the configuration structure for the engine, allowing customization of various parameters for LLM operations.
-- ResolvedConfig · interface · L42-L55 — Represents the fully resolved configuration after merging user settings with defaults and environment variables.
-- resolveConfig · function · L71-L106 — Merges user-provided configuration with environment variables and defaults to produce a complete configuration object.
diff --git a/graft/src/ai/summarize.md b/graft/src/ai/summarize.md
deleted file mode 100644
index 68e0f0e3..00000000
--- a/graft/src/ai/summarize.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# src/ai/summarize.ts · [[code-summarization]]
-
-This file provides functionality to summarize source code files into concise prose for a knowledge graph, enhancing documentation and understanding of codebases.
-
-- Summarizer · interface · L13-L15 — The Summarizer interface defines a contract for summarizing source code files.
-- userContent · function · L28-L34 — The userContent function formats the source code and its path into a structured string for summarization.
-- ChatSummarizer · class · L37-L51 — Provides a mechanism to summarize source code files into plain English for knowledge management.
-- constructor · method · L38-L38 — Initializes the ChatSummarizer with a specific ChatModel for generating summaries.
-- summarize · method · L40-L50 — Generates a summary of the provided source code using the specified ChatModel.
diff --git a/graft/src/ai/synthesize.md b/graft/src/ai/synthesize.md
deleted file mode 100644
index 57b3c3d4..00000000
--- a/graft/src/ai/synthesize.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# src/ai/synthesize.ts · [[code-summarization]]
-
-This file defines the architecture for synthesizing a graph of nodes from file summaries, enabling better understanding and navigation of a codebase.
-
-- SynthLink · interface · L12-L16 — Defines the structure of a directed edge between nodes, specifying relationships in the synthesized graph.
-- SynthNode · interface · L19-L27 — Represents a node in the synthesized graph, encapsulating its name, type, summary, sources, and links to other nodes.
-- FileSummary · interface · L30-L33 — Holds the summary information for a single file, including its path and a descriptive summary.
-- Synthesizer · interface · L35-L37 — Defines the interface for synthesizers that convert file summaries into structured nodes.
-- userContent · function · L93-L98 — Constructs a formatted string from an array of file summaries, ensuring it does not exceed a specified character limit.
-- clean · function · L101-L123 — Normalizes and cleans a raw model response into a structured array of SynthNode objects.
-- ChatSynthesizer · class · L128-L154 — The ChatSynthesizer class implements the Synthesizer interface to create a structured architecture graph using a chat model.
-- constructor · method · L129-L129 — The constructor initializes the ChatSynthesizer with a specific chat model for generating architecture graphs.
-- synthesize · method · L131-L153 — The synthesize method processes file summaries to produce a curated set of SynthNode objects representing the architecture of the codebase.
diff --git a/graft/src/ask/ask.md b/graft/src/ask/ask.md
deleted file mode 100644
index 70da269e..00000000
--- a/graft/src/ask/ask.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# src/ask/ask.ts
-
-This module provides a mechanism to process natural language queries and return structured results from a codebase, enhancing the ability to find relevant code snippets and their relationships.
-
-- AskHit · interface · L29-L46 — Represents a hit in the query results, encapsulating details about a code symbol and its context.
-- AskResult · interface · L52-L82 — Represents the result of an 'ask' query, encapsulating the query details and the hits found.
-- firstProse · function · L85-L92 — Extracts the first meaningful prose line from a body of text, ignoring headings and blank lines.
-- Corpus · interface · L94-L101 — Defines the structure for holding concepts and graph data used in processing queries.
-- loadCorpus · function · L103-L128 — Loads a corpus of concepts and graph data from a specified directory, enabling query processing.
-- score · function · L137-L148 — Calculates a score for a document based on its token counts relative to a query, enhancing relevance ranking.
-- idfFromDf · function · L154-L158 — Computes the inverse document frequency (IDF) from document frequency (DF) data, aiding in scoring relevance.
-- computeIdf · function · L160-L165 — Generates IDF values from document bags, which are used to weight query matches based on term rarity.
-- computeIdfFromIndex · function · L174-L179 — Calculates IDF values using precomputed index data, optimizing the scoring process for queries.
-- bm25 · function · L186-L202 — Implements the BM25 scoring algorithm to rank documents based on term frequency and document length.
-- subjectWords · function · L214-L216 — Tokenizes a query into words while preserving qualified names, facilitating accurate subject resolution.
-- findSubjectNodes · function · L235-L243 — Finds nodes in the graph that match the structural subject of a query, enhancing query resolution.
-- StructuralOutcome · type · L251-L251 — Defines the possible outcomes of a structural query, indicating whether a result was found, a fallthrough note is needed, or if there was no structural intent.
-- fallthroughNoteFor · function · L253-L258 — Generates a note for cases where a structural query falls back to lexical processing, providing user guidance.
-- structural · function · L260-L309 — Processes a structural query to find relationships in the graph, returning relevant results or fallthrough notes.
-- hasTerm · function · L328-L330 — Checks for the presence of a term in a document's token map, aiding in relevance scoring.
-- strongShare · function · L348-L357 — function strongShare( q: Map<string, number>, node: NodeV1, doc: { name: Map<string, number> }, idf: Map<string, number>, dfltIdf: number, ): number
-- matchedIdfShare · function · L359-L373 — Calculates the share of query terms matched by a document, weighted by term rarity for relevance assessment.
-- lexical · function · L375-L676 — Handles lexical queries by scoring documents based on term matches and relevance, returning structured results.
-- bodyLen · function · L495-L499 — Calculates the length of the body of a lexical document to ensure it meets certain criteria for processing.
-- AskOptions · interface · L678-L700 — Defines the options available for configuring the ask function, allowing customization of its behavior.
-- parseSpan · function · L704-L708 — Parses a string pointer into its file path and line range components, facilitating source code navigation.
-- sliceSpan · function · L712-L727 — Reads a specified range of lines from a source file, allowing for inlined code snippets in query results.
-- inlineSource · function · L734-L751 — Inlines the source code for the hits found, providing context directly in the results without needing to open files.
-- hitFiles · function · L755-L764 — Extracts a set of unique file paths from the hits, indicating which files are relevant to the query results.
-- baselineFor · function · L769-L772 — Calculates the baseline file size and character count for the hits, providing a measure of the cost of reading the full files.
-- ask · function · L775-L820 — Handles the main logic for processing a query against a directory, returning structured results based on the query type.
-- SkeletonEntry · interface · L824-L831 — Defines the structure of a skeleton entry, which represents a piece of information extracted from a file.
-- SkeletonResult · interface · L833-L839 — Defines the structure of the result returned from the skeleton function, encapsulating the extracted information.
-- skeleton · function · L844-L874 — Extracts a skeleton representation of a file, providing a summary and context for its contents.
-- startLine · function · L861-L861 — Calculates the starting line number from a given span, aiding in the extraction of relevant code sections.
-- formatSkeleton · function · L877-L887 — Formats the skeleton result into a string representation for display or output purposes.
-- toTokens · function · L890-L892 — Converts a character count into a token count, facilitating the processing of text for queries.
-- formatAsk · function · L895-L937 — Formats the results of an ask query into a string for presentation, ensuring clarity and usability.
-- escalationNudge · function · L944-L951 — function escalationNudge(r: AskResult): string
-- askSavingsFooter · function · L956-L969 — function askSavingsFooter(r: AskResult, body: string): string
-- scopeFooterLines · function · L976-L988 — function scopeFooterLines(r: AskResult): string[]
diff --git a/graft/src/ask/fuse.md b/graft/src/ask/fuse.md
deleted file mode 100644
index f4f09cdb..00000000
--- a/graft/src/ask/fuse.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# src/ask/fuse.ts
-
-- ScopedDoc · interface · L30-L34 — interface ScopedDoc
-- FusionResult · interface · L36-L46 — interface FusionResult
-- byScore · function · L83-L85 — function byScore(a: ScopedDoc, b: ScopedDoc): number
-- fuseScopes · function · L98-L161 — function fuseScopes(docs: ScopedDoc[]): FusionResult
-- ScopeRankOps · interface · L167-L182 — interface ScopeRankOps
-- rankScopesAndFuse · function · L204-L260 — function rankScopesAndFuse( scopes: string[], ops: ScopeRankOps, graphWeight: number, rescueFloor: number, ): FusionResult
diff --git a/graft/src/ask/graphrank.md b/graft/src/ask/graphrank.md
deleted file mode 100644
index 1b94029f..00000000
--- a/graft/src/ask/graphrank.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# src/ask/graphrank.ts
-
-This module implements a personalized PageRank algorithm to improve the ranking of code nodes based on their structural relevance rather than just lexical similarity.
-
-- PageRankOptions · interface · L20-L32 — Defines options for configuring the personalized PageRank algorithm, including restart probability and iteration count.
-- personalizedPageRank · function · L45-L113 — Calculates personalized PageRank scores for nodes in a wiring graph based on provided seeds, enhancing the relevance of code suggestions.
-- link · function · L63-L65 — Creates undirected links between nodes in the graph for the PageRank calculation, ensuring that both directions are considered.
diff --git a/graft/src/ask/index-file.md b/graft/src/ask/index-file.md
deleted file mode 100644
index 03db258f..00000000
--- a/graft/src/ask/index-file.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# src/ask/index-file.ts
-
-This file provides functionality for building and reading a cache of tokenized graph data to optimize query performance.
-
-- tokenize · function · L38-L44 — Tokenizes input text into lowercased subword tokens, ensuring consistent tokenization for both build-time and query-time processes.
-- counts · function · L47-L51 — Counts the frequency of each token in a given array, facilitating the creation of term-frequency maps for documents.
-- AskIndexDoc · interface · L54-L59 — Defines the structure for storing token bags associated with a single document in the index.
-- AskIndex · interface · L63-L69 — Represents the overall structure of the ask index, including document frequencies and average body length for efficient querying.
-- askIndexPath · function · L76-L78 — Generates the absolute file path for the ask index sidecar based on the output directory.
-- pairs · function · L80-L82 — Converts a Map of token counts into a sorted array format suitable for JSON serialization.
-- bagLen · function · L85-L89 — Calculates the total count of tokens in a document's field, representing its length.
-- writeAskIndex · function · L98-L131 — Writes the tokenized representation of graph nodes and their frequencies to a JSON file, creating a cache for future queries.
-- readAskIndex · function · L138-L159 — Reads and validates the ask index from a file, ensuring data integrity before use in queries.
diff --git a/graft/src/claude/format.md b/graft/src/claude/format.md
deleted file mode 100644
index 2636e62b..00000000
--- a/graft/src/claude/format.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# src/claude/format.ts
-
-This file contains functions and types for formatting and rendering status information related to a graph-based system.
-
-- enrichedSegment · function · L13-L17 — Calculates the percentage of enriched items based on the ready count and total count, returning a formatted string if there are any enriched items.
-- freshnessSegment · function · L19-L24 — Generates a status message indicating the freshness of the data, highlighting if the data is syncing or stale.
-- renderStatusline · function · L26-L48 — Constructs a status line for displaying the current state of the system, including node and edge counts, enrichment status, and session information.
-- nodeIdsInFile · function · L50-L56 — Retrieves a set of node IDs from a graph that correspond to a specified file path, filtering based on path matches.
-- incomingEdges · function · L58-L62 — Finds all incoming edges for nodes in a graph that correspond to a specified file path, returning those edges that target the nodes.
-- formatBlastRadius · function · L64-L75 — Formats a string that describes the blast radius for a given file, listing dependencies and their relationships, up to a specified cap.
-- AskJson · interface · L77-L84 — Defines the structure for a JSON object used in retrieval queries, encapsulating query details and hit information.
-- tokensOf · function · L86-L86 — Calculates the number of tokens based on character count, facilitating token management in retrieval processes.
-- retrievalBody · function · L91-L108 — Constructs a formatted string representation of retrieval hits, including pointers and snippets, for display purposes.
-- retrievalTokensSaved · function · L111-L117 — Calculates the number of tokens saved by using a retrieval pack instead of reading files in full, based on the hits and baseline size.
-- formatRetrieval · function · L119-L132 — Formats the retrieval results into a string, including details about tokens saved and the estimated size of the retrieval pack.
-- relevantRetrieval · function · L152-L163 — Determines if a retrieval pack should be injected based on relevance and novelty, returning the formatted text or null if not applicable.
-- formatOrientation · function · L165-L176 — Creates a formatted string representing the orientation of the repository map, limited to a specified byte budget.
-- renderSubagent · function · L178-L182 — Generates a string representation of a subagent's status, including its query if available, for display purposes.
diff --git a/graft/src/claude/hooks.md b/graft/src/claude/hooks.md
deleted file mode 100644
index b24490d3..00000000
--- a/graft/src/claude/hooks.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# src/claude/hooks.ts
-
-Handles various events related to the Graft system, including session management and user prompts.
-
-- readStdin · function · L15-L19 — Reads input from standard input, handling test seams and parsing JSON.
-- safeReadFd0 · function · L20-L20 — Safely reads from the standard input file descriptor, returning an empty string on failure.
-- projectDir · function · L22-L24 — Determines the project directory based on environment variables or input parameters.
-- underGraft · function · L25-L28 — Checks if a given file is part of the graft project structure.
-- graftJson · function · L29-L47 — Executes a command to retrieve JSON output from the graft CLI, handling errors gracefully.
-- checkStaleCount · function · L48-L52 — Counts the number of changes in the graft graph to determine if it is stale.
-- emit · function · L53-L55 — Outputs a JSON object to standard output for event tracking.
-- handlePostEdit · function · L57-L63 — Handles post-edit events by updating stats and emitting relevant information.
-- lastFileScopeHint · function · L80-L105 — function lastFileScopeHint(dir: string, lastFile: string | null | undefined): string | null
-- handleToolSavings · function · L113-L123 — function handleToolSavings(input: any, dir: string): void
-- handleStop · function · L125-L139 — Handles the stop event by syncing state if necessary.
-- main · function · L141-L186 — Main entry point for handling various events and orchestrating the application logic.
diff --git a/graft/src/claude/init.md b/graft/src/claude/init.md
deleted file mode 100644
index 566dc190..00000000
--- a/graft/src/claude/init.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# src/claude/init.ts
-
-Initializes the Claude environment by setting up necessary directories, configuration files, and shims for the application.
-
-- InitResult · interface · L10-L18 — Defines the structure of the result returned by the runInit function, encapsulating settings, shims, skill, warnings, and build status.
-- runInit · function · L20-L57 — Initializes the Claude environment by setting up necessary directories, merging settings, creating shims, and optionally building the project.
diff --git a/graft/src/claude/paths.md b/graft/src/claude/paths.md
deleted file mode 100644
index 56e267c0..00000000
--- a/graft/src/claude/paths.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# src/claude/paths.ts
-
-This module provides utility functions to resolve paths for the graft CLI and related scripts, ensuring correct path resolution regardless of the installation context.
-
-- graftCliPath · function · L11-L13 — Provides the absolute path to the graft CLI, ensuring it can be located regardless of the installation context.
-- claudeDistDir · function · L18-L20 — Returns the absolute path to the package's distribution directory, facilitating consistent access to resources without guesswork.
-- claudeScriptPath · function · L23-L25 — Constructs the absolute path to a sibling script in the claude directory, enabling dynamic script resolution.
diff --git a/graft/src/claude/settings-merge.md b/graft/src/claude/settings-merge.md
deleted file mode 100644
index 9cc38d57..00000000
--- a/graft/src/claude/settings-merge.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# src/claude/settings-merge.ts · [[configuration-management]]
-
-Merges existing settings with new graft configurations, ensuring proper command hooks and permissions are set while avoiding conflicts.
-
-- Json · type · L1-L1 — Defines a flexible JSON type for various settings configurations.
-- hookCmd · function · L7-L9 — Generates a command string to execute a specified hook in the Graft environment.
-- graftBlocks · function · L10-L24 — Creates a mapping of events to their corresponding Graft command hooks for processing user actions.
-- isGraftHookEntry · function · L25-L27 — Checks if a given entry is a Graft hook by inspecting its command reference.
-- mergeGraftSettings · function · L29-L62 — Merges existing settings with Graft-specific configurations, ensuring idempotency and compliance with Graft rules.
diff --git a/graft/src/claude/shim-template.md b/graft/src/claude/shim-template.md
deleted file mode 100644
index 8433066f..00000000
--- a/graft/src/claude/shim-template.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# src/claude/shim-template.ts
-
-Generates shims to dynamically locate and execute the correct version of the @nanonets/graft package's entry points, ensuring compatibility across different installation methods.
-
-- shim · function · L16-L60 — Generates a script that dynamically locates and executes a specified entry file from the installed graft package, ensuring compatibility across various installation methods.
-- statuslineShim · function · L62-L62 — Creates a shim for the statusline entry of the graft package, facilitating its execution in a consistent manner.
-- hooksShim · function · L63-L63 — Creates a shim for the hooks entry of the graft package, enabling its execution with command-line arguments.
diff --git a/graft/src/claude/skill-template.md b/graft/src/claude/skill-template.md
deleted file mode 100644
index 927b8827..00000000
--- a/graft/src/claude/skill-template.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# src/claude/skill-template.ts
-
-Provides a structured template for the graft Claude Code skill, enabling efficient onboarding and understanding of the codebase.
-
-- skillTemplate · function · L6-L101 — Generates a markdown string that serves as a comprehensive guide for using the graft tool effectively within a code repository.
diff --git a/graft/src/claude/state.md b/graft/src/claude/state.md
deleted file mode 100644
index ebc12b22..00000000
--- a/graft/src/claude/state.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# src/claude/state.ts
-
-Manages application state and session data, including statistics and file locking mechanisms.
-
-- Stats · interface · L4-L9 — Defines the structure for tracking various statistics related to nodes and edges in the system.
-- SessionState · interface · L10-L20 — Defines the structure for maintaining the state of a session, including queries and token savings.
-- emptyStats · function · L24-L27 — Creates and returns an initial empty Stats object to reset statistics tracking.
-- emptySession · function · L28-L30 — Creates and returns an initial empty SessionState object to reset session tracking.
-- cacheDir · function · L32-L32 — Constructs the path to the cache directory for a given project.
-- statsPath · function · L33-L33 — Generates the file path for storing statistics in JSON format.
-- sessionPath · function · L34-L34 — Generates the file path for storing session data in JSON format.
-- lockPath · function · L35-L35 — Generates the file path for the synchronization lock used in the caching mechanism.
-- readJson · function · L37-L39 — Reads and parses a JSON file, returning the content or null if an error occurs.
-- writeJsonAtomic · function · L40-L45 — Writes a JSON object to a file atomically, ensuring no data corruption during the write process.
-- readStats · function · L47-L47 — Reads the statistics from the specified path, returning null if not found.
-- writeStats · function · L48-L48 — Writes the provided statistics to the specified path in JSON format.
-- patchStats · function · L51-L55 — Updates the existing statistics with a patch and writes the updated stats back to storage.
-- readSession · function · L56-L58 — Reads the session data from the specified path, returning an empty session if not found.
-- writeSession · function · L59-L61 — Writes the session data to the specified path in JSON format.
-- acquireLock · function · L63-L79 — Attempts to acquire a lock for the specified directory to prevent concurrent access issues.
-- releaseLock · function · L80-L80 — Releases the lock for the specified directory, allowing other processes to access it.
diff --git a/graft/src/claude/stats.md b/graft/src/claude/stats.md
deleted file mode 100644
index 9f3cd7b0..00000000
--- a/graft/src/claude/stats.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# src/claude/stats.ts
-
-This module provides functions to read wiring data from a JSON file and compute statistics about graph nodes and edges, facilitating analysis of project structure.
-
-- readWiring · function · L6-L10 — Loads and parses the wiring configuration from a JSON file, returning the graph structure or null if an error occurs.
-- computeStats · function · L12-L25 — Calculates and returns statistics about the nodes and edges in a graph, including counts and languages used.
diff --git a/graft/src/claude/statusline.md b/graft/src/claude/statusline.md
deleted file mode 100644
index 9043f7c5..00000000
--- a/graft/src/claude/statusline.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# src/claude/statusline.ts
-
-- resolveStats · function · L14-L20 — Determines the current statistics of the project, either from a cache or by reading the wiring graph directly.
-- main · function · L22-L33 — Handles input and orchestrates the rendering of the status line or subagent output based on the provided context.
diff --git a/graft/src/claude/sync-run.md b/graft/src/claude/sync-run.md
deleted file mode 100644
index f4369517..00000000
--- a/graft/src/claude/sync-run.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# src/claude/sync-run.ts
-
-Coordinates the synchronous build process and updates the system state based on the build results.
-
-- realBuild · function · L8-L11 — Executes a build process for a specified directory, ensuring it adheres to specific constraints.
-- runSync · function · L13-L27 — Coordinates the build process and updates the system state based on the build outcome.
-- main · function · L29-L32 — Initiates the synchronization process when the script is executed directly with a specified directory.
diff --git a/graft/src/cli-epilogue.md b/graft/src/cli-epilogue.md
deleted file mode 100644
index 44b38986..00000000
--- a/graft/src/cli-epilogue.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# src/cli-epilogue.ts
-
-Generates a closing message for the `graft init` command, including next steps and a visual wordmark.
-
-- indigo · function · L23-L23 — Applies a specific color formatting to a string for terminal output.
-- muted · function · L24-L24 — Applies a muted color formatting to a string for terminal output.
-- Step · interface · L26-L31 — Defines the structure for a step in the epilogue, including a label and command.
-- InitEpilogueOptions · interface · L33-L40 — Specifies options for rendering the init epilogue, including graph status and node/edge counts.
-- formatInitEpilogue · function · L44-L85 — Formats and returns the next-steps epilogue for the `graft init` command based on provided options.
diff --git a/graft/src/cli-meta.md b/graft/src/cli-meta.md
deleted file mode 100644
index 9b607285..00000000
--- a/graft/src/cli-meta.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# src/cli-meta.ts
-
-This file provides support for version management and upgrade functionality for the graft package, including version resolution and reporting.
-
-- resolvePackageJsonPath · function · L17-L24 — Determines the path to the package.json file for a given module URL, enabling access to package metadata.
-- readCurrentVersion · function · L27-L31 — Retrieves the current version of the graft package from its package.json file, ensuring the application uses the correct version.
-- isRunningViaNpx · function · L35-L37 — Checks if the current module is executed from an npx cache directory, affecting how upgrades are handled.
-- NpmViewResult · interface · L39-L42 — Defines the structure for the result of an npm view command, indicating success and the version of a package.
-- getNpmViewVersion · function · L46-L60 — Fetches the version of a specified package from npm, handling errors gracefully to ensure reliability.
-- formatVersionReport · function · L63-L73 — Formats a report on the current and latest package versions for user-friendly output.
-- globalRoot · function · L76-L87 — Determines the global npm node_modules directory, accommodating various installation layouts.
-- readGlobalInstalledVersion · function · L92-L103 — Reads the installed version of a package directly from the global node_modules directory, providing accurate local versioning.
-- UpgradeResult · interface · L105-L113 — Defines the structure for the result of an upgrade operation, indicating whether it was executed and its success status.
-- formatUpgradeReport · function · L116-L127 — Generates a user-friendly report after an upgrade attempt, indicating success or failure.
-- runUpgrade · function · L132-L143 — Executes the upgrade process for the graft package, ensuring the latest version is installed unless running via npx.
diff --git a/graft/src/cli.md b/graft/src/cli.md
deleted file mode 100644
index a0f6fad1..00000000
--- a/graft/src/cli.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# src/cli.ts
-
-Defines the command-line interface for the graft tool, enabling various operations on the codebase's context graph.
-
-- GlobalOpts · interface · L46-L52 — Holds the global options for the CLI, allowing configuration of the context graph generation and LLM provider settings.
-- cliConfig · function · L55-L64 — Constructs the configuration object for the engine based on CLI options, ensuring the correct parameters are used for graph generation.
-- engineFrom · function · L66-L66 — Creates an instance of the Graft engine using the current CLI configuration, enabling graph operations.
-- fmt · function · L101-L105 — Formats a record of counts into a human-readable string for console output.
diff --git a/graft/src/context/build.md b/graft/src/context/build.md
deleted file mode 100644
index d8f001a5..00000000
--- a/graft/src/context/build.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# src/context/build.ts
-
-This file builds a context graph from a code repository by summarizing source files and synthesizing nodes.
-
-- BuildProgress · interface · L47-L52 — Tracks the progress of the build process across different phases.
-- BuildOptions · interface · L54-L64 — Defines options for customizing the build process, including output directory and model settings.
-- BuildResult · interface · L66-L75 — Holds the results of the build process, including counts of files and nodes processed.
-- BuildCache · interface · L78-L81 — Stores cached summaries and synthesized nodes to optimize the build process.
-- FileWork · interface · L83-L87 — Represents the work done on each file during the build process, including its summary and hash.
-- NodeDraft · interface · L90-L97 — Represents a node being constructed before finalizing its properties and links.
-- buildContext · function · L99-L266 — Main function that orchestrates the building of the context graph from the source files.
-- batchBySize · function · L269-L285 — Groups file summaries into batches that fit within a specified character budget for processing.
-- batchKey · function · L288-L295 — Generates a stable key for a batch of file summaries based on their content hashes.
-- registerName · function · L297-L300 — Registers a name and its corresponding slug in a mapping table to avoid duplicates.
-- resolveSlug · function · L302-L304 — Retrieves the slug associated with a given name from a mapping table.
-- errMsg · function · L306-L308 — Formats error messages for better readability.
-- cachePath · function · L310-L312 — Constructs the file path for the cache storage based on the output directory.
-- loadCache · function · L314-L325 — Loads the build cache from disk, returning existing summaries and synthesized nodes.
-- saveCache · function · L327-L331 — Saves the current build cache to disk to persist summaries and synthesized nodes.
-- mapWithConcurrency · function · L334-L349 — Executes a function over a list of items with a limit on concurrent executions, preserving order.
diff --git a/graft/src/context/check.md b/graft/src/context/check.md
deleted file mode 100644
index 7909085b..00000000
--- a/graft/src/context/check.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# src/context/check.ts · [[graph-synchronization]]
-
-This file provides functionality to verify if the committed context graph is synchronized with the current codebase, ensuring consistency in CI environments.
-
-- CheckResult · interface · L22-L30 — Defines the structure of the result returned by the checkContext function, encapsulating the status and details of any discrepancies found.
-- CheckOptions · interface · L32-L35 — Specifies optional parameters for the checkContext function, allowing customization of the context directory and file extensions to check.
-- checkContext · function · L37-L107 — Checks the current state of the context graph against the recorded manifest, identifying any content drift, removals, or coverage issues.
-- formatCheckReport · function · L110-L135 — Generates a human-readable report summarizing the results of the checkContext function, detailing any discrepancies found.
-- short · function · L137-L139 — Shortens a hash string to its first eight characters for easier readability in reports.
diff --git a/graft/src/context/node-file.md b/graft/src/context/node-file.md
deleted file mode 100644
index 5d868ffb..00000000
--- a/graft/src/context/node-file.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# src/context/node-file.ts
-
-This file defines the structure and operations for managing a context graph represented as markdown files.
-
-- SourceRef · interface · L30-L33 — Represents a source file that contributed to the creation of a node, including its content hash.
-- NodeLink · interface · L36-L40 — Defines a directed edge to another node, capturing the relationship and optional description.
-- ContextNode · interface · L43-L58 — Models a single node in the context graph, encapsulating its metadata and relationships.
-- Manifest · interface · L61-L71 — Represents the generated index of all nodes and their metadata for quick access and integrity checks.
-- slugify · function · L81-L86 — Converts a display name into a URL-safe slug for use in file naming and linking.
-- digestSources · function · L89-L95 — Calculates a SHA256 hash over the sorted lines of source file paths and hashes to ensure integrity.
-- contextDirFor · function · L100-L103 — Determines the absolute path for the graft directory in a repository, allowing for file operations.
-- renderGenerated · function · L106-L118 — Generates the markdown content for the summary and related links of a node.
-- defaultHuman · function · L121-L123 — Provides a default human-readable section for a new node, which is preserved in future generations.
-- renderNodeFile · function · L126-L141 — Serializes a node into its complete markdown file format, including generated and human sections.
-- preserveHuman · function · L148-L152 — Extracts the human region from an existing node file to ensure it is not lost during regeneration.
-- writeNode · function · L158-L169 — Writes a node to disk, preserving any existing human content and ensuring directory structure.
-- ParsedNode · interface · L172-L179 — Represents a parsed node file, capturing essential metadata without the body content.
-- readNodes · function · L182-L198 — Reads and parses all markdown node files in a specified directory, returning their metadata.
-- existingNodeSlugs · function · L201-L208 — Lists the slugs of existing node files in a directory, aiding in the management of deleted nodes.
-- deleteNode · function · L211-L214 — Deletes a specified node file from the filesystem, if it exists.
-- writeManifest · function · L216-L219 — Writes the manifest file to disk, containing metadata about the context graph.
-- readManifest · function · L221-L229 — Reads and parses the manifest file from disk, returning its contents or undefined if not found.
diff --git a/graft/src/context/savings.md b/graft/src/context/savings.md
deleted file mode 100644
index b708f7d9..00000000
--- a/graft/src/context/savings.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# src/context/savings.ts
-
-- Savings · interface · L17-L22 — interface Savings
-- toTokens · function · L25-L27 — function toTokens(chars: number): number
-- fileSizes · function · L32-L37 — function fileSizes(graph: GraphV1): Map<string, number>
-- savingsFor · function · L42-L53 — function savingsFor(graph: GraphV1, paths: Iterable<string>): Savings | undefined
-- savingsFooter · function · L69-L82 — function savingsFooter(body: string, saved: Savings | undefined): string
diff --git a/graft/src/engine.md b/graft/src/engine.md
deleted file mode 100644
index 14119627..00000000
--- a/graft/src/engine.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# src/engine.ts · [[error-handling-and-reporting]]
-
-The Graft class manages the construction and validation of a context graph from a code repository, ensuring it remains in sync with the codebase.
-
-- InitOptions · interface · L28-L33 — Defines options for initializing the context graph build, including code extensions and a progress callback.
-- CheckRunOptions · interface · L35-L37 — Specifies options for checking the context graph, allowing for code extensions to be included.
-- GraphRunOptions · interface · L39-L45 — Defines options for running the graph building process, including LLM usage and concurrency settings.
-- Graft · class · L47-L146 — Manages the context graph operations, including building and checking synchronization with the codebase.
-- constructor · method · L50-L52 — Initializes the Graft class with a configuration, resolving the necessary settings for the context graph.
-- init · method · L55-L64 — Builds the context graph from the specified directory, utilizing various options and configurations.
-- check · method · L67-L69 — Checks if the committed context graph is in sync with the code in the specified directory.
-- checkGraph · method · L72-L74 — Verifies if the committed graph.json file is in sync with the code, focusing on the Tier-1 differences.
-- graph · method · L81-L88 — Builds a per-symbol code graph from the repository, optionally using a meaning layer with LLM.
-- ask · method · L95-L103 — Processes a query against the context graph, returning results based on structural and lexical analysis.
-- chatModel · method · L108-L125 — Retrieves the configured chat model or throws an error if the API key is missing, ensuring proper setup for LLM operations.
-- synthesizer · method · L127-L129 — Provides the synthesizer for generating responses, defaulting to a chat synthesizer if none is configured.
-- cruxSummarizer · method · L132-L134 — Returns a crux summarizer for the Tier-2 pass of the code graph, ensuring detailed summarization of nodes.
-- summarizer · method · L136-L138 — Fetches the summarizer for generating summaries, defaulting to a chat summarizer if not explicitly set.
-- modelLabel · method · L141-L145 — Determines the human-readable label for the active model, which is recorded in the manifest for reference.
diff --git a/graft/src/graph/bindings.md b/graft/src/graph/bindings.md
deleted file mode 100644
index 1455d429..00000000
--- a/graft/src/graph/bindings.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# src/graph/bindings.ts
-
-This file implements a binding pass that resolves variable types in a parsed file, enabling accurate type lookups for local variables, parameters, and class fields during code analysis.
-
-- FileBindings · class · L18-L33 — Manages the mapping of variable/field names to their types within different scopes, enabling type resolution during code analysis.
-- set · method · L21-L23 — Records the type of a variable or field in the specified scope, allowing for later retrieval during type resolution.
-- lookup · method · L26-L32 — Retrieves the type associated with a variable or field name from the closest matching scope, facilitating type resolution in nested contexts.
-- defName · function · L45-L77 — Determines the name of a definition node (like a function or class) based on its syntax, aiding in the identification of types during analysis.
-- goReceiverVarOf · function · L81-L85 — Extracts the variable name of the receiver parameter from a Go method node, which is essential for understanding method context.
-- goReceiverTypeOf · function · L91-L97 — Determines the base type of a receiver in a Go method, which is crucial for type resolution in method calls.
-- resolveRecvType · function · L103-L121 — Resolves the type of a receiver in a method call based on the current context, ensuring accurate type information is used during analysis.
-- isClassNode · function · L123-L129 — Checks if a given node represents a class definition, which is important for understanding the structure of the code being analyzed.
-- collectBindings · function · L132-L138 — Traverses a parsed syntax tree to gather variable-to-type bindings, which are essential for type resolution in the codebase.
-- collectAliases · function · L142-L156 — Scans the syntax tree to collect import aliases, ensuring that type resolution accounts for aliased names in the code.
-- visit · function · L162-L182 — Recursively processes nodes in the syntax tree to build up type bindings and scopes, facilitating comprehensive type analysis.
-- resolveAlias · function · L188-L190 — Resolves a name through the collected aliases, ensuring that type lookups are accurate even when using aliased names.
-- pyTypeName · function · L192-L200 — Extracts and resolves the type name from a Python node, which is necessary for accurate type binding in Python code.
-- callTypeName · function · L202-L207 — Determines the type name from a call expression, which is important for understanding the types of function calls in the code.
-- handlePy · function · L209-L239 — Handles the processing of Python nodes to extract type information, contributing to the overall type resolution process.
-- tsAnnotationTypeName · function · L241-L248 — Extracts the type name from TypeScript annotation nodes, which is crucial for type resolution in TypeScript code.
-- tsNewTypeName · function · L250-L255 — Determines the type name from a TypeScript new expression, aiding in the resolution of types during analysis.
-- handleTs · function · L257-L285 — Processes TypeScript nodes to gather type information, which is essential for accurate type resolution in TypeScript code.
-- handleGo · function · L287-L322 — Handles the processing of Go nodes to extract type information, ensuring that type resolution is accurate for Go code.
diff --git a/graft/src/graph/build.md b/graft/src/graph/build.md
deleted file mode 100644
index 75d0b758..00000000
--- a/graft/src/graph/build.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# src/graph/build.ts · [[error-handling-and-reporting]]
-
-This file defines the logic for building a graph representation of a code repository, including parsing source files and resolving dependencies.
-
-- applyMinSubstanceGuard · function · L32-L47 — function applyMinSubstanceGuard(scopes: ScopeV1[], nodes: NodeV1[]): ScopeV1[]
-- GraphBuildOptions · interface · L49-L62 — This interface specifies options for customizing the graph build process, including output directory and summarization settings.
-- GraphBuildResult · interface · L64-L77 — This interface outlines the structure of the result returned from the graph build process, detailing the generated graph's metadata and statistics.
-- listSourceFiles · function · L80-L82 — This function retrieves a list of source files from a given directory, excluding the output directory and unsupported languages.
-- readGoModules · function · L88-L102 — This function identifies and reads Go modules from the repository to facilitate edge resolution for Go import paths.
-- buildGraph · function · L104-L215 — This function orchestrates the entire graph building process, from parsing source files to writing the final graph output.
diff --git a/graft/src/graph/cards.md b/graft/src/graph/cards.md
deleted file mode 100644
index 61ae8104..00000000
--- a/graft/src/graph/cards.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# src/graph/cards.ts
-
-This module generates markdown cards that summarize source files and their symbols, facilitating easier navigation and understanding of the codebase.
-
-- CardFileInfo · interface · L26-L32 — Holds information about a card's path, the source file it mirrors, and the number of symbols it contains.
-- CardStats · interface · L34-L38 — Tracks the statistics of card generation, including how many cards were written and pruned.
-- cardPathFor · function · L41-L44 — Constructs the markdown file path for a card by replacing the source file's extension with .md.
-- spanStart · function · L47-L50 — Extracts the starting line number from a given span string, returning 0 if the format is unparseable.
-- oneLiner · function · L53-L57 — Retrieves a concise summary or signature of a node, prioritizing the summary if available.
-- conceptsByPath · function · L60-L70 — Maps source paths to their corresponding concept node slugs, facilitating the creation of up-links in cards.
-- renderCard · function · L73-L99 — Generates the markdown content for a card, including the source file's summary and its symbols.
-- listExistingCards · function · L102-L121 — Lists all existing markdown card files in the output directory, excluding concept nodes and specific top-level files.
-- walk · function · L104-L113 — Recursively traverses directories to find markdown files for existing cards.
-- pruneEmptyDirs · function · L124-L144 — Removes empty directories from the output directory, ensuring a clean structure after card generation.
-- visit · function · L125-L142 — Visits directories to determine if they are empty after processing their contents.
-- writeCards · function · L150-L183 — Writes markdown cards for each source file, reflecting the source tree and pruning any outdated cards.
-- writeIndex · function · L189-L222 — This function creates an index markdown file that lists concept nodes and per-file cards, providing a quick reference for navigating the repository.
-- CoverRef · interface · L225-L230 — Represents a symbol covered by a concept node, including its name, kind, and location.
-- writeCovers · function · L245-L281 — Backfills concept nodes with a list of symbols they cover, enhancing their metadata for better navigation.
diff --git a/graft/src/graph/check.md b/graft/src/graph/check.md
deleted file mode 100644
index 41808af1..00000000
--- a/graft/src/graph/check.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# src/graph/check.ts · [[graph-synchronization]]
-
-Ensures that the committed graph.json accurately reflects the current state of the codebase, identifying any discrepancies.
-
-- GraphCheckResult · interface · L27-L37 — This interface defines the structure of the result returned by the graph check, detailing the state of the graph in relation to the code.
-- GraphCheckOptions · interface · L39-L41 — This interface provides optional parameters for configuring the context directory when performing a graph check.
-- checkGraph · function · L43-L101 — This function checks if the current code's graph representation matches the committed graph, identifying any added, removed, or changed nodes.
-- formatGraphCheckReport · function · L104-L135 — Generates a human-readable report summarizing the results of the graph check, indicating any issues found.
diff --git a/graft/src/graph/enrich.md b/graft/src/graph/enrich.md
deleted file mode 100644
index d32afc02..00000000
--- a/graft/src/graph/enrich.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# src/graph/enrich.ts
-
-This file implements a mechanism to enrich graph nodes with summaries and cruxes based on their state and prior computations.
-
-- EnrichOptions · interface · L31-L38 — This interface defines options for enriching graph nodes, including whether to compute new summaries and the level of concurrency for processing.
-- EnrichStats · interface · L40-L46 — Tracks the statistics of the enrichment process, including counts of cached, computed, stale, and pending nodes.
-- enrichGraph · function · L48-L136 — This function processes graph nodes to update their summaries and cruxes based on their state and prior data, potentially invoking an LLM for new computations.
-- mapWithConcurrency · function · L139-L154 — This function executes a provided asynchronous function over a list of items with a specified limit on concurrent executions, preserving the order of results.
-- collectFileCrux · function · L161-L181 — Collects crux information for nodes in a file, handling potential errors and ensuring partial results are returned.
-- buildCrux · function · L188-L203 — Extracts and formats the crux text from a source file based on the model's provided line range.
-- spanLines · function · L206-L212 — Parses a line span string into a clamped range of line numbers, ensuring valid boundaries.
diff --git a/graft/src/graph/extract.md b/graft/src/graph/extract.md
deleted file mode 100644
index 1bafd03a..00000000
--- a/graft/src/graph/extract.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# src/graph/extract.ts · [[graph-extraction-and-loading]]
-
-This file provides functionality to extract and represent code structure from source files into a standardized format for further processing.
-
-- Language · type · L18-L18 — Defines a type representing the supported programming languages for extraction.
-- languageOf · function · L21-L28 — Determines the programming language of a given file path based on its extension.
-- RawEdge · interface · L34-L45 — Represents an unresolved edge in the code structure that will be resolved later during processing.
-- ExtractResult · interface · L47-L50 — Holds the result of the extraction process, containing nodes and raw edges.
-- searchBody · function · L67-L70 — Normalizes and truncates the body of a code definition for efficient searching.
-- fileResidual · function · L78-L89 — Extracts the module-level residual content from a source file that is not covered by any symbol definitions.
-- WalkCtx · interface · L136-L147 — Contextual information used during the traversal of the syntax tree for code extraction.
-- DefDescriptor · interface · L150-L156 — Describes a code definition with its relevant metadata for extraction purposes.
-- parseSource · function · L164-L166 — Parses the source code into a syntax tree while handling large files in manageable chunks.
-- extractFile · function · L168-L209 — Extracts nodes and edges from a source file, representing its structure in a standardized format.
-- walk · function · L211-L278 — Recursively traverses the syntax tree to collect definitions and their relationships.
-- describe · function · L282-L313 — Identifies and describes the shape of code definitions based on their syntax tree representation.
-- describeGo · function · L318-L356 — Describes Go-specific code definitions, including functions and methods, from the syntax tree.
-- goReceiverType · function · L360-L366 — Extracts the base type name of a receiver for Go methods, if applicable.
-- goExported · function · L370-L374 — Determines if a Go symbol is exported based on its naming convention.
-- heritageEdges · function · L376-L403 — Generates edges representing class inheritance and implementation relationships.
-- calleeName · function · L405-L428 — Extracts the name and context of a function call from the syntax tree, including receiver information.
-- pyReceiver · function · L432-L441 — Identifies the receiver of a Python method call from its syntax tree representation.
-- tsReceiver · function · L444-L454 — Identifies the receiver of a TypeScript method call from its syntax tree representation.
-- isImport · function · L456-L461 — Determines if a syntax node represents an import statement in the code.
-- importSpecifier · function · L463-L479 — Extracts the module path from an import statement in the syntax tree.
-- clean · function · L482-L489 — Cleans and normalizes a function signature by removing unnecessary whitespace and punctuation.
-- tsExported · function · L492-L499 — Checks if a node is exported based on its ancestor nodes in the syntax tree.
diff --git a/graft/src/graph/load.md b/graft/src/graph/load.md
deleted file mode 100644
index 14ce329c..00000000
--- a/graft/src/graph/load.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# src/graph/load.ts · [[graph-extraction-and-loading]]
-
-This module implements a caching mechanism to optimize the loading of graph and ask index data by avoiding unnecessary re-parsing of files when their metadata has not changed.
-
-- CacheEntry · interface · L31-L35 — Defines the structure for cache entries, encapsulating the metadata and value of cached items to facilitate efficient cache management.
-- __resetParseCounts · function · L45-L48 — Resets the counters that track the number of cache misses for graph and ask index parsing, ensuring a clean state for tests.
-- statOf · function · L50-L57 — Retrieves the metadata (mtime and size) of a file, returning null if the file does not exist, which is essential for cache validation.
-- loadCached · function · L59-L81 — Loads a cached value from a specified cache, re-parsing the value if the file's metadata has changed, thus ensuring up-to-date data retrieval.
-- loadGraphCached · function · L86-L91 — Caches the result of reading a graph from a file, ensuring that it is only re-read when the file's metadata indicates a change.
-- loadAskIndexCached · function · L95-L100 — Caches the result of reading an ask index from a file, ensuring that it is only re-read when the file's metadata indicates a change.
diff --git a/graft/src/graph/map.md b/graft/src/graph/map.md
deleted file mode 100644
index 2ebdceef..00000000
--- a/graft/src/graph/map.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# src/graph/map.ts
-
-Builds a structured representation of a repository's file and symbol organization based on their relationships, facilitating easier navigation and understanding of the codebase.
-
-- Hub · interface · L27-L33 — Defines the structure of a hub in the repository map, capturing its essential attributes for identification and ranking.
-- DirEntry · interface · L35-L47 — Represents a directory entry in the repository map, summarizing its contents and associated hubs for better navigation.
-- ScopeGroup · interface · L52-L59 — interface ScopeGroup
-- RepoMap · interface · L61-L81 — Encapsulates the entire repository map structure, providing a comprehensive overview of files, symbols, and their relationships.
-- BuildRepoMapOptions · interface · L83-L90 — Specifies options for building the repository map, allowing customization of directory and hub limits.
-- dirKey · function · L102-L105 — Generates a directory key based on the specified depth, facilitating the grouping of files in the repository map.
-- computeInDegree · function · L110-L117 — Calculates the in-degree of nodes in the graph, determining the number of incoming edges for each target, which is crucial for identifying hubs.
-- topHubs · function · L122-L128 — Identifies the top hubs based on in-degree, ensuring that only significant nodes are included in the repository map.
-- sortedLanguages · function · L130-L137 — Sorts and deduplicates the programming languages used in the repository, enhancing the metadata of the repository map.
-- computeDirEntries · function · L150-L220 — function computeDirEntries( nodes: NodeV1[], inDegree: Map<string, number>, maxDirs: number, hubsPerDir: number, stripPrefix: string, ): { dirs: DirEntry[]; dropped: number }
-- relPath · function · L160-L161 — relPath = (path: string): string
-- depthFor · function · L181-L181 — depthFor = (rp: string): number
-- fullPath · function · L197-L198 — fullPath = (relKey: string): string
-- buildRepoMap · function · L233-L283 — Constructs the repository map from a given graph, organizing files and symbols into a structured format for easy access.
-- basenameOf · function · L287-L290 — Extracts the base name from a file path, simplifying the representation of file names in the output.
-- formatDirHub · function · L292-L294 — Formats a hub's information for display, providing a user-friendly representation of its attributes.
-- formatDirLine · function · L296-L305 — Formats a directory entry for display, summarizing its contents and associated hubs in a readable format.
-- formatHotspot · function · L307-L309 — Formats a hotspot's information for display, detailing its attributes in a clear manner.
-- droppedNote · function · L312-L315 — function droppedNote(dropped: number): string | null
-- formatRepoMap · function · L323-L348 — Renders the repository map as a human-readable string, summarizing its contents and structure for easy understanding.
diff --git a/graft/src/graph/relations.md b/graft/src/graph/relations.md
deleted file mode 100644
index 4f77066c..00000000
--- a/graft/src/graph/relations.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# src/graph/relations.ts · [[graph-extraction-and-loading]] [[graph-representation]]
-
-Defines a set of dependency relations for graph traversal, ensuring accurate representation of connections between symbols.
-
-_No extracted symbols in this file._
diff --git a/graft/src/graph/resolve.md b/graft/src/graph/resolve.md
deleted file mode 100644
index f5ed1e0f..00000000
--- a/graft/src/graph/resolve.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# src/graph/resolve.ts · [[graph-extraction-and-loading]]
-
-This module resolves various types of edges between nodes in a codebase, ensuring accurate connections based on defined relationships and confidence levels.
-
-- GoModule · interface · L39-L42 — Defines the structure for a Go module, enabling the mapping of Go import paths to their corresponding directories in the repository.
-- ResolveOptions · interface · L44-L49 — Specifies options for resolving edges, including the Go modules present in the repository for accurate import path mapping.
-- resolveEdges · function · L51-L140 — Processes nodes and raw edges to create a list of resolved edges, ensuring accurate relationships based on various resolution strategies.
-- add · function · L97-L102 — Adds a new edge to the output if it hasn't been seen before, preventing duplicates in the resolved edges list.
-- push · function · L142-L146 — This function adds a value to an array in a map, creating the array if it doesn't exist, facilitating grouped storage of nodes.
-- resolveName · function · L152-L164 — This function resolves a symbol name to its corresponding node ID, prioritizing local matches and handling ambiguities appropriately.
-- resolveTypedMember · function · L180-L213 — Resolves a typed member call against a method index, traversing the inheritance chain to find the appropriate method or returning ambiguity if necessary.
-- resolveImport · function · L219-L231 — This function resolves a module specifier to a file node ID if it points within the repository, ensuring correct imports.
-- resolveGoImport · function · L243-L258 — Maps a Go import package path to an in-repo file node, handling module paths and ensuring correct resolution within the repository structure.
diff --git a/graft/src/graph/scopes.md b/graft/src/graph/scopes.md
deleted file mode 100644
index 776aa84b..00000000
--- a/graft/src/graph/scopes.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# src/graph/scopes.ts
-
-- collectDirs · function · L37-L56 — function collectDirs(root: string): string[]
-- walk · function · L39-L53 — walk = (absDir: string, relDir: string): void
-- parsePnpmPackagesList · function · L60-L73 — function parsePnpmPackagesList(text: string): string[] | null
-- readWorkspaceGlobs · function · L78-L100 — function readWorkspaceGlobs(root: string): string[] | null
-- resolveGlob · function · L105-L166 — function resolveGlob(root: string, pattern: string): string[]
-- listDirs · function · L140-L150 — listDirs = (absDir: string, relDir: string): string[]
-- Candidate · interface · L168-L171 — interface Candidate
-- discoverScopes · function · L174-L307 — function discoverScopes(root: string): ScopeV1[]
-- findNearestAncestorCandidate · function · L254-L264 — findNearestAncestorCandidate = ( prefix: string, set: ReadonlyMap<string, Candidate>, ): string | null
-- scopeOf · function · L312-L318 — function scopeOf(path: string, scopes: ScopeV1[]): ScopeV1
-- scopeLabel · function · L323-L325 — function scopeLabel(prefix: string): string
-- scopesHereClause · function · L331-L334 — function scopesHereClause(scopes: ScopeV1[]): string
-- pathUnderPrefix · function · L341-L343 — function pathUnderPrefix(path: string, prefix: string): boolean
-- discoverWorkspaceChildren · function · L347-L364 — function discoverWorkspaceChildren(root: string): string[]
-- scopesOfGraph · function · L369-L371 — function scopesOfGraph(graph: GraphV1): ScopeV1[]
diff --git a/graft/src/graph/traverse-cli.md b/graft/src/graph/traverse-cli.md
deleted file mode 100644
index 605738ef..00000000
--- a/graft/src/graph/traverse-cli.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# src/graph/traverse-cli.ts · [[graph-traversal-and-analysis]]
-
-This file implements CLI commands for traversing a graph to find callers, callees, and impact of symbols, ensuring a consistent user experience across different commands.
-
-- CallersCliOptions · interface · L21-L30 — interface CallersCliOptions
-- headerOf · function · L38-L40 — Generates a formatted header string for a node, providing essential information for display in CLI output.
-- hitLine · function · L44-L49 — Formats a single hit line for display, showing the relationship and details of a node in the context of the traversal.
-- callersSavings · function · L55-L65 — function callersSavings( graph: GraphV1, results: { symbol: NodeV1; hits: EdgeHit[] }[], ): Savings | undefined
-- looseNoteFor · function · L68-L72 — Creates a user-friendly message when no edges are found for a symbol, guiding users on next steps.
-- SymbolJson · interface · L74-L80 — Defines the structure for symbol metadata in JSON format, ensuring consistent representation of symbols in output.
-- MatchJson · interface · L82-L86 — Defines the structure for matching results in JSON format, encapsulating symbol information and associated hits.
-- HitJson · interface · L88-L96 — Defines the structure for hit details in JSON format, providing information about the relationship and depth of hits.
-- symbolJson · function · L98-L100 — Converts a node into a standardized JSON format, facilitating consistent output for symbol information.
-- hitJson · function · L102-L111 — Transforms an EdgeHit into a JSON format, ensuring structured output for hits in the traversal results.
-- resolveDirection · function · L114-L119 — function resolveDirection(raw: string | undefined): Direction
-- runCallersCommand · function · L127-L182 — function runCallersCommand(query: string, dir: string, opts: CallersCliOptions): void
diff --git a/graft/src/graph/traverse.md b/graft/src/graph/traverse.md
deleted file mode 100644
index 0658fb00..00000000
--- a/graft/src/graph/traverse.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# src/graph/traverse.ts · [[graph-traversal-and-analysis]]
-
-Centralizes the logic for resolving symbol queries in a graph, enabling consistent identification of nodes based on various naming conventions and paths.
-
-- Direction · type · L21-L21 — type Direction = "in" | "out";
-- SymbolMatch · interface · L25-L27 — Represents a resolved match for a symbol search in the graph, allowing for future disambiguation of metadata.
-- ResolveSymbolOptions · interface · L29-L32 — Defines options for narrowing down symbol resolution candidates based on path substring filtering.
-- resolveSymbol · function · L53-L78 — Resolves a query string to all matching nodes in the graph, handling various naming conventions and fallbacks.
-- symbolMatches · function · L80-L89 — Filters nodes in the graph to find matches based on a case-insensitive query, considering both name and id suffixes.
-- EdgeHit · interface · L94-L99 — Represents a traversed edge in the graph, capturing the relationship and depth of the connection to a node.
-- callersOf · function · L102-L110 — Finds all edges leading to a specified symbol, indicating which nodes directly call it.
-- calleesOf · function · L113-L121 — Identifies all edges originating from a specified symbol, showing which nodes it directly calls.
-- impactOf · function · L129-L131 — Performs a breadth-first search to determine the impact of changes to a symbol, identifying affected nodes up to a specified depth.
-- impactOfMany · function · L149-L184 — Generalizes the impact analysis to multiple seed nodes, aggregating the results of their incoming edges.
-- symbolsInFile · function · L188-L190 — Retrieves all symbols defined in a specific file, filtering out file nodes.
-- impactOfFile · function · L201-L203 — Aggregates the impact analysis for a file node and its defined symbols, ensuring all dependents are considered.
-- edgeWalk · function · L218-L222 — function edgeWalk(graph: GraphV1, node: NodeV1, direction: Direction, depth: number): EdgeHit[]
diff --git a/graft/src/graph/types.md b/graft/src/graph/types.md
deleted file mode 100644
index a5d96189..00000000
--- a/graft/src/graph/types.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# src/graph/types.ts · [[graph-extraction-and-loading]] [[graph-representation]]
-
-Defines the structure and relationships of a code graph schema, facilitating the representation of code elements and their interactions.
-
-- Kind · type · L15-L23 — Enumerates the various types of nodes in the code graph, ensuring consistent categorization of code elements across different languages.
-- Confidence · type · L26-L26 — Specifies the confidence levels for the truth of edges in the graph, aiding in the assessment of relationships.
-- SummaryState · type · L29-L29 — Indicates whether the meaning-layer has been computed for a node, managing the state of node summaries.
-- Crux · interface · L33-L36 — Holds the LLM-chosen business-logic excerpt for a node, providing a source of truth for code interpretation.
-- NodeV1 · interface · L38-L63 — Describes the properties of a node in the code graph, encapsulating its identity, location, and meaning for effective graph representation.
-- Relation · type · L65-L71 — Defines the types of relationships between nodes in the graph, clarifying how symbols interact.
-- EdgeV1 · interface · L73-L78 — Describes the edges connecting nodes in the graph, detailing the source, target, and relationship type.
-- ScopeV1 · interface · L84-L88 — interface ScopeV1
-- GraphV1 · interface · L90-L102 — Encapsulates the entire graph structure, including metadata and collections of nodes and edges.
diff --git a/graft/src/graph/workspace-cli.md b/graft/src/graph/workspace-cli.md
deleted file mode 100644
index 6f7575cb..00000000
--- a/graft/src/graph/workspace-cli.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# src/graph/workspace-cli.ts
-
-- WorkspaceBuildOptions · interface · L24-L32 — interface WorkspaceBuildOptions
-- runWorkspaceBuild · function · L37-L57 — async function runWorkspaceBuild(root: string, opts: WorkspaceBuildOptions): Promise<void>
-- buildChild · function · L38-L44 — buildChild = async (childDir: string, childName: string): Promise<void>
-- runWorkspaceAsk · function · L59-L68 — function runWorkspaceAsk( root: string, override: string | undefined, query: string, opts: { limit?: number; source?: boolean; full?: boolean; in?: string; json?: boolean }, ): void
-- runWorkspaceGrep · function · L70-L87 — function runWorkspaceGrep( root: string, override: string | undefined, pattern: string, opts: { ignoreCase?: boolean; fixed?: boolean; json?: boolean }, ): void
-- runWorkspaceMap · function · L89-L95 — function runWorkspaceMap( root: string, override: string | undefined, opts: { maxDirs?: number }, ): void
-- runWorkspaceCheck · function · L97-L101 — function runWorkspaceCheck(root: string, override?: string): void
-- runWorkspaceCallers · function · L103-L115 — function runWorkspaceCallers( root: string, override: string | undefined, symbol: string, opts: { direction?: Direction; depth?: number; in?: string }, ): void
diff --git a/graft/src/graph/workspace.md b/graft/src/graph/workspace.md
deleted file mode 100644
index 8d6a57cd..00000000
--- a/graft/src/graph/workspace.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# src/graph/workspace.ts
-
-- WorkspaceV1 · interface · L44-L48 — interface WorkspaceV1
-- workspacePath · function · L53-L55 — function workspacePath(root: string, override?: string): string
-- readWorkspace · function · L59-L68 — function readWorkspace(root: string, override?: string): WorkspaceV1 | null
-- writeWorkspace · function · L71-L78 — function writeWorkspace(root: string, ws: WorkspaceV1, override?: string): string
-- isWorkspaceBuildRoot · function · L84-L88 — function isWorkspaceBuildRoot(root: string, override?: string): boolean
-- hasMegaGraph · function · L92-L94 — function hasMegaGraph(root: string, override?: string): boolean
-- migrationNote · function · L98-L105 — function migrationNote(children: string[]): string
-- clearParentGraft · function · L111-L113 — function clearParentGraft(root: string, override?: string): void
-- LoadedChild · interface · L115-L118 — interface LoadedChild
-- WorkspaceGraphs · interface · L120-L126 — interface WorkspaceGraphs
-- loadWorkspaceGraphs · function · L132-L143 — function loadWorkspaceGraphs(root: string, override?: string): WorkspaceGraphs
-- coverageNote · function · L148-L152 — function coverageNote(g: WorkspaceGraphs): string
-- prefixPointer · function · L156-L165 — function prefixPointer(child: string, pointer: string): string
-- FederateAskOptions · interface · L167-L175 — interface FederateAskOptions
-- ChildRun · interface · L177-L186 — interface ChildRun
-- federateAsk · function · L207-L306 — function federateAsk( root: string, override: string | undefined, query: string, opts: FederateAskOptions = {}, ): AskResult
-- federateGrep · function · L311-L351 — function federateGrep( root: string, override: string | undefined, pattern: string, opts: { ignoreCase?: boolean; fixed?: boolean } = {}, ): { result: GrepResult; coverage: string }
-- federateMap · function · L355-L374 — function federateMap( root: string, override: string | undefined, opts: { maxDirs?: number } = {}, ): string
-- federateCheck · function · L378-L403 — function federateCheck( root: string, override?: string, ): { text: string; ok: boolean }
-- federateCallers · function · L407-L443 — function federateCallers( root: string, override: string | undefined, symbol: string, opts: { direction?: Direction; depth?: number; in?: string } = {}, ): { text: string; found: boolean }
-- splitWorkspace · function · L457-L470 — async function splitWorkspace( root: string, override: string | undefined, buildChild: (childDir: string, childName: string) => Promise<void>, onStart?: (info: { children: string[]; migrated: boolean }) => void, ): Promise<{ children: string[]; migrated: boolean }>
diff --git a/graft/src/graph/write.md b/graft/src/graph/write.md
deleted file mode 100644
index 6d7e7a85..00000000
--- a/graft/src/graph/write.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# src/graph/write.ts
-
-This file manages the serialization and deserialization of a wiring graph, ensuring efficient storage and retrieval of graph data for further processing.
-
-- wiringPath · function · L20-L22 — Generates the absolute path for the wiring graph file in a specified output directory.
-- readGraph · function · L28-L34 — Reads and parses an existing wiring graph from a file, returning null if the file is absent or unparseable.
-- writeGraph · function · L36-L46 — Writes a serialized and sorted representation of the graph to a JSON file, optimizing for size by stripping unnecessary data.
-- stripBodyText · function · L57-L61 — Removes the body_text property from a node to reduce the size of the serialized graph, avoiding duplication of data already stored elsewhere.
-- edgeOrder · function · L63-L69 — Defines the sorting order for edges in the wiring graph based on source, relation, and target.
diff --git a/graft/src/hosts/codex-hooks.md b/graft/src/hosts/codex-hooks.md
deleted file mode 100644
index 2ec4cfe4..00000000
--- a/graft/src/hosts/codex-hooks.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# src/hosts/codex-hooks.ts · [[host-management-and-configuration]]
-
-Facilitates the installation and management of user-level hooks for CLI agents, ensuring that hooks are correctly written and updated in the hooks.json configuration file after file edits.
-
-- HookWrite · interface · L11-L15 — Defines the structure for hook write operations, encapsulating the ID, path, and action taken during the write process.
-- dirExists · function · L17-L19 — Checks if a given directory path exists, returning a boolean value to indicate its existence.
-- writeOwned · function · L21-L31 — Handles the creation or updating of a file with specific content and permissions, returning the action taken.
-- isGraftEntry · function · L33-L35 — Determines if a given entry is a graft entry by checking for a specific string in its JSON representation.
-- installCodexHooks · function · L37-L74 — Installs codex hooks by writing a shim and updating the hooks configuration based on the provided home directory.
diff --git a/graft/src/hosts/init.md b/graft/src/hosts/init.md
deleted file mode 100644
index 648d392d..00000000
--- a/graft/src/hosts/init.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# src/hosts/init.ts · [[host-management-and-configuration]]
-
-Initializes host configurations by writing instruction files based on selected hosts, ensuring that the correct files are created or updated as needed.
-
-- HostsInitResult · interface · L14-L20 — Defines the structure of the result returned by the host initialization process, capturing written, skipped, and unknown hosts along with MCP and hooks data.
-- probeFor · function · L22-L27 — Creates a probe object to check for the existence of directories in a specified repository, facilitating host detection.
-- writeOwned · function · L29-L35 — Writes content to a specified path, creating or replacing the file as necessary, and returns the action taken.
-- runHostsInit · function · L37-L72 — Initializes hosts by selecting them based on provided options and writing their instruction files, while also handling MCP configurations and hooks.
diff --git a/graft/src/hosts/instructions.md b/graft/src/hosts/instructions.md
deleted file mode 100644
index 79998580..00000000
--- a/graft/src/hosts/instructions.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# src/hosts/instructions.ts · [[host-management-and-configuration]]
-
-This file provides Graft instructions for navigating and utilizing the context graph effectively.
-
-- instructionBody · function · L6-L46 — Generates the main instructional content for using the Graft context graph.
-- cursorRule · function · L48-L55 — Defines a rule to always apply the Graft context graph before exploring source code.
-- kiroSteering · function · L57-L63 — Specifies a rule for always including the Graft context graph in the workflow.
-- windsurfRule · function · L65-L68 — Provides a rule that incorporates the Graft context graph into its logic.
diff --git a/graft/src/hosts/mcp-config.md b/graft/src/hosts/mcp-config.md
deleted file mode 100644
index bd0bbef5..00000000
--- a/graft/src/hosts/mcp-config.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# src/hosts/mcp-config.ts · [[host-management-and-configuration]]
-
-Facilitates the registration and configuration of multiple MCP servers in specified host configurations, ensuring proper JSON and TOML formatting.
-
-- McpWrite · interface · L10-L14 — Defines the structure for writing MCP configuration results, indicating the operation performed on the configuration file.
-- dirExists · function · L19-L21 — Checks if a given directory path exists, returning a boolean value.
-- mergeJsonKey · function · L23-L43 — Merges a JSON entry into a specified key of a JSON file, creating or updating the file as necessary.
-- upsertCodexToml · function · L45-L54 — Inserts or updates a section in a TOML configuration file for the codex, ensuring the section exists.
-- registerMcpConfigs · function · L56-L87 — Registers MCP configurations for multiple IDs, handling different file types and structures based on the ID.
diff --git a/graft/src/hosts/registry.md b/graft/src/hosts/registry.md
deleted file mode 100644
index 34a81327..00000000
--- a/graft/src/hosts/registry.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# src/hosts/registry.ts · [[host-management-and-configuration]]
-
-- DetectProbe · interface · L12-L16 — Defines the structure for probing the existence of directories related to AI coding hosts.
-- HostTarget · interface · L18-L26 — Represents a target host with its identification, type, and detection logic for AI coding environments.
-- hostIds · function · L82-L84 — Retrieves a list of identifiers for all defined host targets.
-- detectHosts · function · L86-L88 — Filters and returns host targets that are detected based on the provided probing information.
diff --git a/graft/src/hosts/sections.md b/graft/src/hosts/sections.md
deleted file mode 100644
index e0b64414..00000000
--- a/graft/src/hosts/sections.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# src/hosts/sections.ts · [[host-management-and-configuration]]
-
-This file provides functionality to manage sections of text within files, specifically for inserting and updating content between defined markers.
-
-- UpsertAction · type · L11-L11 — Defines the possible outcomes of an upsert operation on a section, indicating whether it was created, appended, replaced, or unchanged.
-- LineEnding · type · L13-L13 — Specifies the types of line endings that can be used in the text, ensuring compatibility with different operating systems.
-- fencedBlock · function · L15-L21 — Creates a formatted block of text enclosed by specific markers, ensuring proper line endings and normalization of input.
-- detectEol · function · L24-L26 — Determines the dominant line ending used in a given text, facilitating consistent handling of line breaks.
-- markerLineIndex · function · L29-L34 — Finds the index of a specified marker in an array of lines, helping to locate the start and end of sections within the text.
-- upsertSection · function · L36-L67 — Handles the logic for inserting or updating a section of text in a file, managing file creation, content comparison, and writing operations.
diff --git a/graft/src/index.md b/graft/src/index.md
deleted file mode 100644
index 192cccab..00000000
--- a/graft/src/index.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# src/index.ts
-
-This module serves as the public API for the Graft library, facilitating the building and checking of a graph of linked markdown files.
-
-_No extracted symbols in this file._
diff --git a/graft/src/ingest/fs.md b/graft/src/ingest/fs.md
deleted file mode 100644
index d063db85..00000000
--- a/graft/src/ingest/fs.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# src/ingest/fs.ts
-
-This file provides utilities for walking through a filesystem to identify source files while excluding certain directories and large files.
-
-- walkDir · function · L27-L45 — The walkDir function recursively collects paths of files in a directory while skipping specified directories and files larger than 1 MB.
diff --git a/graft/src/mcp/server.md b/graft/src/mcp/server.md
deleted file mode 100644
index df627206..00000000
--- a/graft/src/mcp/server.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# src/mcp/server.ts
-
-Defines a minimal JSON-RPC 2.0 server for handling protocol messages and tool calls.
-
-- send · function · L8-L10 — Sends a JSON-RPC message to the standard output stream.
-- reply · function · L12-L14 — Constructs and sends a successful JSON-RPC response message.
-- replyError · function · L16-L18 — Constructs and sends a JSON-RPC error response message.
-- startMcpServer · function · L20-L66 — Initializes the server to listen for incoming JSON-RPC messages and handle them appropriately.
diff --git a/graft/src/mcp/tools.md b/graft/src/mcp/tools.md
deleted file mode 100644
index d4866f81..00000000
--- a/graft/src/mcp/tools.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# src/mcp/tools.ts
-
-- ToolDef · interface · L27-L31 — Defines the structure for tool definitions used in the MCP tools, ensuring consistent input schema and metadata for each tool.
-- unknownSymbolText · function · L35-L37 — Generates an error message for an unknown symbol query, guiding users to check their input or build the graph.
-- renderMatches · function · L129-L144 — Formats and renders the results of graph traversal matches, providing a structured output for users to understand symbol relationships.
-- callWorkspaceTool · function · L150-L196 — function callWorkspaceTool( root: string, dirOverride: string | undefined, name: string, args: Record<string, unknown>, ): { text: string; isError: boolean } | null
-- callTool · function · L198-L284 — Handles the invocation of various tools based on user input, managing errors and returning formatted results for different graph operations.
diff --git a/graft/src/search/grep-cli.md b/graft/src/search/grep-cli.md
deleted file mode 100644
index 3d1aa4a2..00000000
--- a/graft/src/search/grep-cli.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# src/search/grep-cli.ts · [[graph-traversal-and-analysis]]
-
-This file provides the command-line interface for the grep functionality, formatting results for user-friendly output.
-
-- GrepCliOptions · interface · L16-L23 — Defines options for the grep command-line interface, allowing customization of search behavior.
-- groupHeader · function · L25-L28 — Generates a header string for a group of grep results, summarizing the group's metadata.
-- formatGroup · function · L30-L34 — Formats a group of grep results into a human-readable string, including hit lines.
-- formatGrepHeader · function · L37-L40 — Creates a header for the grep results, summarizing the total hits and files searched.
-- truncationNote · function · L43-L50 — Generates a note about any truncation in the grep results, indicating unreadable files or additional hits beyond the cap.
-- formatGrepResult · function · L54-L62 — Compiles the full human-readable report of grep results, including headers and formatted groups.
-- zeroHitNote · function · L72-L77 — Provides a detailed message for zero-hit results, explaining the absence of matches and potential issues.
-- runGrepCommand · function · L86-L115 — Executes the grep command, handling graph resolution, pattern searching, and output formatting.
diff --git a/graft/src/search/grep.md b/graft/src/search/grep.md
deleted file mode 100644
index acb7cf89..00000000
--- a/graft/src/search/grep.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# src/search/grep.ts · [[graph-traversal-and-analysis]]
-
-This file implements a regex search over indexed files in a graph, grouping results by their enclosing symbols and ranking them by their importance based on incoming edges.
-
-- GrepHit · interface · L18-L22 — Represents a single hit found during the grep search, including the line number and trimmed text of the line.
-- GrepSymbolRef · interface · L24-L32 — Defines a reference to a symbol in the graph, including its qualified name and span, to facilitate grouping grep hits by their enclosing symbols.
-- GrepGroup · interface · L34-L43 — Groups grep hits by their enclosing symbol, providing context such as the symbol's in-degree and the path of the file.
-- GrepResult · interface · L45-L62 — Encapsulates the results of a grep operation, including the pattern searched, total hits, and grouped results.
-- GrepOptions · interface · L64-L73 — Holds options for configuring the grep search, such as case sensitivity and maximum hits to collect.
-- escapeRegExp · function · L79-L81 — Escapes special characters in a string to create a safe regex pattern for searching.
-- spanBounds · function · L83-L87 — Extracts the start and end line numbers from a span string, returning null if the format is invalid.
-- SymbolSpan · interface · L89-L93 — Represents a span of a symbol in the graph, including its start and end lines, to assist in finding enclosing symbols.
-- symbolsOf · function · L97-L106 — Retrieves and sorts the symbols of a given file in the graph, based on their span start lines.
-- enclosingSymbol · function · L112-L119 — Finds the innermost symbol that contains a specified line number, returning the corresponding node from the graph.
-- computeInDegree · function · L123-L130 — Calculates the incoming edge count for each symbol in the graph, which is used to rank grep hits by importance.
-- toSymbolRef · function · L132-L135 — Converts a node in the graph to a GrepSymbolRef, providing a structured representation of the symbol.
-- grepGraph · function · L137-L200 — Performs the grep search on the graph, collecting and returning results based on the specified pattern and options.
diff --git a/graft/src/util/id.md b/graft/src/util/id.md
deleted file mode 100644
index ddee9552..00000000
--- a/graft/src/util/id.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# src/util/id.ts
-
-This file provides utility functions for generating unique identifiers, creating content hashes, and normalizing names for consistent matching.
-
-- newId · function · L4-L6 — This function generates a unique identifier with a specified prefix, solving the need for easily identifiable and unique keys.
-- contentHash · function · L9-L11 — This function creates a stable hash of the input content, which is essential for deduplication of documents.
-- normalizeName · function · L14-L16 — This function normalizes names for case- and whitespace-insensitive matching, ensuring consistency in name comparisons.
diff --git a/graft/src/viz/assemble.md b/graft/src/viz/assemble.md
deleted file mode 100644
index 0a272a8c..00000000
--- a/graft/src/viz/assemble.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# src/viz/assemble.ts · [[visualization-and-serving]]
-
-Assembles a comprehensive graph document from markdown files in a context directory, ensuring that only valid nodes and edges are included.
-
-- VizNode · interface · L18-L24 — Defines the structure of a node in the visualization graph, encapsulating its identity and attributes.
-- VizEdge · interface · L26-L31 — Defines the structure of an edge in the visualization graph, representing relationships between nodes.
-- VizGraph · interface · L33-L42 — Encapsulates the complete visualization graph, including metadata about nodes and edges.
-- normalizeRelation · function · L56-L58 — Maps legacy vague verbs to concrete verbs to maintain consistency in the graph's relationships.
-- extractSummary · function · L65-L76 — Extracts and cleans the summary text from a markdown node's content, ensuring it adheres to length constraints.
-- assembleContextGraph · function · L79-L130 — Processes markdown files in a specified directory to create a structured visualization graph, handling errors gracefully.
diff --git a/graft/src/viz/serve.md b/graft/src/viz/serve.md
deleted file mode 100644
index 3326bc86..00000000
--- a/graft/src/viz/serve.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# src/viz/serve.ts · [[visualization-and-serving]]
-
-This file implements a local server for serving a viewer and handling API requests related to context and code graphs.
-
-- VizServerOptions · interface · L16-L21 — Defines the configuration options required to start the visualization server.
-- VizServer · interface · L23-L26 — Represents the visualization server with its URL and a method to close it.
-- sendJson · function · L38-L41 — Sends a JSON response with the specified status and body to the client.
-- listen · function · L43-L55 — Attempts to bind the server to a specified port, handling errors if the port is in use.
-- onError · function · L45-L48 — Handles errors that occur when trying to bind the server to a port.
-- startVizServer · function · L57-L148 — Initializes and starts the visualization server, setting up routes and handling requests.
-- close · method · L140-L146 — Closes the visualization server and cleans up resources.
diff --git a/graft/tasks.md b/graft/tasks.md
deleted file mode 100644
index 5766c5e3..00000000
--- a/graft/tasks.md
+++ /dev/null
@@ -1,38 +0,0 @@
----
-name: Tasks
-slug: tasks
-type: system
-sources:
- - path: bench/tasks.ts
- hash: efb90e69f52adcb08bfe45fb5a983fc676df68befdc455513e2581a24f46807e
-sources_digest: bf5418660cc917f7af4f93b7ed71cfc4c37f06a27af5b61047b54ba572a3a2b0
-links:
- - to: agent
- relation: depends_on
- description: The agent executes the tasks defined in this component.
-generator:
- version: 1
-covers:
- - symbol: repoPath
- kind: function
- at: 'bench/tasks.ts:L30-L33'
- - symbol: Task
- kind: interface
- at: 'bench/tasks.ts:L35-L45'
- - symbol: Corpus
- kind: interface
- at: 'bench/tasks.ts:L47-L53'
----
-<!-- context:generated:start -->
-## Summary
-
-The tasks component defines a set of benchmark questions and expected answers, ensuring that each task is verifiable based on actual source code. It facilitates the evaluation of code understanding and comprehension.
-
-## Related
-
-- depends on [[agent]] — The agent executes the tasks defined in this component.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/test-helpers.md b/graft/test-helpers.md
deleted file mode 100644
index 114c5075..00000000
--- a/graft/test-helpers.md
+++ /dev/null
@@ -1,49 +0,0 @@
----
-name: Test Helpers
-slug: test-helpers
-type: system
-sources:
- - path: test/helpers.ts
- hash: e45af1d38d7c6d4abc804fc74e9ae4c3373cf78769c17b16b185c3ee0e2c3228
-sources_digest: ddc97a2b9b5b7ea60c6a55b3c250ddc0dffa3b335c4b43ddc9152dc900f56744
-links:
- - to: graph-traversal-and-impact-analysis
- relation: validates
- description: >-
- The test helpers are used to validate the functionality of graph traversal
- and impact analysis.
-generator:
- version: 1
-covers:
- - symbol: PassthroughSummarizer
- kind: class
- at: 'test/helpers.ts:L9-L13'
- - symbol: summarize
- kind: method
- at: 'test/helpers.ts:L10-L12'
- - symbol: BracketSynthesizer
- kind: class
- at: 'test/helpers.ts:L21-L50'
- - symbol: synthesize
- kind: method
- at: 'test/helpers.ts:L22-L49'
- - symbol: ensure
- kind: function
- at: 'test/helpers.ts:L24-L31'
- - symbol: fakeProviders
- kind: function
- at: 'test/helpers.ts:L52-L54'
----
-<!-- context:generated:start -->
-## Summary
-
-This component provides deterministic test doubles and utilities for creating mock data and structures, facilitating isolated testing of various graph functionalities without external dependencies.
-
-## Related
-
-- validates [[graph-traversal-and-impact-analysis]] — The test helpers are used to validate the functionality of graph traversal and impact analysis.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/test/ask-fusion.test.md b/graft/test/ask-fusion.test.md
deleted file mode 100644
index 3d5fc158..00000000
--- a/graft/test/ask-fusion.test.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# test/ask-fusion.test.ts
-
-- scopeDocs · function · L21-L23 — function scopeDocs(scope: string, scores: number[]): ScopedDoc[]
-- makeOps · function · L132-L146 — function makeOps(bStrength: { coverage: number; coverageStrong: number }): ScopeRankOps
diff --git a/graft/test/ask-index.test.md b/graft/test/ask-index.test.md
deleted file mode 100644
index 90f04642..00000000
--- a/graft/test/ask-index.test.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# test/ask-index.test.ts · [[testing-and-validation]]
-
-This file contains tests to ensure the integrity and correctness of the `ask` sidecar functionality, verifying that it accurately reproduces live tokenization results and handles various edge cases without failure.
-
-- makeFixture · function · L26-L50 — Creates a temporary multi-file fixture with overlapping vocabulary to facilitate meaningful tests on tokenization and scoring.
-- reinjectBodyText · function · L69-L85 — Reconstructs the body text for nodes in the wiring.json to ensure accurate tokenization results during tests.
-- sortPairs · function · L106-L106 — Sorts an array of pairs by the first element, ensuring consistent ordering for comparison in tests.
diff --git a/graft/test/ask.test.md b/graft/test/ask.test.md
deleted file mode 100644
index c23c6917..00000000
--- a/graft/test/ask.test.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# test/ask.test.ts · [[testing-and-validation]]
-
-Contains tests for the `ask` functionality, validating its behavior with various options and scenarios.
-
-- makeFixture · function · L17-L26 — Creates a temporary directory with a sample TypeScript file for testing purposes.
-- stampCrux · function · L44-L50 — Updates the wiring.json file to include a crux for the specified node, allowing for inlined source retrieval.
-- qualifiedFixture · function · L190-L208 — Sets up a temporary directory with a cache implementation to test structural resolution of function calls.
-- multiScopeFixture · function · L277-L310 — function multiScopeFixture(): string
-- crossSeamMonorepoFixture · function · L346-L387 — function crossSeamMonorepoFixture(): string
-- siblingPrefixFixture · function · L417-L424 — function siblingPrefixFixture(): string
-- idfShiftFixture · function · L451-L462 — function idfShiftFixture(): string
-- rankOf · function · L469-L469 — rankOf = (r: ReturnType<typeof ask>["hits"], title: string)
-- duplicateNameFixture · function · L636-L651 — function duplicateNameFixture(): string
diff --git a/graft/test/claude-format.test.md b/graft/test/claude-format.test.md
deleted file mode 100644
index bcb22cfd..00000000
--- a/graft/test/claude-format.test.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# test/claude-format.test.ts · [[testing-and-validation]]
-
-This test suite verifies the functionality of various formatting and retrieval functions related to the status line and enriched segments in a codebase, ensuring correct rendering based on different states and inputs.
-
-- strip · function · L6-L6 — Removes ANSI escape codes from a string to ensure clean output for assertions.
-- gateAsk · function · L97-L104 — Creates a structured query object for testing relevant retrieval functionality with customizable parameters.
-- freshSession · function · L105-L105 — Initializes a fresh session state for testing the relevant retrieval process.
diff --git a/graft/test/claude-hooks.test.md b/graft/test/claude-hooks.test.md
deleted file mode 100644
index c334f08a..00000000
--- a/graft/test/claude-hooks.test.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# test/claude-hooks.test.ts · [[testing-and-validation]]
-
-This file contains tests for the functionality of the graft hooks in the Claude project, ensuring that edits are detected and state is managed correctly.
-
-- runWithStdin · function · L39-L42 — This function sets up the environment to run a given asynchronous function with specified input from stdin, managing the environment variable for the duration of the execution.
-- fakeBuild · function · L85-L88 — This function simulates a build process by writing a mock wiring.json file to the specified directory, allowing tests to verify behavior based on the build output.
-- writeMultiScopeWiring · function · L127-L146 — function writeMultiScopeWiring(d: string): void
-- writeAskArgsStub · function · L248-L259 — function writeAskArgsStub(d: string): { stub: string; argsFile: string }
diff --git a/graft/test/claude-init.test.md b/graft/test/claude-init.test.md
deleted file mode 100644
index 478fb9b6..00000000
--- a/graft/test/claude-init.test.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# test/claude-init.test.ts · [[testing-and-validation]]
-
-This file contains tests for the initialization logic of the graft system, ensuring that settings and skills are correctly scaffolded and managed during the initialization process.
-
-- fresh · function · L10-L10 — Creates a fresh temporary directory for testing purposes, ensuring isolation between test runs.
-- runPostinstall · function · L12-L17 — Executes the post-installation script, which sets up necessary configurations after the main initialization process.
-- col · function · L116-L116 — Determines the column alignment for specific text markers in the output, ensuring consistent formatting in the display.
diff --git a/graft/test/claude-paths.test.md b/graft/test/claude-paths.test.md
deleted file mode 100644
index f2ed5485..00000000
--- a/graft/test/claude-paths.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/claude-paths.test.ts · [[testing-and-validation]]
-
-This test file verifies that the paths for the graft CLI and Claude script are correctly resolved relative to the module structure, ensuring they are independent of the current working directory.
-
-_No extracted symbols in this file._
diff --git a/graft/test/claude-settings-merge.test.md b/graft/test/claude-settings-merge.test.md
deleted file mode 100644
index cf2714f3..00000000
--- a/graft/test/claude-settings-merge.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/claude-settings-merge.test.ts · [[testing-and-validation]]
-
-This test suite verifies the behavior of merging Graft settings, ensuring that defaults are applied correctly, existing configurations are preserved, and no duplicates are introduced during re-initialization.
-
-_No extracted symbols in this file._
diff --git a/graft/test/claude-shim-template.test.md b/graft/test/claude-shim-template.test.md
deleted file mode 100644
index 314aaecf..00000000
--- a/graft/test/claude-shim-template.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/claude-shim-template.test.ts · [[testing-and-validation]]
-
-This test file validates the behavior of the statusline and hooks shims to ensure they correctly parse and resolve module paths in a Node.js environment.
-
-_No extracted symbols in this file._
diff --git a/graft/test/claude-skill-template.test.md b/graft/test/claude-skill-template.test.md
deleted file mode 100644
index 9139dc1f..00000000
--- a/graft/test/claude-skill-template.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/claude-skill-template.test.ts · [[testing-and-validation]]
-
-This test ensures that the generated skill template adheres to the expected format and contains the necessary components for functionality.
-
-_No extracted symbols in this file._
diff --git a/graft/test/claude-state.test.md b/graft/test/claude-state.test.md
deleted file mode 100644
index 4f75b8c4..00000000
--- a/graft/test/claude-state.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/claude-state.test.ts · [[testing-and-validation]]
-
-This test suite verifies the functionality of state management, including stats and session handling, as well as lock acquisition and release mechanisms.
-
-- fresh · function · L11-L11 — Generates a unique temporary directory for testing purposes to ensure isolation between test cases.
diff --git a/graft/test/claude-stats.test.md b/graft/test/claude-stats.test.md
deleted file mode 100644
index 40bef4f8..00000000
--- a/graft/test/claude-stats.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/claude-stats.test.ts · [[testing-and-validation]]
-
-This test file verifies the functionality of the computeStats function to ensure it accurately calculates node and edge counts, as well as the count of ready nodes from a given wiring structure.
-
-_No extracted symbols in this file._
diff --git a/graft/test/claude-statusline.test.md b/graft/test/claude-statusline.test.md
deleted file mode 100644
index 1108701d..00000000
--- a/graft/test/claude-statusline.test.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# test/claude-statusline.test.ts · [[testing-and-validation]]
-
-This file contains tests for the resolveStats function, ensuring it correctly retrieves and prioritizes cached statistics or falls back to graph data as needed.
-
-- repo · function · L9-L9 — Creates a temporary directory for testing purposes, ensuring a clean environment for each test run.
-- writeWiring · function · L10-L13 — Writes a wiring.json file to a specified directory, setting up the necessary structure for graph data in tests.
diff --git a/graft/test/cli-meta.test.md b/graft/test/cli-meta.test.md
deleted file mode 100644
index 714fc572..00000000
--- a/graft/test/cli-meta.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/cli-meta.test.ts · [[testing-and-validation]]
-
-This file contains tests for formatting version and upgrade reports, resolving package.json paths, reading the current version, and detecting if a script is running via npx, ensuring correct behavior of the CLI meta functionalities.
-
-_No extracted symbols in this file._
diff --git a/graft/test/context.test.md b/graft/test/context.test.md
deleted file mode 100644
index ee9bfb9a..00000000
--- a/graft/test/context.test.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# test/context.test.ts · [[testing-and-validation]]
-
-This file contains end-to-end tests for the markdown-graph pipeline, ensuring that the initialization and checking processes work correctly with various scenarios.
-
-- runCli · function · L19-L30 — This function executes a command-line interface (CLI) command and captures its output, allowing tests to verify the behavior of the CLI under different conditions.
-- makeFixture · function · L32-L43 — This function creates a temporary directory with mock service files for testing the context building process.
-- buildOpts · function · L45-L47 — This function generates options for building the context, including a fake model and providers.
diff --git a/graft/test/covers.test.md b/graft/test/covers.test.md
deleted file mode 100644
index 7ec95bb4..00000000
--- a/graft/test/covers.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/covers.test.ts · [[testing-and-validation]]
-
-This test suite verifies that the wiring build correctly populates the 'covers' field in concept nodes and maintains stability across builds.
-
-- makeFixture · function · L16-L24 — Creates a temporary directory with a sample TypeScript file for testing the wiring build.
diff --git a/graft/test/graph-bindings.test.md b/graft/test/graph-bindings.test.md
deleted file mode 100644
index ea7e6d9b..00000000
--- a/graft/test/graph-bindings.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/graph-bindings.test.ts · [[testing-and-validation]]
-
-This file contains tests that validate the behavior of type bindings in different programming languages' code snippets.
-
-- callEdges · function · L5-L7 — This function extracts call edges from source code based on the specified programming language, filtering for 'calls' relations.
diff --git a/graft/test/graph-go.test.md b/graft/test/graph-go.test.md
deleted file mode 100644
index 8fb8cba8..00000000
--- a/graft/test/graph-go.test.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# test/graph-go.test.ts · [[testing-and-validation]]
-
-This file contains tests for verifying the extraction of Go code structures and their relationships in a code graph.
-
-- makeFixture · function · L53-L60 — Creates a temporary Go module directory with necessary files for testing graph extraction.
-- nodeById · function · L62-L64 — Retrieves a node from the graph by its unique identifier, facilitating graph traversal and assertions in tests.
diff --git a/graft/test/graph-load.test.md b/graft/test/graph-load.test.md
deleted file mode 100644
index 64fd1a27..00000000
--- a/graft/test/graph-load.test.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# test/graph-load.test.ts · [[testing-and-validation]]
-
-This file contains tests for caching mechanisms in the graph loading functionality to improve performance by avoiding unnecessary re-parsing of files.
-
-- node · function · L23-L38 — Creates a node representation for the graph with specified properties, facilitating the construction of graph structures in tests.
-- fixtureDir · function · L40-L42 — Generates a temporary directory for use in tests, ensuring isolation and preventing interference between test cases.
-- bump · function · L46-L50 — Updates the modification time of a file to ensure that caching mechanisms recognize changes, preventing stale data usage.
diff --git a/graft/test/graph-map.test.md b/graft/test/graph-map.test.md
deleted file mode 100644
index 7c9cd799..00000000
--- a/graft/test/graph-map.test.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# test/graph-map.test.ts · [[testing-and-validation]]
-
-This file contains tests for the `buildRepoMap` and `formatRepoMap` functions, ensuring they correctly process and format repository data.
-
-- fileNode · function · L16-L31 — Creates a file node representation for the graph, encapsulating file metadata for processing.
-- symNode · function · L33-L49 — Generates a symbol node representation for the graph, allowing for the inclusion of function or variable symbols with associated metadata.
-- edge · function · L51-L53 — Defines a connection between two nodes in the graph, representing relationships such as function calls.
-- graphOf · function · L55-L61 — Constructs a graph structure from nodes and edges, serving as the foundational data for repository mapping.
-- graphOfWithScopes · function · L66-L70 — function graphOfWithScopes(nodes: NodeV1[], edges: EdgeV1[], scopes: ScopeV1[]): GraphV1
-- twoScopeFixture · function · L287-L302 — function twoScopeFixture(): GraphV1
-- bigFixture · function · L419-L438 — Creates a large fixture graph for testing, simulating a repository with multiple directories and symbols.
diff --git a/graft/test/graph-resolve-typed.test.md b/graft/test/graph-resolve-typed.test.md
deleted file mode 100644
index bfb0f460..00000000
--- a/graft/test/graph-resolve-typed.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/graph-resolve-typed.test.ts · [[testing-and-validation]]
-
-This test file verifies the resolution of method calls and inheritance in a graph of nodes representing code elements, ensuring correct behavior in various scenarios.
-
-- n · function · L6-L10 — Creates a NodeV1 object representing a code element with its associated metadata, facilitating the construction of a node graph for resolution tests.
diff --git a/graft/test/graph-scopes.test.md b/graft/test/graph-scopes.test.md
deleted file mode 100644
index f68eb62c..00000000
--- a/graft/test/graph-scopes.test.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# test/graph-scopes.test.ts
-
-- fx · function · L17-L24 — function fx(layout: Record<string, string>): string
-- run · function · L75-L89 — run = (siblingName: string): string[]
-- normalize · function · L93-L94 — normalize = (prefixes: string[], siblingName: string): string[]
-- tsFns · function · L155-L157 — function tsFns(n: number): string
-- pyFns · function · L159-L161 — function pyFns(n: number): string
diff --git a/graft/test/graph-traverse-cli.test.md b/graft/test/graph-traverse-cli.test.md
deleted file mode 100644
index fb87e227..00000000
--- a/graft/test/graph-traverse-cli.test.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# test/graph-traverse-cli.test.ts · [[testing-and-validation]]
-
-This file contains tests for the CLI commands related to graph traversal, ensuring correct functionality and output for various scenarios.
-
-- builtRepo · function · L17-L28 — Sets up a temporary repository with a sample math module for testing CLI commands.
-- runCli · function · L30-L41 — Executes the CLI command with given arguments and captures the output and status code.
diff --git a/graft/test/graph-traverse.test.md b/graft/test/graph-traverse.test.md
deleted file mode 100644
index 076dc66c..00000000
--- a/graft/test/graph-traverse.test.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# test/graph-traverse.test.ts · [[graph-traversal-and-impact-analysis]]
-
-Contains tests for graph traversal functionalities, ensuring correct symbol resolution and edge walking behavior.
-
-- nodeStub · function · L15-L30 — Creates a stub node for testing purposes, encapsulating essential properties of a NodeV1 object.
-- edge · function · L32-L34 — Constructs an edge between two nodes in the graph, defining their relationship type.
-- graphOf · function · L36-L42 — Generates a graph structure from an array of nodes and edges, encapsulating metadata about the graph.
-- baseGraph · function · L57-L66 — Creates a base graph fixture used for testing symbol resolution and edge walking.
-- diamondGraph · function · L167-L179 — Constructs a diamond-shaped graph for testing the impact of nodes based on incoming edges.
-- fileAndSymbolGraph · function · L221-L231 — Creates a graph that includes both file and symbol nodes to test their interactions in dependency resolution.
diff --git a/graft/test/graph-write.test.md b/graft/test/graph-write.test.md
deleted file mode 100644
index 1f7cb960..00000000
--- a/graft/test/graph-write.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/graph-write.test.ts · [[graph-data-integrity]] [[graph-serialization]]
-
-This file contains tests to ensure that the `writeGraph` function correctly handles the serialization of graph nodes, specifically that the `body_text` field is omitted when unnecessary, while preserving other fields and the integrity of the original node object.
-
-- makeNode · function · L19-L35 — Creates a node object with default properties, allowing for optional overrides, to facilitate testing of graph serialization and deserialization.
diff --git a/graft/test/graphrank.test.md b/graft/test/graphrank.test.md
deleted file mode 100644
index 4ff32449..00000000
--- a/graft/test/graphrank.test.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# test/graphrank.test.ts · [[graph-ranking]]
-
-This file contains unit and integration tests for the personalizedPageRank function, ensuring it correctly ranks nodes based on their connectivity in a graph.
-
-- node · function · L23-L38 — Creates a node representation for the graph with specified properties.
-- edge · function · L39-L41 — Defines an edge between two nodes in the graph, establishing a relationship.
-- graphOf · function · L42-L48 — Constructs a graph object from given nodes and edges, encapsulating their relationships.
-- makeCollisionFixture · function · L182-L192 — Sets up a temporary file structure to simulate a collision scenario for testing graph ranking.
-- rank · function · L194-L195 — Executes the ask function with specified parameters to retrieve ranked results based on graph connectivity.
diff --git a/graft/test/helpers.md b/graft/test/helpers.md
deleted file mode 100644
index a991e067..00000000
--- a/graft/test/helpers.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# test/helpers.ts · [[deterministic-testing]] [[test-helpers]]
-
-This file provides test doubles for offline, deterministic testing of components without external dependencies.
-
-- PassthroughSummarizer · class · L9-L13 — This class serves as a no-op summarizer that returns the input code unchanged for controlled testing.
-- summarize · method · L10-L12 — This method returns the input code as-is, allowing tests to control the output precisely.
-- BracketSynthesizer · class · L21-L50 — This class synthesizes a graph structure from simple markup, enabling tests to define the relationships between nodes explicitly.
-- synthesize · method · L22-L49 — This method processes file summaries to create a structured representation of nodes and their relationships based on markup.
-- ensure · function · L24-L31 — This function ensures that a node exists in the map, creating it if necessary, to maintain the graph structure.
-- fakeProviders · function · L52-L54 — This function creates and returns instances of the test doubles for summarization and synthesis.
diff --git a/graft/test/hosts-codex-hooks.test.md b/graft/test/hosts-codex-hooks.test.md
deleted file mode 100644
index 2924f492..00000000
--- a/graft/test/hosts-codex-hooks.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/hosts-codex-hooks.test.ts · [[host-configuration-management]]
-
-This test suite verifies the behavior of the installCodexHooks function, ensuring it correctly manages hook installations and configurations in various scenarios.
-
-- fresh · function · L8-L8 — Generates a unique temporary directory for testing purposes.
diff --git a/graft/test/hosts-init.test.md b/graft/test/hosts-init.test.md
deleted file mode 100644
index c7eef444..00000000
--- a/graft/test/hosts-init.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/hosts-init.test.ts · [[host-configuration-management]] [[idempotent-host-initialization]]
-
-This test suite verifies the behavior of the runHostsInit function in various scenarios, ensuring it correctly handles host initialization, agent detection, and configuration management.
-
-- fresh · function · L9-L9 — Generates a unique temporary directory for testing purposes to avoid conflicts between test runs.
diff --git a/graft/test/hosts-instructions.test.md b/graft/test/hosts-instructions.test.md
deleted file mode 100644
index 43219d4d..00000000
--- a/graft/test/hosts-instructions.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/hosts-instructions.test.ts
-
-This test suite verifies the structure and content of various instruction bodies to ensure they meet specified formatting and inclusion criteria.
-
-_No extracted symbols in this file._
diff --git a/graft/test/hosts-mcp-config.test.md b/graft/test/hosts-mcp-config.test.md
deleted file mode 100644
index ed8ed191..00000000
--- a/graft/test/hosts-mcp-config.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/hosts-mcp-config.test.ts · [[host-configuration-management]]
-
-This test suite verifies the behavior of the registerMcpConfigs function in handling various configurations and edge cases.
-
-- fresh · function · L8-L8 — Generates a fresh temporary directory for testing purposes.
diff --git a/graft/test/hosts-registry.test.md b/graft/test/hosts-registry.test.md
deleted file mode 100644
index 6f1dadee..00000000
--- a/graft/test/hosts-registry.test.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# test/hosts-registry.test.ts · [[host-configuration-management]]
-
-This file contains tests for the hosts registry functionality, ensuring that the correct hosts are detected based on the presence of specific directories.
-
-- probeFor · function · L9-L14 — Creates a probe object that checks for the existence of a directory, facilitating host detection based on the file system state.
-- fresh · function · L15-L15 — Generates a temporary directory for testing purposes, ensuring a clean environment for each test case.
diff --git a/graft/test/hosts-sections.test.md b/graft/test/hosts-sections.test.md
deleted file mode 100644
index a98b0386..00000000
--- a/graft/test/hosts-sections.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/hosts-sections.test.ts · [[host-configuration-management]]
-
-This file contains tests for the upsertSection function, ensuring it correctly creates, appends, replaces, and reports on sections in markdown files.
-
-- fresh · function · L8-L8 — Generates a fresh temporary directory for testing purposes.
diff --git a/graft/test/llm-adapters.test.md b/graft/test/llm-adapters.test.md
deleted file mode 100644
index c33bbc62..00000000
--- a/graft/test/llm-adapters.test.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# test/llm-adapters.test.ts
-
-This file contains tests for network-free adapters that simulate interactions with OpenAI and Anthropic SDKs, ensuring correct request handling and response formatting.
-
-- fakeOpenAI · function · L17-L23 — Creates a mock OpenAI client for testing purposes, allowing assertions on the parameters sent to it.
-- openAiResp · function · L25-L31 — Generates a mock response structure for OpenAI API calls, facilitating the testing of response handling.
-- fakeAnthropic · function · L119-L125 — Creates a mock Anthropic client for testing purposes, enabling verification of the parameters it receives.
-- anthropicResp · function · L127-L134 — Generates a mock response structure for Anthropic API calls, aiding in the testing of response processing.
diff --git a/graft/test/llm-ops.test.md b/graft/test/llm-ops.test.md
deleted file mode 100644
index eb668d86..00000000
--- a/graft/test/llm-ops.test.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# test/llm-ops.test.ts
-
-Tests the behavior of three engine operations (summarize, synthesize, crux) using a fake transport to ensure they build the correct requests and handle responses appropriately.
-
-- FakeChatModel · class · L15-L29 — Simulates a chat model to test the behavior of chat operations without network dependency.
-- constructor · method · L18-L18 — Initializes the fake chat model with a predefined reply for testing purposes.
-- create · method · L19-L28 — Processes a chat request and returns a simulated chat response based on predefined data.
diff --git a/graft/test/mcp-server.test.md b/graft/test/mcp-server.test.md
deleted file mode 100644
index bd79793c..00000000
--- a/graft/test/mcp-server.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/mcp-server.test.ts · [[mcp-server-and-tools]]
-
-This file contains tests for the RPC functionality of the MCP server, ensuring that various methods return expected results and handle errors correctly.
-
-- rpc · function · L9-L28 — The rpc function facilitates communication with the MCP server by sending messages and collecting responses, handling asynchronous interactions effectively.
diff --git a/graft/test/mcp-tools.test.md b/graft/test/mcp-tools.test.md
deleted file mode 100644
index 86459f31..00000000
--- a/graft/test/mcp-tools.test.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# test/mcp-tools.test.ts · [[mcp-server-and-tools]]
-
-This test suite validates the functionality of various tools in the MCP codebase, ensuring they operate correctly on built repositories and handle errors appropriately.
-
-- builtRepo · function · L9-L16 — Creates a temporary repository structure for testing the tools with a basic math implementation.
-- chainRepo · function · L22-L33 — Sets up a repository with a three-deep function call structure to test depth-related functionality in tools.
-- customDirRepo · function · L37-L45 — Establishes a repository in a custom directory to validate the handling of non-default graph locations.
-- fileScopeRepo · function · L50-L60 — Creates a repository to test the interaction between file imports and function calls across files.
-- multiDirRepo · function · L65-L73 — Generates a repository with multiple directories to test the handling of directory limits in tool operations.
diff --git a/graft/test/regression-single-repo.test.md b/graft/test/regression-single-repo.test.md
deleted file mode 100644
index 3f22ce2d..00000000
--- a/graft/test/regression-single-repo.test.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# test/regression-single-repo.test.ts
-
-- fx · function · L27-L34 — function fx(layout: Record<string, string>): string
-- assertScopeFreeText · function · L71-L77 — function assertScopeFreeText(label: string, text: string)
diff --git a/graft/test/savings.test.md b/graft/test/savings.test.md
deleted file mode 100644
index 353b5df3..00000000
--- a/graft/test/savings.test.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# test/savings.test.ts
-
-- fileNode · function · L10-L26 — function fileNode(path: string, chars?: number): NodeV1
-- graphOf · function · L28-L30 — function graphOf(nodes: NodeV1[]): GraphV1
diff --git a/graft/test/search-grep.test.md b/graft/test/search-grep.test.md
deleted file mode 100644
index e5296731..00000000
--- a/graft/test/search-grep.test.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# test/search-grep.test.ts
-
-Contains core tests for the `graft grep` functionality, ensuring accurate symbol attribution and search results in a parsed graph.
-
-- fileNode · function · L24-L39 — Creates a file node representation for a given path and number of lines, facilitating graph construction.
-- graphOf · function · L41-L43 — Constructs a graph representation from nodes and edges, encapsulating metadata about the graph structure.
-- needleRepo · function · L50-L85 — Sets up a temporary repository with TypeScript files to test the grep functionality, simulating real-world usage scenarios.
-- loadBuiltGraph · function · L87-L91 — Loads a built graph from a specified repository, ensuring the graph is correctly constructed for testing.
diff --git a/graft/test/viz-assemble.test.md b/graft/test/viz-assemble.test.md
deleted file mode 100644
index 7a777d4b..00000000
--- a/graft/test/viz-assemble.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/viz-assemble.test.ts
-
-This file contains tests that validate the assembly of a context graph from markdown frontmatter, ensuring proper relation normalization and error handling for malformed files.
-
-- makeContextDir · function · L12-L60 — This function creates a temporary directory with markdown files to simulate context data for testing the graph assembly.
diff --git a/graft/test/viz-serve.test.md b/graft/test/viz-serve.test.md
deleted file mode 100644
index 0082dc18..00000000
--- a/graft/test/viz-serve.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/viz-serve.test.ts
-
-This file contains tests for the viz server, ensuring it serves the correct endpoints and handles various scenarios like port fallback and context directory changes.
-
-- makeDirs · function · L13-L27 — This function creates necessary directory structures and files for testing the viz server.
diff --git a/graft/test/workspace.test.md b/graft/test/workspace.test.md
deleted file mode 100644
index 748a5dbc..00000000
--- a/graft/test/workspace.test.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# test/workspace.test.ts
-
-- workspaceFx · function · L26-L37 — function workspaceFx(children: Record<string, Record<string, string>>): string
-- buildWorkspace · function · L40-L44 — async function buildWorkspace(parent: string): Promise<{ children: string[]; migrated: boolean }>
-- pad · function · L53-L57 — function pad(n: number): string
diff --git a/graft/testing-and-validation.md b/graft/testing-and-validation.md
deleted file mode 100644
index c10dc635..00000000
--- a/graft/testing-and-validation.md
+++ /dev/null
@@ -1,212 +0,0 @@
----
-name: Testing and Validation
-slug: testing-and-validation
-type: system
-sources:
- - path: test/ask-index.test.ts
- hash: c9cd7c011ebd661f35488c59dcd34801079f2786d56e96833f4da7c45dfa37d7
- - path: test/ask.test.ts
- hash: 3445f8b156ba6b2f0e9123e9fc45781da352ec6d5baeb985ee144fe5aecaafb3
- - path: test/claude-format.test.ts
- hash: cfaa9f489dd95956e3c9917ebe29a46992dfdbab943b5971eecbd98f18b3268c
- - path: test/claude-hooks.test.ts
- hash: 875c10776da455499b58ebe861b3cb0ae797f751e4e838812cd0b4f3c13587c2
- - path: test/claude-init.test.ts
- hash: b582cd79b2a1e4952ff83ac1b2e85f742756443c2896e08d96a75dc76e2971a5
- - path: test/claude-paths.test.ts
- hash: 205740f8110e72e4cb24652c09f763fad5e056dc77776bcfa95a1953731ed2c8
- - path: test/claude-settings-merge.test.ts
- hash: 4c8b800f02d1b72050082bdbcdcda0878e5d9760563d2e1ca4a31cb06ffaaabb
- - path: test/claude-shim-template.test.ts
- hash: f787f99fef2dc6a5ed366419fc470e8e4f825e0bc590cf3550d39e01995e7619
- - path: test/claude-skill-template.test.ts
- hash: 49f60183a51f9c307a33b5d4da3a7ded2f55509407e6a85778f3512b27db7cde
- - path: test/claude-state.test.ts
- hash: 78e6a81af7642ea788072457ea181bc626c7a8a898cfebb882ab42fed7e9dd2e
- - path: test/claude-stats.test.ts
- hash: f625d026d152a65017699e37e27534043dc0af0f43ba2d3ea778bac8ddab82c3
- - path: test/claude-statusline.test.ts
- hash: 07128b5b195af3a37c1e170a35c18378e36160d1a6f8e17be362bac315811cac
- - path: test/cli-meta.test.ts
- hash: e7a05bf838e876a317276f94a26d92b0b1526e1ea7eabda4e68b804bdb0334e5
- - path: test/context.test.ts
- hash: 126861c136d48ed6a148e50226c96ec2935c52cf83ef56fbd43392e0d271db1f
- - path: test/covers.test.ts
- hash: f5a75f405be1a01ad43fc806588858df3a8988fee62ad4ec024440d3f5e0fc0c
- - path: test/graph-bindings.test.ts
- hash: b6892b1b6982547fc67d5b0e7812a536e47018ab3e38e4eda35a0f12f24ab8db
- - path: test/graph-go.test.ts
- hash: bf11085a7edb03c00d52dca090af9c1ca4eb3cb34bb88904bbdd478171d3483d
- - path: test/graph-load.test.ts
- hash: 8df11988d049b5243d8c7a0d55045163b714965897448797b40c8ef458b0896b
- - path: test/graph-map.test.ts
- hash: 97c06030735d5dbb15270b73a594e1de8fb3ffba5c6551b6303a5357b8da31be
- - path: test/graph-resolve-typed.test.ts
- hash: 0c3760525cc61ee97de448fa26b4a5b9a3bb07c03b4acfbdf3608541b189cf81
- - path: test/graph-traverse-cli.test.ts
- hash: d79347b0640178631235552105c0518029305ead4990726470d3adf5a1b52f09
-sources_digest: ec26f442eeea6bac55ed94939624004883ed25f71e6271fccd772f42743774f0
-links:
- - to: graph-extraction-and-loading
- relation: validates
- description: It validates the extraction and loading functionalities.
- - to: graph-traversal-and-analysis
- relation: validates
- description: It ensures that traversal and analysis functions perform correctly.
- - to: host-management-and-configuration
- relation: validates
- description: It tests the configuration and initialization processes for hosts.
-generator:
- version: 1
-covers:
- - symbol: makeFixture
- kind: function
- at: 'test/ask-index.test.ts:L26-L50'
- - symbol: reinjectBodyText
- kind: function
- at: 'test/ask-index.test.ts:L69-L85'
- - symbol: sortPairs
- kind: function
- at: 'test/ask-index.test.ts:L106-L106'
- - symbol: makeFixture
- kind: function
- at: 'test/ask.test.ts:L17-L26'
- - symbol: stampCrux
- kind: function
- at: 'test/ask.test.ts:L44-L50'
- - symbol: qualifiedFixture
- kind: function
- at: 'test/ask.test.ts:L190-L208'
- - symbol: multiScopeFixture
- kind: function
- at: 'test/ask.test.ts:L277-L310'
- - symbol: crossSeamMonorepoFixture
- kind: function
- at: 'test/ask.test.ts:L346-L387'
- - symbol: siblingPrefixFixture
- kind: function
- at: 'test/ask.test.ts:L417-L424'
- - symbol: idfShiftFixture
- kind: function
- at: 'test/ask.test.ts:L451-L462'
- - symbol: rankOf
- kind: function
- at: 'test/ask.test.ts:L469-L469'
- - symbol: duplicateNameFixture
- kind: function
- at: 'test/ask.test.ts:L636-L651'
- - symbol: strip
- kind: function
- at: 'test/claude-format.test.ts:L6-L6'
- - symbol: gateAsk
- kind: function
- at: 'test/claude-format.test.ts:L97-L104'
- - symbol: freshSession
- kind: function
- at: 'test/claude-format.test.ts:L105-L105'
- - symbol: runWithStdin
- kind: function
- at: 'test/claude-hooks.test.ts:L39-L42'
- - symbol: fakeBuild
- kind: function
- at: 'test/claude-hooks.test.ts:L85-L88'
- - symbol: writeMultiScopeWiring
- kind: function
- at: 'test/claude-hooks.test.ts:L127-L146'
- - symbol: writeAskArgsStub
- kind: function
- at: 'test/claude-hooks.test.ts:L248-L259'
- - symbol: fresh
- kind: function
- at: 'test/claude-init.test.ts:L10-L10'
- - symbol: runPostinstall
- kind: function
- at: 'test/claude-init.test.ts:L12-L17'
- - symbol: col
- kind: function
- at: 'test/claude-init.test.ts:L116-L116'
- - symbol: fresh
- kind: function
- at: 'test/claude-state.test.ts:L11-L11'
- - symbol: repo
- kind: function
- at: 'test/claude-statusline.test.ts:L9-L9'
- - symbol: writeWiring
- kind: function
- at: 'test/claude-statusline.test.ts:L10-L13'
- - symbol: runCli
- kind: function
- at: 'test/context.test.ts:L19-L30'
- - symbol: makeFixture
- kind: function
- at: 'test/context.test.ts:L32-L43'
- - symbol: buildOpts
- kind: function
- at: 'test/context.test.ts:L45-L47'
- - symbol: makeFixture
- kind: function
- at: 'test/covers.test.ts:L16-L24'
- - symbol: callEdges
- kind: function
- at: 'test/graph-bindings.test.ts:L5-L7'
- - symbol: makeFixture
- kind: function
- at: 'test/graph-go.test.ts:L53-L60'
- - symbol: nodeById
- kind: function
- at: 'test/graph-go.test.ts:L62-L64'
- - symbol: node
- kind: function
- at: 'test/graph-load.test.ts:L23-L38'
- - symbol: fixtureDir
- kind: function
- at: 'test/graph-load.test.ts:L40-L42'
- - symbol: bump
- kind: function
- at: 'test/graph-load.test.ts:L46-L50'
- - symbol: fileNode
- kind: function
- at: 'test/graph-map.test.ts:L16-L31'
- - symbol: symNode
- kind: function
- at: 'test/graph-map.test.ts:L33-L49'
- - symbol: edge
- kind: function
- at: 'test/graph-map.test.ts:L51-L53'
- - symbol: graphOf
- kind: function
- at: 'test/graph-map.test.ts:L55-L61'
- - symbol: graphOfWithScopes
- kind: function
- at: 'test/graph-map.test.ts:L66-L70'
- - symbol: twoScopeFixture
- kind: function
- at: 'test/graph-map.test.ts:L287-L302'
- - symbol: bigFixture
- kind: function
- at: 'test/graph-map.test.ts:L419-L438'
- - symbol: 'n'
- kind: function
- at: 'test/graph-resolve-typed.test.ts:L6-L10'
- - symbol: builtRepo
- kind: function
- at: 'test/graph-traverse-cli.test.ts:L17-L28'
- - symbol: runCli
- kind: function
- at: 'test/graph-traverse-cli.test.ts:L30-L41'
----
-<!-- context:generated:start -->
-## Summary
-
-This component encompasses various test suites designed to validate the functionality and reliability of the Graft system, ensuring that all components work as intended and that changes do not introduce regressions. It includes tests for extraction, loading, traversal, and host management.
-
-## Related
-
-- validates [[graph-extraction-and-loading]] — It validates the extraction and loading functionalities.
-- validates [[graph-traversal-and-analysis]] — It ensures that traversal and analysis functions perform correctly.
-- validates [[host-management-and-configuration]] — It tests the configuration and initialization processes for hosts.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/token-a-b-testing.md b/graft/token-a-b-testing.md
deleted file mode 100644
index c6569fec..00000000
--- a/graft/token-a-b-testing.md
+++ /dev/null
@@ -1,56 +0,0 @@
----
-name: Token A/B Testing
-slug: token-a-b-testing
-type: system
-sources:
- - path: bench/token-ab.ts
- hash: b033a023d063cccc329103fbd11d4e1a6ab16c5eb027e1dd85c47a63a7df4ff1
-sources_digest: 12c7bde30c776e231fe85e67e20d88c3b691c854a45b9bc463502f489874cdf7
-links:
- - to: agent
- relation: uses
- description: The A/B testing harness evaluates the agent's performance.
-generator:
- version: 1
-covers:
- - symbol: Metrics
- kind: interface
- at: 'bench/token-ab.ts:L55-L64'
- - symbol: runSearch
- kind: function
- at: 'bench/token-ab.ts:L98-L128'
- - symbol: runRead
- kind: function
- at: 'bench/token-ab.ts:L130-L147'
- - symbol: runAgent
- kind: function
- at: 'bench/token-ab.ts:L150-L207'
- - symbol: graftPack
- kind: function
- at: 'bench/token-ab.ts:L210-L221'
- - symbol: cost
- kind: function
- at: 'bench/token-ab.ts:L223-L227'
- - symbol: row
- kind: function
- at: 'bench/token-ab.ts:L229-L231'
- - symbol: main
- kind: function
- at: 'bench/token-ab.ts:L233-L273'
- - symbol: pct
- kind: function
- at: 'bench/token-ab.ts:L253-L253'
----
-<!-- context:generated:start -->
-## Summary
-
-This component implements a manual A/B testing harness to compare token usage between two evaluation arms of the agent, providing insights into the efficiency of different approaches in answering coding-related questions.
-
-## Related
-
-- uses [[agent]] — The A/B testing harness evaluates the agent's performance.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/user-interaction-in-visualization.md b/graft/user-interaction-in-visualization.md
deleted file mode 100644
index 95bcba7f..00000000
--- a/graft/user-interaction-in-visualization.md
+++ /dev/null
@@ -1,158 +0,0 @@
----
-name: User Interaction in Visualization
-slug: user-interaction-in-visualization
-type: concept
-sources:
- - path: viewer/detail.ts
- hash: fe8df7c5561f2a8588cf4e1ecb367d19cb6b480fe4855f05e4f96137d8078884
- - path: viewer/graph.ts
- hash: 192a59b16da8327457de6723893fd9207dd9570a35cd664f96534a7b85e73e01
- - path: viewer/main.ts
- hash: ab45ce4dfe66aafbe779b71d49d6370b3fe64482307b994e857ce34d3f317325
-sources_digest: 949fbcf087492dc70392ec9143ab9070d6c27e57720cbb7fa1b4324d473e7423
-links:
- - to: graph-visualization
- relation: implements
- description: >-
- User interactions must be effectively managed to enhance the overall
- experience of exploring the graph.
-generator:
- version: 1
-covers:
- - symbol: esc
- kind: function
- at: 'viewer/detail.ts:L8-L10'
- - symbol: renderDetail
- kind: function
- at: 'viewer/detail.ts:L12-L58'
- - symbol: name
- kind: function
- at: 'viewer/detail.ts:L29-L29'
- - symbol: linkList
- kind: function
- at: 'viewer/detail.ts:L40-L50'
- - symbol: SimNode
- kind: interface
- at: 'viewer/graph.ts:L22-L30'
- - symbol: SimEdge
- kind: interface
- at: 'viewer/graph.ts:L32-L38'
- - symbol: el
- kind: function
- at: 'viewer/graph.ts:L42-L46'
- - symbol: GraphView
- kind: class
- at: 'viewer/graph.ts:L48-L334'
- - symbol: constructor
- kind: method
- at: 'viewer/graph.ts:L65-L69'
- - symbol: buildChrome
- kind: method
- at: 'viewer/graph.ts:L71-L78'
- - symbol: ensureMarkers
- kind: method
- at: 'viewer/graph.ts:L80-L91'
- - symbol: setData
- kind: method
- at: 'viewer/graph.ts:L94-L136'
- - symbol: buildElements
- kind: method
- at: 'viewer/graph.ts:L138-L164'
- - symbol: tick
- kind: method
- at: 'viewer/graph.ts:L166-L182'
- - symbol: restyle
- kind: method
- at: 'viewer/graph.ts:L185-L243'
- - symbol: nodeShown
- kind: function
- at: 'viewer/graph.ts:L195-L195'
- - symbol: select
- kind: method
- at: 'viewer/graph.ts:L245-L249'
- - symbol: focus
- kind: method
- at: 'viewer/graph.ts:L252-L261'
- - symbol: firstMatch
- kind: method
- at: 'viewer/graph.ts:L263-L266'
- - symbol: applyView
- kind: method
- at: 'viewer/graph.ts:L268-L270'
- - symbol: zoomBy
- kind: method
- at: 'viewer/graph.ts:L272-L279'
- - symbol: resetView
- kind: method
- at: 'viewer/graph.ts:L281-L284'
- - symbol: reheat
- kind: method
- at: 'viewer/graph.ts:L286-L288'
- - symbol: bindDrag
- kind: method
- at: 'viewer/graph.ts:L290-L309'
- - symbol: move
- kind: function
- at: 'viewer/graph.ts:L294-L299'
- - symbol: up
- kind: function
- at: 'viewer/graph.ts:L300-L305'
- - symbol: bindPanZoom
- kind: method
- at: 'viewer/graph.ts:L311-L333'
- - symbol: Tab
- kind: type
- at: 'viewer/main.ts:L10-L10'
- - symbol: $
- kind: function
- at: 'viewer/main.ts:L12-L12'
- - symbol: activeGraph
- kind: function
- at: 'viewer/main.ts:L23-L25'
- - symbol: graphTab
- kind: function
- at: 'viewer/main.ts:L27-L29'
- - symbol: renderChips
- kind: function
- at: 'viewer/main.ts:L32-L60'
- - symbol: rank
- kind: function
- at: 'viewer/main.ts:L43-L43'
- - symbol: glyphFor
- kind: function
- at: 'viewer/main.ts:L62-L71'
- - symbol: renderLegend
- kind: function
- at: 'viewer/main.ts:L74-L94'
- - symbol: updateShownCount
- kind: function
- at: 'viewer/main.ts:L96-L101'
- - symbol: updateCounts
- kind: function
- at: 'viewer/main.ts:L103-L112'
- - symbol: showDetail
- kind: function
- at: 'viewer/main.ts:L115-L124'
- - symbol: setTab
- kind: function
- at: 'viewer/main.ts:L129-L167'
- - symbol: showEmpty
- kind: function
- at: 'viewer/main.ts:L169-L173'
- - symbol: loadAll
- kind: function
- at: 'viewer/main.ts:L216-L223'
----
-<!-- context:generated:start -->
-## Summary
-
-This concept addresses the design decisions related to user interactions within the graph visualization, including navigation, selection, and dynamic updates based on user actions.
-
-## Related
-
-- implements [[graph-visualization]] — User interactions must be effectively managed to enhance the overall experience of exploring the graph.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/graft/viewer/data.md b/graft/viewer/data.md
deleted file mode 100644
index 2484009f..00000000
--- a/graft/viewer/data.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# viewer/data.ts · [[graph-visualization]]
-
-This file defines data structures and functions for managing and visualizing graph data from a server.
-
-- VizNode · interface · L6-L12 — Represents a node in the visualization graph, encapsulating its identity and metadata.
-- VizEdge · interface · L14-L20 — Defines the relationship between two nodes in the visualization graph, including its type and description.
-- VizGraph · interface · L22-L26 — Encapsulates the entire visualization graph structure, including its nodes and edges.
-- Family · type · L29-L29 — Categorizes relation verbs into families to enforce consistent semantics in graph relationships.
-- famOf · function · L39-L41 — Determines the family category of a given relation verb, defaulting to 'association' if unknown.
-- chipKey · function · L47-L51 — Generates a key for chip grouping based on the relation verb, simplifying the visualization of relationships.
-- colorToken · function · L72-L75 — Maps a type to its corresponding CSS custom property for styling in the visualization.
-- cvar · function · L77-L79 — Retrieves the value of a CSS custom property from the document's root element.
-- loadContextGraph · function · L81-L84 — Fetches the context graph data from the server and returns it in a structured format.
-- CodeGraphV1 · interface · L86-L93 — Defines the structure of the code graph data received from the server, including nodes and edges.
-- loadCodeGraph · function · L96-L113 — Loads the code graph from the server, filtering out unresolved edges and returning a structured graph.
-- onServerChange · function · L116-L121 — Subscribes to server events to trigger updates in the application when changes occur.
diff --git a/graft/viewer/detail.md b/graft/viewer/detail.md
deleted file mode 100644
index 1f5eba0b..00000000
--- a/graft/viewer/detail.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# viewer/detail.ts · [[graph-visualization]] [[user-interaction-in-visualization]]
-
-This file provides the logic to render a detailed view of a selected node in a graph, including its properties and relationships.
-
-- esc · function · L8-L10 — This function sanitizes a string for safe HTML rendering by escaping special characters.
-- renderDetail · function · L12-L58 — This function renders the details of a selected node, including its type, name, summary, sources, and relationships.
-- name · function · L29-L29 — This function retrieves the name of a node by its ID, providing a fallback if not found.
-- linkList · function · L40-L50 — This function generates HTML for displaying a list of links related to a node, categorized by their relationship type.
diff --git a/graft/viewer/graph.md b/graft/viewer/graph.md
deleted file mode 100644
index be783225..00000000
--- a/graft/viewer/graph.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# viewer/graph.ts · [[graph-visualization]] [[user-interaction-in-visualization]]
-
-This file implements a force-directed graph visualization using D3.js, allowing interactive exploration of nodes and edges.
-
-- SimNode · interface · L22-L30 — Defines the structure of a node in the simulation, including its position and properties.
-- SimEdge · interface · L32-L38 — Defines the structure of an edge in the simulation, representing the relationship between two nodes.
-- el · function · L42-L46 — Creates and returns an SVG element with specified attributes, facilitating dynamic SVG generation.
-- GraphView · class · L48-L334 — Manages the rendering and interaction of the graph view, including node and edge updates.
-- constructor · method · L65-L69 — Initializes the GraphView instance and sets up the SVG environment for rendering.
-- buildChrome · method · L71-L78 — Sets up the initial SVG structure for the graph, including definitions and viewport.
-- ensureMarkers · method · L80-L91 — Ensures that the necessary SVG markers for edges are created and available for rendering.
-- setData · method · L94-L136 — Loads a new dataset into the graph, updating node positions and relationships accordingly.
-- buildElements · method · L138-L164 — Constructs the SVG elements for nodes and edges based on the current dataset.
-- tick · method · L166-L182 — Updates the positions of nodes and edges on each simulation tick, ensuring the graph remains interactive.
-- restyle · method · L185-L243 — Applies styles to nodes and edges based on their visibility and selection state.
-- nodeShown · function · L195-L195 — Determines if a node should be displayed based on its type and visibility settings.
-- select · method · L245-L249 — Selects a node in the graph and updates the visual representation accordingly.
-- focus · method · L252-L261 — Centers the view on a specified node, enhancing its visibility and selection.
-- firstMatch · method · L263-L266 — Finds the first node that matches the current query, facilitating search functionality.
-- applyView · method · L268-L270 — Applies the current view transformation to the graph, adjusting the viewport accordingly.
-- zoomBy · method · L272-L279 — Adjusts the zoom level of the graph view based on user input, allowing for detailed exploration.
-- resetView · method · L281-L284 — Resets the graph view to its initial state, centering and scaling the view.
-- reheat · method · L286-L288 — Restarts the simulation with increased alpha, making the graph more dynamic.
-- bindDrag · method · L290-L309 — Enables dragging functionality for nodes, allowing users to reposition them interactively.
-- move · function · L294-L299 — Handles the movement of a node during drag events, updating its fixed position.
-- up · function · L300-L305 — Finalizes the drag operation by releasing the node's fixed position.
-- bindPanZoom · method · L311-L333 — Sets up event listeners for panning and zooming the graph view based on user interactions.
diff --git a/graft/viewer/main.md b/graft/viewer/main.md
deleted file mode 100644
index 45c79d36..00000000
--- a/graft/viewer/main.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# viewer/main.ts · [[graph-visualization]] [[user-interaction-in-visualization]]
-
-This file serves as the entry point for the graft visualization viewer, managing the user interface and interactions for displaying graphs.
-
-- Tab · type · L10-L10 — Defines the possible tab types for the viewer, ensuring that only valid tab selections are made.
-- $ · function · L12-L12 — Provides a type-safe way to retrieve HTML elements by their ID, enhancing code readability and reducing errors.
-- activeGraph · function · L23-L25 — Determines which graph is currently active based on the selected tab, facilitating the correct data display.
-- graphTab · function · L27-L29 — Identifies the current graph tab, ensuring the correct context is used for rendering and interactions.
-- renderChips · function · L32-L60 — Generates and displays interactive chips for graph edges, allowing users to filter and manage edge visibility.
-- rank · function · L43-L43 — Establishes a ranking system for edge types to ensure they are displayed in a meaningful order.
-- glyphFor · function · L62-L71 — Maps edge types to their corresponding visual glyphs, enhancing the graphical representation of relationships.
-- renderLegend · function · L74-L94 — Creates a legend for node types in the graph, providing users with context about the displayed data.
-- updateShownCount · function · L96-L101 — Updates the displayed count of visible nodes in the graph, helping users understand the current view's scope.
-- updateCounts · function · L103-L112 — Refreshes the displayed counts of nodes and edges based on the active graph, ensuring accurate information is presented.
-- showDetail · function · L115-L124 — Displays detailed information about a selected graph element, enhancing user interaction and understanding.
-- setTab · function · L129-L167 — Handles the logic for switching between different graph views, ensuring the UI reflects the current context accurately.
-- showEmpty · function · L169-L173 — Displays a message when no graph data is available, guiding users on how to generate the necessary data.
-- loadAll · function · L216-L223 — Loads the context and code graphs asynchronously, ensuring the viewer is populated with the latest data.
diff --git a/graft/viewer/tree.md b/graft/viewer/tree.md
deleted file mode 100644
index 434211f4..00000000
--- a/graft/viewer/tree.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# viewer/tree.ts · [[graph-visualization]]
-
-Generates a collapsible tree view of a code graph's hierarchy, allowing users to navigate through files, classes, and methods.
-
-- esc · function · L7-L9 — Escapes special HTML characters in a string to prevent rendering issues in the tree view.
-- renderOutline · function · L11-L66 — Renders the outline view of the code graph, managing the display of files and their hierarchical relationships.
-- kids · function · L18-L22 — Retrieves the child nodes of a given parent node in the graph based on the 'contains' relationship.
-- countDesc · function · L23-L26 — Counts the total number of descendant nodes for a given parent node, including its children and their descendants.
-- row · function · L29-L42 — Constructs the HTML representation of a tree row for a given node, including its children and symbol count.
diff --git a/graft/visualization-and-serving.md b/graft/visualization-and-serving.md
deleted file mode 100644
index 2d07e8de..00000000
--- a/graft/visualization-and-serving.md
+++ /dev/null
@@ -1,74 +0,0 @@
----
-name: Visualization and Serving
-slug: visualization-and-serving
-type: system
-sources:
- - path: src/viz/assemble.ts
- hash: 58ad5caed087bd7b929f5b625501a607e79e0476f998636bec241e0296706ece
- - path: src/viz/serve.ts
- hash: 14283762f454c01fc95cfbe9c2b41ef063fc17c4c3e5d120b5dc7f66f541fc1c
-sources_digest: 88ca5c49a63bfa8625974ff180102457ba16dd9538fa82d23bbe252becd035d8
-links:
- - to: graph-representation
- relation: produces
- description: It produces visual representations of the graph structure.
- - to: graph-traversal-and-analysis
- relation: uses
- description: It utilizes the graph traversal capabilities for visualization.
-generator:
- version: 1
-covers:
- - symbol: VizNode
- kind: interface
- at: 'src/viz/assemble.ts:L18-L24'
- - symbol: VizEdge
- kind: interface
- at: 'src/viz/assemble.ts:L26-L31'
- - symbol: VizGraph
- kind: interface
- at: 'src/viz/assemble.ts:L33-L42'
- - symbol: normalizeRelation
- kind: function
- at: 'src/viz/assemble.ts:L56-L58'
- - symbol: extractSummary
- kind: function
- at: 'src/viz/assemble.ts:L65-L76'
- - symbol: assembleContextGraph
- kind: function
- at: 'src/viz/assemble.ts:L79-L130'
- - symbol: VizServerOptions
- kind: interface
- at: 'src/viz/serve.ts:L16-L21'
- - symbol: VizServer
- kind: interface
- at: 'src/viz/serve.ts:L23-L26'
- - symbol: sendJson
- kind: function
- at: 'src/viz/serve.ts:L38-L41'
- - symbol: listen
- kind: function
- at: 'src/viz/serve.ts:L43-L55'
- - symbol: onError
- kind: function
- at: 'src/viz/serve.ts:L45-L48'
- - symbol: startVizServer
- kind: function
- at: 'src/viz/serve.ts:L57-L148'
- - symbol: close
- kind: method
- at: 'src/viz/serve.ts:L140-L146'
----
-<!-- context:generated:start -->
-## Summary
-
-This component is responsible for assembling and serving the context graph for visualization purposes, providing a local server for the Graft visualization tool. It handles the generation of JSON representations of the graph and manages client notifications for changes in the context directory.
-
-## Related
-
-- produces [[graph-representation]] — It produces visual representations of the graph structure.
-- uses [[graph-traversal-and-analysis]] — It utilizes the graph traversal capabilities for visualization.
-<!-- context:generated:end -->
-
-## Notes
-
-_Anything written below the generated block is preserved when the graph is regenerated._
diff --git a/install.sh b/install.sh
deleted file mode 100755
index da117a97..00000000
--- a/install.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env sh
-# Graft — one-line installer.
-#
-# Two ways to use it:
-# 1. From a checkout: ./install.sh (builds THIS directory — no re-clone)
-# 2. Over the network: curl -fsSL https://raw.githubusercontent.com/NanoNets/context-graph-engine/main/install.sh | sh
-#
-# Either way it builds the project and puts the `graft` command on your
-# PATH. Requires git, Node >= 20, and npm.
-#
-# Environment overrides:
-# GRAFT_REPO git URL to clone from (default: the NanoNets repo below)
-# GRAFT_REF branch/tag/commit to fetch (default: main)
-# GRAFT_HOME where to clone into (default: ~/.graft)
-set -eu
-
-REPO_URL="${GRAFT_REPO:-https://github.com/NanoNets/context-graph-engine.git}"
-REF="${GRAFT_REF:-main}"
-INSTALL_DIR="${GRAFT_HOME:-$HOME/.graft}"
-
-info() { printf '\033[1;36m›\033[0m %s\n' "$1"; }
-err() { printf '\033[1;31m✗ %s\033[0m\n' "$1" >&2; }
-
-need() {
- command -v "$1" >/dev/null 2>&1 || { err "'$1' is required but not installed. $2"; exit 1; }
-}
-
-need node "Install Node.js >= 20 from https://nodejs.org and re-run."
-need npm "Install npm (bundled with Node.js) and re-run."
-
-# Enforce Node >= 20.
-NODE_MAJOR="$(node -p 'process.versions.node.split(".")[0]')"
-if [ "$NODE_MAJOR" -lt 20 ]; then
- err "Node.js >= 20 is required (found $(node -v)). Upgrade and re-run."
- exit 1
-fi
-
-# If this script lives inside a checkout of the project, build that in place
-# rather than cloning (works offline and for private repos). Detected by a
-# sibling package.json naming this package. When piped via `curl | sh` there is
-# no script file on disk, so this check falls through to the clone path.
-SCRIPT_DIR=""
-case "${0:-}" in
- */*) SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" 2>/dev/null && pwd) || SCRIPT_DIR="" ;;
-esac
-
-if [ -n "$SCRIPT_DIR" ] && grep -q '"@nanonets/graft"' "$SCRIPT_DIR/package.json" 2>/dev/null; then
- INSTALL_DIR="$SCRIPT_DIR"
- info "Installing from local checkout at $INSTALL_DIR"
-else
- need git "Install git and re-run."
- if [ -d "$INSTALL_DIR/.git" ]; then
- info "Updating existing install at $INSTALL_DIR"
- git -C "$INSTALL_DIR" fetch --depth 1 origin "$REF"
- git -C "$INSTALL_DIR" checkout -q "$REF"
- git -C "$INSTALL_DIR" reset --hard -q "origin/$REF" 2>/dev/null || true
- else
- info "Cloning $REPO_URL → $INSTALL_DIR"
- git clone --depth 1 --branch "$REF" "$REPO_URL" "$INSTALL_DIR"
- fi
-fi
-
-info "Installing dependencies"
-( cd "$INSTALL_DIR" && npm install --silent )
-
-info "Building"
-( cd "$INSTALL_DIR" && npm run build --silent )
-
-info "Linking the 'graft' command"
-( cd "$INSTALL_DIR" && npm link >/dev/null 2>&1 )
-
-echo
-info "Installed. Try it in any repo:"
-cat <<'NEXT'
-
- Build the graph, then commit it:
- cd your-repo
- graft init # writes .context/*.md from your code
- git add .context && git commit -m "add context graph"
-
- Keep it honest in CI:
- graft check # exits non-zero if the graph is stale
-
- Runs locally out of the box:
- • Extraction/summaries default to a local Ollama model. Install Ollama and
- pull one: https://ollama.com then ollama pull llama3.2
- • Prefer cloud quality? Set a key and it's used automatically:
- export OPENROUTER_API_KEY=sk-or-...
-NEXT
diff --git a/package.json b/package.json
index c5ae2df9..53cf6bfd 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,6 @@
"build": "tsc -p tsconfig.json && tsc -p viewer/tsconfig.json && node scripts/build-viewer.mjs",
"dev": "tsc -p tsconfig.json --watch",
"cli": "tsx src/cli.ts",
- "bench": "tsx bench/run.ts",
"test": "node --import tsx --test test/*.test.ts",
"prepare": "npm run build",
"prepublishOnly": "npm run build",
diff --git a/src/ai/llm/types.ts b/src/ai/llm/types.ts
index 7e10d791..3607506b 100644
--- a/src/ai/llm/types.ts
+++ b/src/ai/llm/types.ts
@@ -2,7 +2,7 @@
* Provider-neutral chat transport.
*
* Every LLM call in graft — the engine's single-shot summarize/synthesize/crux
- * ops AND the benchmark's multi-turn ReAct loop — goes through one interface,
+ * ops, and any multi-turn tool-use loop built on top — goes through one interface,
* {@link ChatModel}. Adapters translate this neutral shape to a concrete SDK
* (OpenAI-compatible or native Anthropic). Nothing above this layer knows which
* provider is in play, so adding a provider is a new adapter, never a change to
@@ -39,7 +39,7 @@ export interface Message {
/**
* Request a provider cache marker (`cache_control: ephemeral`) on THIS message.
* The transport only understands this per-message flag; any sliding/rotation
- * policy lives in the caller (see the bench loop).
+ * policy lives in the caller.
*/
cacheBreakpoint?: boolean;
/**
diff --git a/src/cli-epilogue.ts b/src/cli-epilogue.ts
index fec47e82..b211951b 100644
--- a/src/cli-epilogue.ts
+++ b/src/cli-epilogue.ts
@@ -79,7 +79,7 @@ export function formatInitEpilogue(opts: InitEpilogueOptions): string {
}
});
- const closing = `${indent}when it clicks: git add graft .claude && git commit — every teammate's agent gets the map`;
+ const closing = `${indent}share it: git add .claude && git commit — teammates run \`graft build\` for their own local graph`;
return [...wordmark, "", ...stepLines, "", closing].join("\n");
}
diff --git a/src/cli.ts b/src/cli.ts
index 9864ce2a..5116f7d3 100644
--- a/src/cli.ts
+++ b/src/cli.ts
@@ -170,7 +170,7 @@ program
for (const e of g.errors) console.error(`✗ ${e}`);
const rel = relative(process.cwd(), g.contextDir) || "graft";
- console.log(` commit it: git add ${rel} && git commit -m "update graft"`);
+ console.log(` ${rel}/ is git-ignored (added automatically) — a local cache; teammates run \`graft build\` to get their own.`);
});
program
diff --git a/src/context/node-file.ts b/src/context/node-file.ts
index c34b59cf..5df841c5 100644
--- a/src/context/node-file.ts
+++ b/src/context/node-file.ts
@@ -22,7 +22,7 @@
* LLM and without re-reading every node body.
*/
import { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync, rmSync } from "node:fs";
-import { join } from "node:path";
+import { join, relative, sep } from "node:path";
import matter from "gray-matter";
import { contentHash, normalizeName } from "../util/id.js";
@@ -102,6 +102,32 @@ export function contextDirFor(root: string, override?: string): string {
return join(root, "graft");
}
+/**
+ * Make sure the repo's root `.gitignore` ignores the graft output dir. The
+ * graph is a local, regenerable cache (like `node_modules`), not a committed
+ * artifact, so every `graft build` adds the entry itself the first time — the
+ * user never has to think about it. No-ops when the entry is already present
+ * or the dir lives outside `root` (a custom `--dir` elsewhere, which can't be
+ * expressed as a repo-relative ignore). Best-effort: an unwritable `.gitignore`
+ * must never abort a build, so write failures are swallowed.
+ */
+export function ensureGitignored(root: string, contextDir: string): void {
+ const rel = relative(root, contextDir).split(sep).join("/");
+ if (rel === "" || rel.startsWith("..")) return; // dir is at/above the repo root — nothing sane to ignore
+ const entry = `${rel.replace(/\/+$/, "")}/`;
+ const path = join(root, ".gitignore");
+ let current = "";
+ try { current = readFileSync(path, "utf8"); } catch { /* no .gitignore yet — we create one */ }
+ const present = current.split("\n").some((l) => {
+ const t = l.trim();
+ return t === entry || t === rel;
+ });
+ if (present) return;
+ const gap = current === "" ? "" : current.endsWith("\n") ? "\n" : "\n\n";
+ const block = `${gap}# graft's local graph cache — regenerable, not committed (run \`graft build\`).\n${entry}\n`;
+ try { writeFileSync(path, current + block); } catch { /* best-effort — build already succeeded */ }
+}
+
/** Render the generated body (Summary + Related) for a node. */
function renderGenerated(node: ContextNode): string {
const lines = [`## Summary`, ``, node.summary.trim() || "_(no summary)_", ``];
diff --git a/src/graph/build.ts b/src/graph/build.ts
index 38c69a35..e885f0db 100644
--- a/src/graph/build.ts
+++ b/src/graph/build.ts
@@ -10,7 +10,7 @@
import { readFileSync } from "node:fs";
import { basename, dirname, relative, resolve, sep } from "node:path";
import { walkDir } from "../ingest/fs.js";
-import { contextDirFor } from "../context/node-file.js";
+import { contextDirFor, ensureGitignored } from "../context/node-file.js";
import { extractFile, languageOf, type Language, type RawEdge } from "./extract.js";
import { resolveEdges, type GoModule } from "./resolve.js";
import { enrichGraph, type EnrichStats } from "./enrich.js";
@@ -169,6 +169,9 @@ export async function buildGraph(
};
const graphPath = writeGraph(graph, outDir);
+ // The graph is a local, regenerable cache — make sure git ignores it. Runs on
+ // every build (cheap, idempotent), so a fresh clone's first build self-ignores.
+ ensureGitignored(root, outDir);
// `ask`'s token/IDF sidecar — moves per-query corpus tokenization to build
// time (~45% of query time on a 32k-node graph, profiled). Lives in the
// cache dir; `ask` falls back to live tokenization when it's absent/stale.
diff --git a/src/graph/workspace-cli.ts b/src/graph/workspace-cli.ts
index 8c5f20fe..b098c52f 100644
--- a/src/graph/workspace-cli.ts
+++ b/src/graph/workspace-cli.ts
@@ -6,6 +6,7 @@
* this file only renders them and wires the child builds through the engine.
*/
import { Graft } from "../engine.js";
+import { contextDirFor, ensureGitignored } from "../context/node-file.js";
import type { EngineConfig } from "../ai/providers.js";
import { formatAsk } from "../ask/ask.js";
import type { Direction } from "./traverse.js";
@@ -52,8 +53,11 @@ export async function runWorkspaceBuild(root: string, opts: WorkspaceBuildOption
console.error(`building ${children.length} workspace repos: ${children.join(", ")}`);
},
);
+ // Each child self-ignored during its own build; the parent's federation
+ // index (graft/workspace.json) is written outside buildGraph, so ignore it here too.
+ ensureGitignored(root, contextDirFor(root, opts.override));
console.log(`✓ workspace: ${children.length} repos federated → graft/workspace.json`);
- console.log(` commit each repo's graft/ and this folder's graft/workspace.json.`);
+ console.log(` graft/ is git-ignored — each teammate runs \`graft build\` to regenerate it locally.`);
}
export function runWorkspaceAsk(
diff --git a/test/claude-init.test.ts b/test/claude-init.test.ts
index 804d3770..ce6aa246 100644
--- a/test/claude-init.test.ts
+++ b/test/claude-init.test.ts
@@ -99,7 +99,8 @@ test('formatInitEpilogue: graph built shows stats, wordmark, and the 3-step list
assert.ok(out.includes('graft ask'));
assert.ok(!out.includes('build the graph'));
assert.ok(!out.includes('OPENROUTER'));
- assert.ok(out.includes('git add graft'));
+ // graft/ is git-ignored now — the shareable artifact is .claude (wiring), not the graph.
+ assert.ok(out.includes('git add .claude'));
});
test('formatInitEpilogue: graph not built shows "build the graph" as step 1, no stats, same column alignment', () => {
@@ -110,7 +111,7 @@ test('formatInitEpilogue: graph not built shows "build the graph" as step 1, no
assert.ok(notBuilt.includes('3. code as usual'));
assert.ok(notBuilt.includes('4. explore by hand'));
assert.ok(!notBuilt.includes('nodes ·'));
- assert.ok(notBuilt.includes('git add graft'));
+ assert.ok(notBuilt.includes('git add .claude'));
// the command column (after "restart your agent", the longest label) lines up
// identically whether there are 3 or 4 numbered steps.
const col = (text: string, marker: string) => text.split('\n').find((l) => l.includes(marker))!.indexOf('a new session');
@@ -128,7 +129,7 @@ test('CLI: graft init epilogue has the wordmark + next steps, and never mentions
assert.ok(res.stderr.includes('|___/'), 'wordmark present');
assert.ok(res.stderr.includes('code as usual'));
assert.ok(res.stderr.includes('restart your agent'));
- assert.ok(res.stderr.includes('git add graft'));
+ assert.ok(res.stderr.includes('git add .claude'));
assert.ok(res.stderr.includes('graft ask'));
assert.ok(!res.stderr.includes('OPENROUTER'));
// --no-build, never built before → "build the graph" is step 1
diff --git a/test/context.test.ts b/test/context.test.ts
index 6017af9a..73245739 100644
--- a/test/context.test.ts
+++ b/test/context.test.ts
@@ -10,6 +10,7 @@ import { tmpdir } from "node:os";
import { execFileSync } from "node:child_process";
import { buildContext } from "../src/context/build.js";
import { checkContext } from "../src/context/check.js";
+import { contextDirFor, ensureGitignored } from "../src/context/node-file.js";
import { fakeProviders } from "./helpers.js";
// CLI-spawn helper (same pattern as test/graph-traverse-cli.test.ts) — these tests
@@ -210,3 +211,65 @@ test("graft check: keyless build then code changes (wiring stale) exits 1", () =
rmSync(dir, { recursive: true, force: true });
}
});
+
+// ensureGitignored — every `graft build` self-ignores its regenerable graph dir.
+test("ensureGitignored: creates .gitignore with the graft/ entry when none exists", () => {
+ const dir = mkdtempSync(join(tmpdir(), "ctxgi-"));
+ try {
+ ensureGitignored(dir, contextDirFor(dir));
+ const gi = readFileSync(join(dir, ".gitignore"), "utf8");
+ assert.match(gi, /^graft\/$/m);
+ assert.match(gi, /regenerable, not committed/);
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+});
+
+test("ensureGitignored: appends to an existing .gitignore without clobbering it", () => {
+ const dir = mkdtempSync(join(tmpdir(), "ctxgi-"));
+ try {
+ writeFileSync(join(dir, ".gitignore"), "node_modules/\ndist/\n");
+ ensureGitignored(dir, contextDirFor(dir));
+ const gi = readFileSync(join(dir, ".gitignore"), "utf8");
+ assert.match(gi, /node_modules\//);
+ assert.match(gi, /dist\//);
+ assert.match(gi, /^graft\/$/m);
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+});
+
+test("ensureGitignored: idempotent — a second build adds nothing", () => {
+ const dir = mkdtempSync(join(tmpdir(), "ctxgi-"));
+ try {
+ ensureGitignored(dir, contextDirFor(dir));
+ const once = readFileSync(join(dir, ".gitignore"), "utf8");
+ ensureGitignored(dir, contextDirFor(dir));
+ const twice = readFileSync(join(dir, ".gitignore"), "utf8");
+ assert.equal(once, twice);
+ assert.equal((twice.match(/^graft\/$/gm) ?? []).length, 1);
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+});
+
+test("ensureGitignored: recognizes a pre-existing bare `graft` entry (no slash) and stays silent", () => {
+ const dir = mkdtempSync(join(tmpdir(), "ctxgi-"));
+ try {
+ writeFileSync(join(dir, ".gitignore"), "graft\n");
+ ensureGitignored(dir, contextDirFor(dir));
+ assert.equal(readFileSync(join(dir, ".gitignore"), "utf8"), "graft\n");
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+});
+
+test("ensureGitignored: no-op when the graph dir is outside the repo root", () => {
+ const dir = mkdtempSync(join(tmpdir(), "ctxgi-"));
+ try {
+ ensureGitignored(dir, join(tmpdir(), "somewhere-else-graft"));
+ assert.equal(existsSync(join(dir, ".gitignore")), false);
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+});