@graphpilot-oss/graphpilot 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/CHANGELOG.md +73 -126
  2. package/README.md +359 -101
  3. package/dist/cli.js +20 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/indexer.js +3 -3
  6. package/dist/indexer.js.map +1 -1
  7. package/dist/init.d.ts +28 -0
  8. package/dist/init.js +112 -0
  9. package/dist/init.js.map +1 -0
  10. package/dist/interactions.d.ts +5 -4
  11. package/dist/interactions.js +0 -0
  12. package/dist/interactions.js.map +1 -1
  13. package/dist/mcp.js +126 -46
  14. package/dist/mcp.js.map +1 -1
  15. package/dist/repo-resolve.d.ts +47 -0
  16. package/dist/repo-resolve.js +195 -0
  17. package/dist/repo-resolve.js.map +1 -0
  18. package/dist/storage.js +10 -1
  19. package/dist/storage.js.map +1 -1
  20. package/dist/validation.js +30 -4
  21. package/dist/validation.js.map +1 -1
  22. package/dist/watcher.d.ts +10 -0
  23. package/dist/watcher.js +70 -7
  24. package/dist/watcher.js.map +1 -1
  25. package/examples/README.md +105 -0
  26. package/examples/claude-code/README.md +125 -0
  27. package/examples/claude-code/claude-routing.md +102 -0
  28. package/examples/claude-code/claude_config.json +8 -0
  29. package/examples/cline/.clinerules +39 -0
  30. package/examples/cline/README.md +104 -0
  31. package/examples/cline/cline_mcp_settings.json +10 -0
  32. package/examples/continue/.continuerules +39 -0
  33. package/examples/continue/README.md +98 -0
  34. package/examples/continue/config.json +13 -0
  35. package/examples/cursor/.cursorrules +39 -0
  36. package/examples/cursor/README.md +98 -0
  37. package/examples/cursor/mcp.json +11 -0
  38. package/examples/windsurf/.windsurfrules +39 -0
  39. package/examples/windsurf/README.md +85 -0
  40. package/examples/windsurf/mcp_config.json +8 -0
  41. package/package.json +12 -3
  42. package/.editorconfig +0 -15
  43. package/.github/CODEOWNERS +0 -22
  44. package/.github/FUNDING.yml +0 -1
  45. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
  46. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  47. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -23
  48. package/.github/PULL_REQUEST_TEMPLATE.md +0 -19
  49. package/.github/dependabot.yml +0 -15
  50. package/.github/workflows/ci.yml +0 -62
  51. package/.github/workflows/release.yml +0 -50
  52. package/.prettierignore +0 -19
  53. package/.prettierrc.json +0 -20
  54. package/CODE_OF_CONDUCT.md +0 -83
  55. package/CONTRIBUTING.md +0 -111
  56. package/bench/README.md +0 -544
  57. package/bench/results/agent-tier-2026-05-22.md +0 -28
  58. package/bench/results/agent-tier-summary.md +0 -44
  59. package/bench/results/baseline-tier-2026-05-22.md +0 -23
  60. package/bench/results/baseline.json +0 -810
  61. package/bench/results/baseline.md +0 -28
  62. package/bench/run-agent-tier-automated.ts +0 -234
  63. package/bench/run-agent-tier.md +0 -125
  64. package/bench/run-baseline-tier.ts +0 -200
  65. package/bench/run.ts +0 -210
  66. package/bench/runner-baseline.ts +0 -177
  67. package/bench/runner-graphpilot.ts +0 -131
  68. package/bench/score-agent-tier.ts +0 -191
  69. package/bench/score.ts +0 -59
  70. package/bench/tasks.ts +0 -236
  71. package/dist/provenance.d.ts +0 -74
  72. package/dist/provenance.js +0 -95
  73. package/dist/provenance.js.map +0 -1
  74. package/docs/architecture.md +0 -311
  75. package/docs/limitations.md +0 -156
  76. package/docs/mcp-setup.md +0 -231
  77. package/docs/quickstart.md +0 -202
  78. package/eslint.config.js +0 -148
  79. package/lefthook.yml +0 -81
  80. package/pnpm-workspace.yaml +0 -6
  81. package/scripts/smoke-stdio.mjs +0 -97
  82. package/src/cli.ts +0 -171
  83. package/src/edges.ts +0 -202
  84. package/src/git.ts +0 -255
  85. package/src/graph-schema.ts +0 -229
  86. package/src/impact.ts +0 -218
  87. package/src/indexer.ts +0 -152
  88. package/src/interactions.ts +0 -0
  89. package/src/mcp.ts +0 -652
  90. package/src/parser.ts +0 -138
  91. package/src/provenance.ts +0 -115
  92. package/src/query.ts +0 -148
  93. package/src/redact.ts +0 -122
  94. package/src/storage.ts +0 -115
  95. package/src/symbols.ts +0 -173
  96. package/src/validation.ts +0 -69
  97. package/src/validators.ts +0 -253
  98. package/src/watcher.ts +0 -383
  99. package/tests/edges.test.ts +0 -175
  100. package/tests/fixtures/sample.ts +0 -32
  101. package/tests/git.test.ts +0 -303
  102. package/tests/graph-schema.test.ts +0 -321
  103. package/tests/impact.test.ts +0 -454
  104. package/tests/interactions.test.ts +0 -180
  105. package/tests/lint-policy.test.ts +0 -106
  106. package/tests/mcp-stdio.test.ts +0 -171
  107. package/tests/mcp.test.ts +0 -335
  108. package/tests/parser.test.ts +0 -31
  109. package/tests/provenance.test.ts +0 -132
  110. package/tests/query.test.ts +0 -160
  111. package/tests/redact.test.ts +0 -167
  112. package/tests/security.test.ts +0 -144
  113. package/tests/symbols.test.ts +0 -78
  114. package/tests/validators.test.ts +0 -193
  115. package/tests/watcher.test.ts +0 -250
  116. package/tsconfig.json +0 -18
