@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.
- package/CHANGELOG.md +73 -126
- package/README.md +359 -101
- package/dist/cli.js +20 -0
- package/dist/cli.js.map +1 -1
- package/dist/indexer.js +3 -3
- package/dist/indexer.js.map +1 -1
- package/dist/init.d.ts +28 -0
- package/dist/init.js +112 -0
- package/dist/init.js.map +1 -0
- package/dist/interactions.d.ts +5 -4
- package/dist/interactions.js +0 -0
- package/dist/interactions.js.map +1 -1
- package/dist/mcp.js +126 -46
- package/dist/mcp.js.map +1 -1
- package/dist/repo-resolve.d.ts +47 -0
- package/dist/repo-resolve.js +195 -0
- package/dist/repo-resolve.js.map +1 -0
- package/dist/storage.js +10 -1
- package/dist/storage.js.map +1 -1
- package/dist/validation.js +30 -4
- package/dist/validation.js.map +1 -1
- package/dist/watcher.d.ts +10 -0
- package/dist/watcher.js +70 -7
- package/dist/watcher.js.map +1 -1
- package/examples/README.md +105 -0
- package/examples/claude-code/README.md +125 -0
- package/examples/claude-code/claude-routing.md +102 -0
- package/examples/claude-code/claude_config.json +8 -0
- package/examples/cline/.clinerules +39 -0
- package/examples/cline/README.md +104 -0
- package/examples/cline/cline_mcp_settings.json +10 -0
- package/examples/continue/.continuerules +39 -0
- package/examples/continue/README.md +98 -0
- package/examples/continue/config.json +13 -0
- package/examples/cursor/.cursorrules +39 -0
- package/examples/cursor/README.md +98 -0
- package/examples/cursor/mcp.json +11 -0
- package/examples/windsurf/.windsurfrules +39 -0
- package/examples/windsurf/README.md +85 -0
- package/examples/windsurf/mcp_config.json +8 -0
- package/package.json +12 -3
- package/.editorconfig +0 -15
- package/.github/CODEOWNERS +0 -22
- package/.github/FUNDING.yml +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
- package/.github/ISSUE_TEMPLATE/config.yml +0 -5
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -23
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -19
- package/.github/dependabot.yml +0 -15
- package/.github/workflows/ci.yml +0 -62
- package/.github/workflows/release.yml +0 -50
- package/.prettierignore +0 -19
- package/.prettierrc.json +0 -20
- package/CODE_OF_CONDUCT.md +0 -83
- package/CONTRIBUTING.md +0 -111
- package/bench/README.md +0 -544
- package/bench/results/agent-tier-2026-05-22.md +0 -28
- package/bench/results/agent-tier-summary.md +0 -44
- package/bench/results/baseline-tier-2026-05-22.md +0 -23
- package/bench/results/baseline.json +0 -810
- package/bench/results/baseline.md +0 -28
- package/bench/run-agent-tier-automated.ts +0 -234
- package/bench/run-agent-tier.md +0 -125
- package/bench/run-baseline-tier.ts +0 -200
- package/bench/run.ts +0 -210
- package/bench/runner-baseline.ts +0 -177
- package/bench/runner-graphpilot.ts +0 -131
- package/bench/score-agent-tier.ts +0 -191
- package/bench/score.ts +0 -59
- package/bench/tasks.ts +0 -236
- package/dist/provenance.d.ts +0 -74
- package/dist/provenance.js +0 -95
- package/dist/provenance.js.map +0 -1
- package/docs/architecture.md +0 -311
- package/docs/limitations.md +0 -156
- package/docs/mcp-setup.md +0 -231
- package/docs/quickstart.md +0 -202
- package/eslint.config.js +0 -148
- package/lefthook.yml +0 -81
- package/pnpm-workspace.yaml +0 -6
- package/scripts/smoke-stdio.mjs +0 -97
- package/src/cli.ts +0 -171
- package/src/edges.ts +0 -202
- package/src/git.ts +0 -255
- package/src/graph-schema.ts +0 -229
- package/src/impact.ts +0 -218
- package/src/indexer.ts +0 -152
- package/src/interactions.ts +0 -0
- package/src/mcp.ts +0 -652
- package/src/parser.ts +0 -138
- package/src/provenance.ts +0 -115
- package/src/query.ts +0 -148
- package/src/redact.ts +0 -122
- package/src/storage.ts +0 -115
- package/src/symbols.ts +0 -173
- package/src/validation.ts +0 -69
- package/src/validators.ts +0 -253
- package/src/watcher.ts +0 -383
- package/tests/edges.test.ts +0 -175
- package/tests/fixtures/sample.ts +0 -32
- package/tests/git.test.ts +0 -303
- package/tests/graph-schema.test.ts +0 -321
- package/tests/impact.test.ts +0 -454
- package/tests/interactions.test.ts +0 -180
- package/tests/lint-policy.test.ts +0 -106
- package/tests/mcp-stdio.test.ts +0 -171
- package/tests/mcp.test.ts +0 -335
- package/tests/parser.test.ts +0 -31
- package/tests/provenance.test.ts +0 -132
- package/tests/query.test.ts +0 -160
- package/tests/redact.test.ts +0 -167
- package/tests/security.test.ts +0 -144
- package/tests/symbols.test.ts +0 -78
- package/tests/validators.test.ts +0 -193
- package/tests/watcher.test.ts +0 -250
- package/tsconfig.json +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -2,137 +2,84 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
6
|
|
|
8
7
|
## [Unreleased]
|
|
9
8
|
|
|
10
9
|
### Added
|
|
11
10
|
|
|
12
|
-
- **
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
whole symbol table, save atomically. Real-world 3–5 ms per save on
|
|
59
|
-
small repos. Updates serialize through an internal chain so chokidar
|
|
60
|
-
bursts can't race into a torn graph. Storage writes are atomic
|
|
61
|
-
(`.tmp` + rename) so a crash never leaves a half-written graph.json.
|
|
62
|
-
CLI runs until SIGINT.
|
|
63
|
-
- Reproducible benchmark (Tier A): `pnpm bench` runs 10 hand-curated
|
|
64
|
-
structural tasks against GraphPilot's own codebase (the corpus) and
|
|
65
|
-
scores precision/recall/F1 + bytes processed vs a grep-simulator
|
|
66
|
-
baseline. Anyone with `pnpm install` can reproduce. First run:
|
|
67
|
-
**F1 0.89 vs grep 0.42, 99.9 % byte reduction (721 B vs 528 KB),
|
|
68
|
-
7 wins / 2 ties / 1 expected loss** (the string-literal task,
|
|
69
|
-
deliberately included as the honest "grep wins" case). Spec for the
|
|
70
|
-
agent-eval Tier B is in `bench/run-agent-tier.md`.
|
|
71
|
-
- Contributor Covenant 2.1 code of conduct (closes GitHub Community
|
|
72
|
-
Standards check). Reporting email is `codewithakki@gmail.com`;
|
|
73
|
-
|
|
74
|
-
### Dev workflow
|
|
75
|
-
|
|
76
|
-
- Pre-commit hooks via `lefthook` (added 2026-05-20):
|
|
77
|
-
- `pre-commit`: `pnpm typecheck` + ESLint + `prettier --check` on
|
|
78
|
-
staged source files (parallel). Hits sub-second on small changes.
|
|
79
|
-
- `commit-msg`: Conventional Commits regex enforcement. Bad messages
|
|
80
|
-
get a friendly error pointing at the format spec. Allows
|
|
81
|
-
`Merge`/`Revert`/`fixup!`/`squash!` for ergonomics.
|
|
82
|
-
- `pre-push`: full `pnpm test`. Stops broken builds from reaching
|
|
83
|
-
the remote.
|
|
84
|
-
- Bypass for emergencies: `LEFTHOOK=0 git commit` or
|
|
85
|
-
`LEFTHOOK_EXCLUDE=<jobname> git commit`. Installed automatically by
|
|
86
|
-
`pnpm install`; no manual `lefthook install` required.
|
|
87
|
-
- Prettier configured (added 2026-05-20): `.prettierrc.json` + scripts
|
|
88
|
-
`pnpm format` / `pnpm format:check`. Single quotes, trailing commas,
|
|
89
|
-
100-col print width, LF endings. Normalized 31 files in one mechanical
|
|
90
|
-
pass; wired into `pnpm check` and the lefthook pre-commit so future
|
|
91
|
-
drift gets blocked.
|
|
92
|
-
- Hand-rolled input validation for every MCP tool (no deps). Rejects unknown
|
|
93
|
-
fields, type errors, out-of-range numbers, oversize strings.
|
|
94
|
-
- Interaction log (`~/.graphpilot/<repo-id>/interactions.jsonl`): every tool
|
|
95
|
-
call recorded locally with sanitized inputs. Enables future ranking /
|
|
96
|
-
personalization. Disabled via `GRAPHPILOT_NO_LOG=1`. Mode 0600.
|
|
11
|
+
- **MCP workspace roots** — on connect, GraphPilot calls `roots/list` (when the client supports it) and uses workspace folders as the default repo path for tool calls.
|
|
12
|
+
- **Default path discovery** — when `path` is omitted, resolution tries `GRAPHPILOT_ROOT`, MCP roots, walking parents of `cwd`, a unique index under `~/.graphpilot`, then `cwd`. Errors list known indexes on the machine.
|
|
13
|
+
- Project-level **`.cursor/mcp.json`** template with `${workspaceFolder}` for local development.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- MCP tool schemas document the new default path behaviour instead of “Default: cwd”.
|
|
18
|
+
|
|
19
|
+
## [0.1.0] — 2026-05-23
|
|
20
|
+
|
|
21
|
+
Initial public release. GraphPilot is a local-first, refactor-safe code graph for coding agents over the Model Context Protocol.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
#### Core engine
|
|
26
|
+
|
|
27
|
+
- Tree-sitter parser for **TypeScript, TSX, JavaScript, JSX** with a 5 MB per-file size cap and an iterative AST walk (safe on deeply-nested generated code).
|
|
28
|
+
- Symbol extraction for functions, classes, methods, interfaces, type aliases, and enums. Stable symbol ids of the form `<file>#<parent>.<name>@<line>`.
|
|
29
|
+
- Call-edge extraction with a two-pass name resolver — same-file first, then first global match. Unresolved external calls (`JSON.parse`, stdlib, third-party) keep their `toName` so the agent still sees the call site.
|
|
30
|
+
- Directory indexer with sensible default ignores (`node_modules`, `dist`, `build`, `.git`, `coverage`, `.next`, `.nuxt`, `.cache`, `out`, `*.d.ts`), a 50 000-file hard cap, and symlink-escape protection.
|
|
31
|
+
- Query layer (`GraphIndex`) with four pre-computed maps (`byName`, `byId`, `callers`, `callees`). Sub-millisecond lookups on indexed repos.
|
|
32
|
+
- JSON storage at `~/.graphpilot/<repo-id>/graph.json` (mode `0600`) with versioned schema and atomic writes.
|
|
33
|
+
- Worktree-aware indexing: subdirectory invocations auto-resolve to the git worktree top, so two `git worktree add`-ed branches naturally produce two separate indexes. Opt out with `--no-worktree`.
|
|
34
|
+
|
|
35
|
+
#### MCP server (five tools)
|
|
36
|
+
|
|
37
|
+
- `gp_index` — re-index a repo from inside the agent.
|
|
38
|
+
- `gp_recall` — find symbols by name (exact case-insensitive by default, substring opt-in).
|
|
39
|
+
- `gp_callers` — list callers or callees of a symbol, with a `direction` parameter.
|
|
40
|
+
- `gp_impact` — blast-radius analysis: direct + transitive callers (BFS, depth 1–5), tests likely affected, public-API flag, summary stats. Accepts `since: <commit|tag|branch>` for PR-scoped impact via `isomorphic-git` (pure JS, no shell-out).
|
|
41
|
+
- `gp_stats` — health probe: repo id, `indexedAt`, file/symbol/edge counts.
|
|
42
|
+
|
|
43
|
+
#### Evidence anchors
|
|
44
|
+
|
|
45
|
+
Every MCP tool response includes `file:line @ <short-sha>` provenance on each symbol and call edge, so the agent can quote a verifiable reference. Old graphs without `indexedSha` continue to load (the field is optional in the schema).
|
|
46
|
+
|
|
47
|
+
#### Watch mode
|
|
48
|
+
|
|
49
|
+
`graphpilot watch <path>` keeps the index fresh as you edit. Uses `chokidar` with editor-save debouncing; each save triggers an incremental update (re-parse one file, re-resolve edges, atomic save) at 3–10 ms per save on small repos. Updates serialize through an internal chain to prevent torn graphs during chokidar bursts.
|
|
50
|
+
|
|
51
|
+
#### CLI
|
|
52
|
+
|
|
53
|
+
- `graphpilot index <path>` — index a repo
|
|
54
|
+
- `graphpilot status <path>` — show what's indexed
|
|
55
|
+
- `graphpilot watch <path>` — keep the index fresh
|
|
56
|
+
- `graphpilot mcp` — start the MCP server over stdio
|
|
97
57
|
|
|
98
58
|
### Security
|
|
99
59
|
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
- Symlink-escape protection: `followSymbolicLinks: false` + realpath bounds check
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- Tier-B agent benchmark — Claude-Code-in-the-loop scoring on real
|
|
127
|
-
refactor tasks; produces the "X/10 vs Y/10" headline. Spec in
|
|
128
|
-
[`bench/run-agent-tier.md`](bench/run-agent-tier.md).
|
|
129
|
-
- `release.yml` workflow + npm publish on tag.
|
|
130
|
-
- CodeQL + dependency-review workflows.
|
|
131
|
-
- Branch protection on `main` (GitHub web UI step).
|
|
132
|
-
- Hero GIF + 30-second demo video.
|
|
133
|
-
- Domain + landing page.
|
|
134
|
-
- MCP registry submissions (Glama, PulseMCP, mcpservers.org,
|
|
135
|
-
`awesome-mcp-servers`).
|
|
136
|
-
- `examples/<each-client>/` scaffolds.
|
|
137
|
-
|
|
138
|
-
[Unreleased]: https://github.com/graphpilot-oss/graphpilot/commits/main
|
|
60
|
+
- Hand-rolled input validators on every MCP tool (zero deps): reject unknown fields, type-check every field, range-check numbers, length-cap strings, strict enums.
|
|
61
|
+
- Refuses to index dangerous roots: `/`, `/etc`, `/var`, `~`, `/Users`, `/home`, Windows system paths, macOS-resolved aliases (`/private/etc`, etc.).
|
|
62
|
+
- Symlink-escape protection: `followSymbolicLinks: false` + per-file realpath bounds check.
|
|
63
|
+
- File-size cap (5 MB) and file-count cap (50 000) per index.
|
|
64
|
+
- Storage permissions: directories `0o700`, files `0o600`.
|
|
65
|
+
- Pattern-based secret redaction at signature-extraction time (`src/redact.ts`): OpenAI/Anthropic `sk-`, GitHub `ghp_`/`ghs_`, AWS `AKIA`, JWTs, PEM private-key headers, Slack tokens, Stripe live keys, plus a defensive long-token catch-all.
|
|
66
|
+
- Schema validation on `graph.json` load: strict shape check, version enforcement, per-entry sanitization, recomputed counts (attacker-supplied counts are ignored). Falls back to "no index" on rejection.
|
|
67
|
+
- ESLint policy enforcing **no network in `src/`** at the build gate. Bans `http`, `https`, `undici`, `axios`, `node-fetch`, `cross-fetch`, `got`, `request`, `superagent`, plus `child_process`. Meta-tests in `tests/lint-policy.test.ts` prove the rule fires on every banned import.
|
|
68
|
+
|
|
69
|
+
### Observability
|
|
70
|
+
|
|
71
|
+
- Interaction log at `~/.graphpilot/<repo-id>/interactions.jsonl` (mode `0600`): every tool call records sanitized inputs, result count, duration, and any error. Disable with `GRAPHPILOT_NO_LOG=1`. v0.1 does not read this log — it exists so future ranking and personalization have local-only training data.
|
|
72
|
+
|
|
73
|
+
### Benchmarks
|
|
74
|
+
|
|
75
|
+
Reproducible Tier-A and Tier-B benchmarks (see [`bench/README.md`](bench/README.md)). On GraphPilot's own codebase:
|
|
76
|
+
|
|
77
|
+
- Tier A: F1 **0.89** vs grep **0.42**, 99.9 % fewer bytes read (721 B vs 528 KB), 7 wins / 2 ties / 1 deliberate loss.
|
|
78
|
+
- Tier B (simulated): 7/13 tasks vs grep 4/13 (+75 %), mean F1 0.70 vs 0.33, 6 hallucinations vs 480, 100 % evidence-anchor citation rate.
|
|
79
|
+
|
|
80
|
+
### Documentation
|
|
81
|
+
|
|
82
|
+
- README, [quickstart](docs/quickstart.md), [MCP setup](docs/mcp-setup.md), [architecture](docs/architecture.md), [limitations](docs/limitations.md), CONTRIBUTING, SECURITY, CODE_OF_CONDUCT.
|
|
83
|
+
|
|
84
|
+
[Unreleased]: https://github.com/graphpilot-oss/graphpilot/compare/v0.1.0...HEAD
|
|
85
|
+
[0.1.0]: https://github.com/graphpilot-oss/graphpilot/releases/tag/v0.1.0
|