package/README.md CHANGED
@@ -4,128 +4,386 @@
4
4
 
5
5
  <h1 align="center">GraphPilot</h1>
6
6
 
7
- > **The refactor-safe code graph for coding agents.** Branch-aware. Evidence-backed.
8
- > A structural memory layer that knows what changed since `main`, cites every claim
9
- > with `file:line @ sha`, and re-roots itself to the git worktree automatically.
7
+ <p align="center">
8
+ <strong>Structural memory for coding agents.</strong><br />
9
+ A refactor-safe, branch-aware, evidence-backed code graph that runs entirely on your machine.
10
+ </p>
10
11
 
11
- [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
12
- [![Node](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](https://nodejs.org)
13
- [![Status](https://img.shields.io/badge/status-alpha-orange.svg)](#status)
12
+ <p align="center">
13
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License: Apache 2.0" /></a>
14
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg" alt="Node ≥20" /></a>
15
+ <img src="https://img.shields.io/badge/version-0.1.0-blue.svg" alt="v0.1.0" />
16
+ <img src="https://img.shields.io/badge/status-alpha-orange.svg" alt="alpha" />
17
+ <img src="https://img.shields.io/badge/tests-239%20passing-brightgreen.svg" alt="239 tests" />
18
+ </p>
14
19
 
15
- ---
20
+ <p align="center">
21
+ <a href="#quickstart">Quickstart</a> ·
22
+ <a href="#the-five-tools">Tools</a> ·
23
+ <a href="#how-it-works">How it works</a> ·
24
+ <a href="#editor-setup">Editor setup</a> ·
25
+ <a href="docs/limitations.md">Limitations</a> ·
26
+ <a href="bench/README.md">Benchmarks</a>
27
+ </p>
16
28
 
17
- **On 10 standardized structural questions** about a real TypeScript codebase:
18
- GraphPilot returns the correct answer with **F1 0.89** vs grep's **0.42**, while
19
- the agent reads **99.9 % fewer bytes** (721 B vs 528 KB) to reach the same
20
- conclusion. [Reproduce in 30 s →](bench/README.md)
29
+ <p align="center">
30
+ <img src="docs/press/hero.gif" alt="GraphPilot demo install, index, and query a real TypeScript repo in under 30 seconds" width="900" />
31
+ </p>
21
32
 
22
33
  ---
23
34
 
24
- ## Status
35
+ ## What it is
36
+
37
+ GraphPilot is a local CLI + MCP server that indexes your TypeScript/JavaScript repo into a structural graph (symbols, callers, callees, blast radius) and exposes it to coding agents — Claude Code, Cursor, Cline, Windsurf, Continue — so they stop re-`grep`ping the same files every conversation.
38
+
39
+ The problem it solves: agents burn tokens, hallucinate function names, and miss structural relationships ("what calls this?", "what breaks if I rename it?") because each session starts from zero. GraphPilot is the persistent structural memory in between.
40
+
41
+ **Token cost drops. Hallucinations drop. Refactors get safer.**
42
+
43
+ On 10 standardized structural questions, GraphPilot reaches **F1 0.89 vs grep's 0.42** while the agent reads **99.9 % fewer bytes** (721 B vs 528 KB) to reach the same conclusion. The same byte-cost reduction holds at scale: indexing **microsoft/TypeScript** (601 files, 17 k symbols, 70 k call edges in 10 s) gives **sub-millisecond queries** and a **99.99 % bytes-read reduction vs grep** on the compiler's hottest symbols. [Reproduce in 30 seconds →](bench/README.md)
44
+
45
+ ## One binary, two modes
46
+
47
+ GraphPilot ships as a single npm package (`@graphpilot-oss/graphpilot`) with two runtime modes — most users run both.
48
+
49
+ | Mode | Command | What it does |
50
+ | -------------- | -------------------------- | ---------------------------------------------------------------------------- |
51
+ | **CLI** | `graphpilot index <path>` | Walks your repo, builds the structural graph, writes it to `~/.graphpilot/` |
52
+ | | `graphpilot watch <path>` | Keeps the graph fresh (~10 ms per file save) |
53
+ | | `graphpilot status <path>` | Health probe — when the graph was last refreshed, file/symbol/edge counts |
54
+ | **MCP server** | `graphpilot mcp` | Speaks MCP over stdio — your coding agent calls into this to query the graph |
55
+
56
+ **The flow:** the **CLI** builds the index once (and `watch` keeps it warm). The **MCP server** is what your coding agent talks to — you never invoke it yourself, you just point your agent's MCP config at `graphpilot mcp` once and the agent spawns it on every session.
57
+
58
+ ```
59
+ you ── graphpilot index/watch ──► ~/.graphpilot/<repo>/graph.json
60
+
61
+
62
+ coding agent ◄── stdio JSON-RPC ── graphpilot mcp ── reads graph
63
+ ```
64
+
65
+ If you only want CLI access to your code graph (no agent), run `graphpilot index` and then `graphpilot stats` / inspect `graph.json` directly. If you only want the agent integration, you still need to run `graphpilot index` once — the MCP server is read-only against the on-disk graph.
66
+
67
+ ## What makes it different
68
+
69
+ Other code-graph tools treat your repo as a static blob: index once, query forever, no branch awareness, no proof of where an answer came from. GraphPilot is built around three properties none of them ship:
70
+
71
+ - 🔍 **Evidence anchors.** Every tool response carries `file:line @ sha` on every symbol and call site. The agent can quote the anchor verbatim and you can verify it instantly — hallucinations get exposed the moment you jump to the line.
72
+ - 🌿 **Differential impact.** Pass `since: <commit|branch>` to `gp_impact` and the result is filtered to files your branch actually touches. PR-scoped refactor analysis in one call instead of `git diff | xargs grep`.
73
+ - 🪵 **Worktree-aware by default.** Two `git worktree add`-ed branches naturally produce two separate indexes — no manual config. Run `graphpilot index ./src/feature` from a subdir and it transparently re-roots to the worktree top. Opt out with `--no-worktree`.
74
+
75
+ Add to that: **local-first** (no telemetry, no remote calls, enforced by an ESLint policy on `src/` itself), **deterministic** (same repo → same graph), **sub-second incremental** updates via watch mode.
76
+
77
+ ## Quickstart
78
+
79
+ **Prerequisites**
80
+
81
+ - Node.js ≥ 20 (`node --version` to check)
82
+ - An MCP-capable coding agent (Claude Code, Cursor, Cline, Windsurf, or Continue)
83
+ - A TypeScript or JavaScript repo to index
84
+
85
+ End-to-end time: ~3 minutes.
86
+
87
+ **1. Install the CLI**
88
+
89
+ ```bash
90
+ npm install -g @graphpilot-oss/graphpilot
91
+ # or: pnpm add -g @graphpilot-oss/graphpilot
92
+ # or one-shot, no install: npx @graphpilot-oss/graphpilot <command>
93
+ ```
94
+
95
+ Verify it landed on your `PATH`:
96
+
97
+ ```bash
98
+ graphpilot --version
99
+ # → 0.1.0
100
+ ```
101
+
102
+ If you see `command not found: graphpilot`, your global npm bin is not on `PATH`. Run `npm config get prefix` and add `<prefix>/bin` to your shell's `PATH`, or use the `npx` form above.
103
+
104
+ **2. Build the structural index for your repo**
105
+
106
+ Run this once per project. It walks your source tree, parses each TS/JS file with tree-sitter, extracts symbols + call edges, and writes the graph to `~/.graphpilot/<repo-id>/graph.json`.
107
+
108
+ ```bash
109
+ graphpilot index ~/code/my-app
110
+ ```
111
+
112
+ Expect a one-line summary like `indexed 412 files · 3,981 symbols · 7,204 edges · 1.8s`.
113
+
114
+ **3. Wire it into your coding agent**
115
+
116
+ GraphPilot speaks MCP over stdio. Add this server entry to your agent's MCP config — every supported client uses the same two-line shape:
117
+
118
+ ```json
119
+ {
120
+ "mcpServers": {
121
+ "graphpilot": {
122
+ "command": "graphpilot",
123
+ "args": ["mcp"]
124
+ }
125
+ }
126
+ }
127
+ ```
128
+
129
+ Where this file lives depends on the client (`~/.cursor/mcp.json`, `~/.claude.json`, Cline's settings panel, etc.). Pre-made configs with the exact file path for each agent are in [`examples/`](examples/) — copy the one for your client.
130
+
131
+ Restart the agent. It now has five new tools: `gp_recall`, `gp_callers`, `gp_impact`, `gp_index`, `gp_stats` — see [The five tools](#the-five-tools) below for what each one does and when the agent should reach for it.
132
+
133
+ **4. Try it**
134
+
135
+ Ask your agent a structural question instead of letting it grep:
136
+
137
+ > _"Use gp_impact to show me everything that breaks if I rename `parseToken`."_
138
+
139
+ You should see a response with `file:line @ sha` anchors you can click straight to. If the agent doesn't reach for the tool, prompt explicitly: "use the `gp_` MCP tools." If it can't see them at all, the MCP config wasn't picked up — restart the agent and re-check the config path for your client in [`examples/`](examples/).
140
+
141
+ **5. Keep the index fresh as you edit (optional but recommended)**
142
+
143
+ ```bash
144
+ graphpilot watch ~/code/my-app
145
+ ```
146
+
147
+ Sub-10 ms incremental updates on each file save. Leave it running in a terminal tab.
25
148
 
26
- Pre-alpha, in active development. Not yet published to npm. Expect breaking changes.
149
+ **6. Drop per-editor routing rules into your repo (optional)**
150
+
151
+ ```bash
152
+ graphpilot init
153
+ ```
27
154
 
28
- ## Quickstart (local dev)
155
+ Auto-detects which editors you have installed (Cursor, Claude Code, Cline, Windsurf, Continue) and writes the matching rules file (`.cursorrules`, `CLAUDE.md`, etc.) to the current directory. The rules teach the agent to reach for `gp_*` tools before grep.
29
156
 
30
157
  ```bash
31
- git clone https://github.com/graphpilot-oss/graphpilot.git
32
- cd graphpilot
33
- pnpm install
34
- pnpm build
158
+ graphpilot init --all # write rules for every supported editor
159
+ graphpilot init --client cursor # one editor only
160
+ graphpilot init --dry-run # preview without writing
161
+ ```
162
+
163
+ Full 5-minute walkthrough with screenshots: [`docs/quickstart.md`](docs/quickstart.md).
164
+
165
+ ## The five tools
166
+
167
+ GraphPilot exposes five MCP tools. Each one answers a structural question your agent would otherwise solve by grepping and reading files.
168
+
169
+ ### `gp_recall` — find a symbol by name
170
+
171
+ Use this when the agent asks "where is X defined?" or needs to locate a function before reasoning about it.
172
+
173
+ - **Input:** `{ query, limit?, substring?, path? }`
174
+ - **Returns:** symbols matching the name (exact case-insensitive by default; `substring: true` for partial matches), each with `file:line @ sha`.
175
+ - **Replaces:** `grep -rn "function X"` plus reading each hit to find the real definition.
176
+
177
+ ```text
178
+ Agent: gp_recall({ query: "parseToken" })
179
+ → parseToken (function) — src/auth.ts:42 @ a1b2c3d
180
+ export function parseToken(raw: string): Token | null
181
+ ```
182
+
183
+ ### `gp_callers` — list callers (or callees)
35
184
 
36
- # Index a repo
37
- node dist/cli.js index /path/to/your/repo
185
+ Use this when the agent needs to know "who calls X?" or "what does X call?" — the two fundamental questions of refactoring.
38
186
 
39
- # See what got indexed
40
- node dist/cli.js status /path/to/your/repo
187
+ - **Input:** `{ symbol, direction?: 'callers' | 'callees', limit?, includeUnresolved?, path? }`
188
+ - **Returns:** every call edge where the symbol is target (callers) or source (callees), with anchors.
189
+ - **Replaces:** `grep -rn "X("` followed by manual filtering of comments, strings, and renamed shadows.
41
190
 
42
- # Keep the index fresh as you edit (Ctrl+C to stop)
43
- node dist/cli.js watch /path/to/your/repo
191
+ ```text
192
+ Agent: gp_callers({ symbol: "authenticate", direction: "callers" })
193
+ → login → authenticate — src/routes/login.ts:18 @ a1b2c3d
194
+ → refreshSession → authenticate — src/session.ts:64 @ a1b2c3d
44
195
  ```
45
196
 
46
- Then wire it into Claude Code (or any MCP client): see
47
- [docs/mcp-setup.md](docs/mcp-setup.md).
48
-
49
- ## What it does
50
-
51
- Five MCP tools that any MCP-compatible agent (Claude Code, Cursor, Cline,
52
- Windsurf, Continue) can call:
53
-
54
- | Tool | Use it for |
55
- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
56
- | `gp_index` | Re-index a repo from inside the agent |
57
- | `gp_recall` | Look up a function/class/type/interface by name |
58
- | `gp_callers` | List callers (or callees) of a symbol |
59
- | `gp_impact` | Blast radius: direct + transitive callers, tests affected, public-API flag — answers _"what breaks if I rename X?"_ in one call. Pass `since: <commit\|branch>` for PR-scoped impact |
60
- | `gp_stats` | Index health probe |
61
-
62
- Plus `graphpilot watch` for sub-second incremental updates on file save.
63
-
64
- The index lives in `~/.graphpilot/<repo-id>/graph.json` (mode 0600). Everything
65
- stays local. No accounts, no telemetry, no remote calls — enforced by an
66
- ESLint policy on the codebase itself.
67
-
68
- ## What's different
69
-
70
- Other code-graph tools (CodeGraphContext, Serena, the 15+ existing MCP servers
71
- in this space) treat your repo as a static blob: index once, query forever, no
72
- awareness of branches, no proof of where an answer came from. GraphPilot is
73
- built around three things none of them ship:
74
-
75
- - **Evidence anchors.** Every tool response includes `file:line @ sha` for
76
- every symbol and call site. The agent can quote the anchor verbatim and
77
- you can verify it instantly — fabrications get exposed the moment the user
78
- jumps to the line.
79
- - **Differential impact (`gp_impact({since: <ref>})`).** Ask "of all the
80
- callers of `X`, which ones live in code my PR touches?" — answered in one
81
- call instead of `git diff | xargs grep`. Branch-scoped refactors without
82
- the false-positive noise.
83
- - **Worktree-aware by default.** Run `graphpilot index ./src/feature` from a
84
- subdir and it transparently re-roots to the git worktree top, so two
85
- `git worktree add`-ed branches naturally get two separate indexes. Opt out
86
- with `--no-worktree`.
87
-
88
- ## Roadmap
89
-
90
- | Milestone | Status |
91
- | ------------------------------------------------ | ----------------- |
92
- | Parser + symbol extraction (TS/JS) | ✅ |
93
- | Directory indexer + JSON storage | ✅ |
94
- | Call-edge extraction + resolver | ✅ |
95
- | MCP server (5 tools) | ✅ |
96
- | Watch mode | ✅ |
97
- | Impact analysis (`gp_impact`) | ✅ |
98
- | Tier-A benchmark (this codebase) | ✅ |
99
- | Tier-B agent benchmark (Claude Code vs baseline) | ⏭ |
100
- | npm publish | ⏭ |
101
- | Python language support | ⏭ (demand-gated) |
102
-
103
- ## Why
104
-
105
- Most coding agents (Claude Code, Cursor, Aider) re-grep the codebase every
106
- conversation. That burns tokens, hallucinates function names, and misses
107
- structural relationships (_"what calls this?"_, _"what breaks if I rename it?"_).
108
-
109
- GraphPilot indexes the structural memory of your repo once. The agent reuses
110
- it across sessions. Token cost drops. Hallucinations drop. Refactors get safer.
111
-
112
- The benchmark above is the floor: it measures what's reachable via tool calls,
113
- not what the agent does with it. The agent-eval Tier B is spec'd in
114
- [bench/run-agent-tier.md](bench/run-agent-tier.md) and pending a focused
115
- launch-prep session.
197
+ ### `gp_impact` blast radius in one call
198
+
199
+ Use this when the agent asks "what breaks if I rename X?" or "what depends on this?" — the single most expensive question an agent normally solves.
200
+
201
+ - **Input:** `{ symbol, depth? (1–5, default 3), since?, path? }`
202
+ - **Returns:** direct callers, transitive callers grouped by BFS depth, tests likely affected, public-API flag, summary stats.
203
+ - **Killer feature:** pass `since: 'main'` and the result is scoped to files your branch actually touches — PR-scoped refactor review without `git diff` gymnastics.
204
+
205
+ ```text
206
+ Agent: gp_impact({ symbol: "extractSymbols", depth: 2, since: "main" })
207
+ Direct callers (2): indexDirectory, applyUpdate
208
+ Depth-2 callers (1): cmdIndex
209
+ Tests affected (3): tests/indexer.test.ts, tests/symbols.test.ts, tests/cli.test.ts
210
+ Public API: no
211
+ ```
212
+
213
+ ### `gp_index` refresh from inside the agent
214
+
215
+ Use this after the agent (or the user) has made a batch of structural edits and wants the graph to reflect them without dropping to a shell.
216
+
217
+ - **Input:** `{ path? }`
218
+ - **Returns:** re-indexes the repo and invalidates the per-path query cache.
219
+ - **Pairs with:** `graphpilot watch` for sub-10 ms incremental updates between explicit re-indexes.
220
+
221
+ ### `gp_stats` index health probe
222
+
223
+ Use this as a smoke test: "is the index alive? when was it last refreshed?"
224
+
225
+ - **Input:** `{ path? }`
226
+ - **Returns:** repo id, `indexedAt`, file/symbol/edge counts, indexed branch + sha when available.
227
+
228
+ ## How it works
229
+
230
+ ```
231
+ ┌────────────────────────────────────────────────────────────────┐
232
+ │ Your TypeScript / JS repo │
233
+ └──────────────────────────────┬─────────────────────────────────┘
234
+
235
+ ┌──────────────▼──────────────┐
236
+ indexer.ts │
237
+ walk dir · skip ignores · │
238
+ │ symlink-safe · 50k cap │
239
+ └──────────────┬──────────────┘
240
+
241
+ ┌──────────────▼──────────────┐
242
+ │ parser.ts │
243
+ │ tree-sitter AST │
244
+ │ 5 MB cap · iterative walk │
245
+ └──────────────┬──────────────┘
246
+
247
+ ┌──────────────────┴──────────────────┐
248
+ │ │
249
+ ┌────────▼────────┐ ┌────────▼────────┐
250
+ │ symbols.ts │ │ edges.ts │
251
+ │ funcs · classes│ │ call sites + │
252
+ │ methods · ifs │ │ resolver │
253
+ │ types · enums │ │ (same-file→glb) │
254
+ └────────┬────────┘ └────────┬────────┘
255
+ │ │
256
+ └──────────────────┬──────────────────┘
257
+
258
+ ┌──────────────▼──────────────┐
259
+ │ storage.ts │
260
+ │ ~/.graphpilot/<repo-id>/ │
261
+ │ graph.json · mode 0600 │
262
+ └──────────────┬──────────────┘
263
+
264
+ ┌──────────────▼──────────────┐
265
+ │ query.ts (GraphIndex)
266
+ │ byName · byId · callers · │
267
+ │ callees — sub-ms lookups │
268
+ └──────────────┬──────────────┘
269
+
270
+ ┌──────────────▼──────────────┐
271
+ │ mcp.ts │
272
+ │ 5 tools · stdio JSON-RPC │
273
+ └──────────────┬──────────────┘
274
+
275
+ [MCP protocol]
276
+
277
+ ┌──────────────▼──────────────┐
278
+ │ Claude Code · Cursor · │
279
+ │ Cline · Windsurf · … │
280
+ └─────────────────────────────┘
281
+ ```
282
+
283
+ Data flow is one-way: source → tree → symbols + edges → JSON → query → agent. GraphPilot never modifies your code.
284
+
285
+ Full pipeline writeup with file references: [`docs/architecture.md`](docs/architecture.md).
286
+
287
+ ## When to use which tool
288
+
289
+ | If the agent is about to… | Reach for… | Why |
290
+ | -------------------------------------------------- | ------------------------------ | ----------------------------------------------------- |
291
+ | `grep` for a function by name | `gp_recall` | One call, no false positives from comments or strings |
292
+ | Read 20 files looking for "who calls X" | `gp_callers` | Pre-computed reverse index, sub-millisecond |
293
+ | Plan a rename or signature change | `gp_impact` | Direct + transitive + tests + public-API in one call |
294
+ | Review a PR's structural blast radius | `gp_impact({ since: 'main' })` | Differential — only callers your branch touches |
295
+ | Re-grep after editing several files | `gp_index` | Incremental: lets the next call see your edits |
296
+ | Sanity-check whether the index is loaded and fresh | `gp_stats` | One-liner health probe |
297
+
298
+ For string literals, error messages, config values, or anything in a language other than TS/JS: **stay with grep.** GraphPilot indexes code structure, not text.
299
+
300
+ ## Editor setup
301
+
302
+ GraphPilot speaks MCP over stdio, so it works with any MCP-capable client. Ready-to-paste configs live in `examples/`:
303
+
304
+ | Client | Folder |
305
+ | ----------------------------- | ------------------------------------------------ |
306
+ | **Claude Code** (Anthropic) | [`examples/claude-code/`](examples/claude-code/) |
307
+ | **Cursor** | [`examples/cursor/`](examples/cursor/) |
308
+ | **Cline** (VS Code extension) | [`examples/cline/`](examples/cline/) |
309
+ | **Windsurf** (Codeium) | [`examples/windsurf/`](examples/windsurf/) |
310
+ | **Continue.dev** | [`examples/continue/`](examples/continue/) |
311
+ | Any other MCP client | See [`docs/mcp-setup.md`](docs/mcp-setup.md) |
312
+
313
+ Each folder contains: a `README.md` walkthrough, a sample config file with the exact JSON to paste, and (where the client supports it) a routing template so the agent automatically reaches for GraphPilot on structural questions.
314
+
315
+ ## Privacy & security
316
+
317
+ GraphPilot is **local-first by promise and by build gate**.
318
+
319
+ - **No telemetry, no remote calls, ever.** Verifiable: `src/` has zero `http`, `fetch`, `axios`, or analytics imports — enforced by an ESLint rule plus a meta-test that proves the rule fires on every banned import.
320
+ - **No `child_process`, no `exec`, no `spawn`.** Git facts are read directly from `.git/` via pure-JS helpers.
321
+ - **Source code never leaves your machine.** Only structural metadata (names, locations, signatures, call relationships) lives in `~/.graphpilot/`.
322
+ - **Signatures are redacted** for common secret patterns (OpenAI/Anthropic `sk-`, GitHub `ghp_`/`ghs_`, AWS `AKIA`, JWTs, PEM headers, Slack/Stripe tokens) before they're written to disk.
323
+ - **Strict file permissions:** dir `0o700`, files `0o600`.
324
+ - **Schema validation on load:** tampered or corrupt `graph.json` falls back to "no index" rather than poisoning the agent.
325
+ - **Hand-rolled input validators** on every MCP tool — unknown fields are rejected, every field type-checked, numbers range-checked, strings length-capped.
326
+
327
+ Threat model and per-defence test references live in [`docs/architecture.md`](docs/architecture.md). Report security issues per [`SECURITY.md`](SECURITY.md).
328
+
329
+ ## Vs alternatives
330
+
331
+ | Tool | Branch-aware | Evidence anchors | Local-first | Languages |
332
+ | ------------------ | ------------ | ---------------- | ----------- | ------------ |
333
+ | **GraphPilot** | ✅ | ✅ | ✅ | TS/JS |
334
+ | CodeGraphContext | ❌ | ❌ | ✅ | TS/JS/Python |
335
+ | Serena | ❌ | ❌ | ✅ | Multi |
336
+ | Sourcegraph (SaaS) | ⚠ partial | ✅ | ❌ | Multi |
337
+ | Plain grep + read | n/a | ❌ | ✅ | All |
338
+
339
+ GraphPilot is not trying to be the universal code-graph. It's trying to be the one that makes refactors in TypeScript/JavaScript repos **safe to delegate to an agent** — which means branch awareness and verifiable citations are non-negotiable.
340
+
341
+ ## Limitations
342
+
343
+ GraphPilot v0.1 makes deliberate trade-offs to ship small and sharp:
344
+
345
+ - **TS/JS only.** Python, Rust, Go, Java are out of scope for v1. Python is demand-gated for v0.2 / v0.3.
346
+ - **Name-based resolver** (no import-path tracking, no type-based method dispatch). Expected resolution rate: ~25–35 % of edges resolve to in-repo symbols; the rest are stdlib / third-party. That's enough because the questions agents actually ask (_"who calls X in my repo?"_) are the ones the dumb resolver answers correctly.
347
+ - **No semantic search.** `gp_recall` is name-only. "Find code similar to this snippet" is deferred until 30+ users ask for it.
348
+ - **No `.graphpilotignore`** yet (defaults skip `node_modules`, `dist`, `build`, `.git`, `coverage`, `.next`, `.nuxt`, `.cache`, `out`, `*.d.ts`).
349
+ - **Single repo per query.** Workspace abstraction is on the v1.x roadmap.
350
+
351
+ Full list with mitigations: [`docs/limitations.md`](docs/limitations.md).
352
+
353
+ ## FAQ
354
+
355
+ **Does it send my code anywhere?**
356
+ No. There is no network code in `src/`, no telemetry, no update check. An ESLint rule blocks adding any of those at the build gate.
357
+
358
+ **Will it slow down my editor?**
359
+ The MCP server is idle until your agent calls a tool. Tool calls are sub-millisecond after the first lazy load. Watch mode adds ~3–10 ms per file save.
360
+
361
+ **What happens to the graph when I switch branches?**
362
+ If you use `git worktree`, you automatically get a separate graph per worktree. On a single working copy that you switch with `git checkout`, the graph reflects the last `gp_index` (or watch-mode updates). Run `gp_index` after a branch switch to refresh.
363
+
364
+ **Do I need to re-index every session?**
365
+ No. The graph persists at `~/.graphpilot/<repo-id>/graph.json`. Re-index after sweeping changes; otherwise, watch mode keeps it fresh incrementally.
366
+
367
+ **Why TypeScript/JavaScript first?**
368
+ That's where the maintainer's pain was, and tree-sitter-typescript covers TS, TSX, JSX, and JS in a single grammar. Python is the next likely addition; vote with a GitHub Discussion.
369
+
370
+ **How does this compare to LSP?**
371
+ LSPs are scoped to one editor and one buffer at a time, and they re-compute on each query. GraphPilot is editor-agnostic, persists across sessions, and answers structural questions (who-calls, blast-radius) that LSPs don't expose uniformly.
116
372
 
117
373
  ## Documentation
118
374
 
119
- - [docs/quickstart.md](docs/quickstart.md) — 5-minute walkthrough
120
- - [docs/mcp-setup.md](docs/mcp-setup.md) — per-client config
121
- - [docs/architecture.md](docs/architecture.md) — how the pipeline works
122
- - [docs/limitations.md](docs/limitations.md) — v1 caveats (read this)
123
- - [bench/README.md](bench/README.md) — benchmark methodology + results
375
+ - [`docs/quickstart.md`](docs/quickstart.md) — 5-minute walkthrough
376
+ - [`docs/mcp-setup.md`](docs/mcp-setup.md) — per-client config reference
377
+ - [`docs/architecture.md`](docs/architecture.md) — pipeline writeup with file refs
378
+ - [`docs/limitations.md`](docs/limitations.md) — v1 caveats (read this)
379
+ - [`bench/README.md`](bench/README.md) — benchmark methodology + results
380
+ - [`examples/`](examples/) — ready-to-paste configs for every supported client
124
381
 
125
382
  ## Contributing
126
383
 
127
- We welcome contributions. See [CONTRIBUTING.md](CONTRIBUTING.md) before
128
- opening a PR.
384
+ GraphPilot is small, opinionated, and accepting contributions. Start with [`CONTRIBUTING.md`](CONTRIBUTING.md) — especially the _"What we are NOT doing in v1"_ section before you propose a feature.
385
+
386
+ Found a security issue? Please follow [`SECURITY.md`](SECURITY.md) instead of opening a public issue.
129
387
 
130
388
  ## License
131
389
 
package/dist/cli.js CHANGED
@@ -13,6 +13,7 @@ Usage:
13
13
  graphpilot status <path> Show info about an indexed repo
14
14
  graphpilot watch <path> Watch the repo and update the index on save
15
15
  graphpilot mcp Start the MCP server (stdio)
16
+ graphpilot init Drop routing-rules files for detected editors
16
17
  graphpilot help Show this help
17
18
 
18
19
  Examples:
@@ -20,6 +21,10 @@ Examples:
20
21
  graphpilot status .
21
22
  graphpilot watch . # keeps the index fresh as you edit
22
23
  graphpilot mcp # used by MCP clients (Claude Code, Cursor, ...)
24
+ graphpilot init # auto-detect editors and write routing rules
25
+ graphpilot init --all # write rules for all supported editors
26
+ graphpilot init --client cursor --path /my/repo
27
+ graphpilot init --dry-run # preview what would be written
23
28
  `;
24
29
  async function cmdIndex(pathArg, opts = {}) {
25
30
  const requested = resolve(pathArg);
@@ -144,6 +149,21 @@ async function main() {
144
149
  await watcher.stop();
145
150
  return 0;
146
151
  }
152
+ case 'init': {
153
+ const { runInit } = await import('./init.js');
154
+ const allFlag = rest.includes('--all');
155
+ const dryRun = rest.includes('--dry-run');
156
+ const pathIdx = rest.indexOf('--path');
157
+ const pathArg = pathIdx !== -1 ? rest[pathIdx + 1] : undefined;
158
+ const clientIdx = rest.indexOf('--client');
159
+ const clientArg = clientIdx !== -1 ? rest[clientIdx + 1] : undefined;
160
+ const repoPath = resolve(pathArg ?? '.');
161
+ const clients = clientArg
162
+ ? [clientArg]
163
+ : undefined;
164
+ await runInit({ repoPath, clients, all: allFlag, dryRun });
165
+ return 0;
166
+ }
147
167
  case 'help':
148
168
  case '--help':
149
169
  case '-h':
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAA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CAAC,CAAC;YAC3C,MAAM,SAAS,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACrE,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;YACzC,MAAM,OAAO,GAAG,SAAS;gBACvB,CAAC,CAAE,CAAC,SAAS,CAA8C;gBAC3D,CAAC,CAAC,SAAS,CAAC;YACd,MAAM,OAAO,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YAC3D,OAAO,CAAC,CAAC;QACX,CAAC;QACD,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,SAAS;YACZ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3B,OAAO,CAAC,CAAC;QACX;YACE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC;YAC3D,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,IAAI,CACT,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAC5B,CAAC,GAAG,EAAE,EAAE;IACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CACF,CAAC"}
package/dist/indexer.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import fg from 'fast-glob';
2
2
  import { realpathSync } from 'node:fs';
3
- import { resolve, relative } from 'node:path';
3
+ import { resolve, relative, sep } from 'node:path';
4
4
  import { parseFile } from './parser.js';
5
5
  import { extractSymbols } from './symbols.js';
6
6
  import { extractRawCalls, resolveCallEdges } from './edges.js';
@@ -61,7 +61,7 @@ export async function indexDirectory(rootPath, opts = {}) {
61
61
  filesFailed++;
62
62
  continue;
63
63
  }
64
- if (!realFile.startsWith(realRoot)) {
64
+ if (realFile !== realRoot && !realFile.startsWith(realRoot + sep)) {
65
65
  filesSkippedSymlink++;
66
66
  continue;
67
67
  }
@@ -71,7 +71,7 @@ export async function indexDirectory(rootPath, opts = {}) {
71
71
  const fileSymbols = extractSymbols(parsed);
72
72
  const fileCalls = extractRawCalls(parsed, fileSymbols);
73
73
  if (useRelative) {
74
- const rel = relative(absRoot, file);
74
+ const rel = relative(absRoot, file).split(sep).join('/');
75
75
  // Track id rewrites so call edges can be remapped in lockstep.
76
76
  const idRewrites = new Map();
77
77
  for (const s of fileSymbols) {
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.js","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAqB,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAA+B,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAgB,MAAM,UAAU,CAAC;AA4BrD,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAE/F,MAAM,cAAc,GAAG;IACrB,oBAAoB;IACpB,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,gBAAgB;IAChB,aAAa;IACb,aA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