Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
572d22b
fix(installer): Codex TOML block finder preserves trailing array-of-t…
KtzeAbyss Jul 22, 2026
490791c
feat(installer): GitHub Copilot targets — VS Code, Copilot CLI, JetBr…
colbymchenry Jul 23, 2026
234dfe6
fix(installer): copilot-cli detection false-positived on VS Code's ~/…
colbymchenry Jul 24, 2026
7331321
fix(installer): warn that copilot-vscode global installs need an open…
colbymchenry Jul 24, 2026
9769d6b
fix(installer): copilot-vscode global entry drops ${workspaceFolder} …
colbymchenry Jul 24, 2026
0682137
fix(installer): write the Claude prompt hook as codegraph.cmd on Wind…
colbymchenry Jul 31, 2026
02c0e2c
fix(db): stop watchdog-killed sessions from leaking the SQLite WAL wi…
colbymchenry Aug 1, 2026
f2a5df3
fix(mcp): never serve a mis-sliced symbol body from a file that drift…
colbymchenry Aug 1, 2026
38580e0
fix(python): bare class references produce references edges to classe…
colbymchenry Aug 1, 2026
f6ac7b3
fix(mcp): blast radius follows caller chains before claiming no test …
colbymchenry Aug 1, 2026
49c11fc
Self-hosted telemetry on Cloudflare D1 + password-gated admin dashboa…
colbymchenry Aug 1, 2026
3cb774a
fix(telemetry-dashboard): accept Origin: null on login — our own no-r…
colbymchenry Aug 1, 2026
b37f191
feat(mcp): per-file allocation diagnostic for explore (CG-4)
colbymchenry Aug 4, 2026
16e1749
feat(extraction): content-based generated-file detection (CG-5, #1500)
colbymchenry Aug 4, 2026
bd86ad2
test(explore): #1500 regression fixtures for budget allocation (CG-6)
colbymchenry Aug 4, 2026
a3898cd
feat(mcp): relevance scoring overhaul for explore — kill incidental n…
colbymchenry Aug 4, 2026
5f7f5f5
feat(mcp): score-proportional byte allocation for explore, with a rel…
colbymchenry Aug 4, 2026
1d9206d
test(explore): lock down proportional byte allocation (CG-14, #1500)
colbymchenry Aug 4, 2026
48a2309
test(agent-eval): RUNS knob + explore envelope-share view for new-vs-…
colbymchenry Aug 4, 2026
edce18f
test(agent-eval): restore the engine on INT/TERM too (CG-15)
colbymchenry Aug 4, 2026
c7103c7
docs: CG-15 agent A/B of the #1500 allocation change — gate fails on …
colbymchenry Aug 4, 2026
8077b83
docs: consolidate the #1500 CHANGELOG entries into user-facing shape …
colbymchenry Aug 4, 2026
fa7fb8d
fix(explore): spend the reservation instead of dropping it (CG-21, #1…
colbymchenry Aug 4, 2026
51cd053
docs: CG-21 — spending the reservation (design record + CHANGELOG pre…
colbymchenry Aug 4, 2026
fca7d87
fix(explore): a funded whole-file buy must also fit the render ceilin…
colbymchenry Aug 4, 2026
abee46c
docs: CG-21 A/B — the gate passes, all four bars (#1500)
colbymchenry Aug 4, 2026
c65d56c
docs: CG-22 — the epic's gate, re-run at CG-15's exact setup (#1500)
colbymchenry Aug 4, 2026
4080b75
test(agent-eval): measure residual context occupancy, over multi-turn…
colbymchenry Aug 4, 2026
9b4df21
test(agent-eval): price codegraph's fixed context cost alongside its …
colbymchenry Aug 4, 2026
4d5f8d3
test(agent-eval): report the occupancy metric's own error bar (CG-7)
colbymchenry Aug 4, 2026
b93c8d2
test(agent-eval): self-test the occupancy math, and fix ratio calibra…
colbymchenry Aug 4, 2026
77845c7
test(agent-eval): show every run's residual and tool mix, not just th…
colbymchenry Aug 4, 2026
af3ce39
test(agent-eval): drop the duplicated fixed-overhead line (CG-7)
colbymchenry Aug 4, 2026
257a7b7
test(agent-eval): RUN_FROM, to extend a pass without redoing finished…
colbymchenry Aug 4, 2026
d3c01ce
test(agent-eval): stop the arms reaching codegraph through the shell …
colbymchenry Aug 4, 2026
e35d486
test(agent-eval): block the codegraph CLI outright — hiding it from P…
colbymchenry Aug 4, 2026
1d33301
test(agent-eval): count blocked CLI attempts apart from real contamin…
colbymchenry Aug 4, 2026
52b194a
merge main into CG-3: keep the envelope view alongside occupancy
colbymchenry Aug 5, 2026
a2a916e
test(agent-eval): bucket every explore by what the agent did next (CG-8)
colbymchenry Aug 5, 2026
945e52f
docs: explore sufficiency -- the metric, its rules, what it caught (C…
colbymchenry Aug 5, 2026
254e573
docs: the 7-repo bucket baseline, and the recall case by hand (CG-8)
colbymchenry Aug 5, 2026
db3b8d2
test(agent-eval): report what share of explore's bytes the answer use…
colbymchenry Aug 5, 2026
fa15d10
docs: allocation efficiency — the metric, its guards, and the 103-run…
colbymchenry Aug 5, 2026
3e8922d
test(agent-eval): report all three feedback metrics per arm, side by …
colbymchenry Aug 5, 2026
382791f
docs: one entry point for the three feedback metrics, and how to run …
colbymchenry Aug 5, 2026
520ed9d
test(agent-eval): report residual direction by sign, not by hope (CG-13)
colbymchenry Aug 5, 2026
5dd4db6
docs: the occupancy baseline says our residual is higher — write that…
colbymchenry Aug 5, 2026
fc31b1e
feat(mcp): remember what explore already served this session (CG-17)
colbymchenry Aug 5, 2026
4e94860
docs: the session-state layer — its four constraints and which way to…
colbymchenry Aug 5, 2026
ab38d1f
feat(explore): point at source this session already sent, don't send …
colbymchenry Aug 5, 2026
7a7ea30
docs: cross-call dedup — its gates, where the bytes go, and the all-p…
colbymchenry Aug 5, 2026
2cfd321
docs: CG-20 — the dedup gate, three bars pass and the fourth cannot (…
colbymchenry Aug 5, 2026
48cbc21
merge: cross-call explore session dedup (CG-2, #1500)
colbymchenry Aug 5, 2026
a7db24d
docs(readme): disclose the context-footprint side of the benchmark
colbymchenry Aug 5, 2026
04c0f8e
test(agent-eval): sum tokens per turn — result.usage stopped being cu…
colbymchenry Aug 6, 2026
da1f612
docs(readme): benchmark table from the corrected 2026-08-05 re-measure
colbymchenry Aug 6, 2026
d6d1728
docs(benchmarks): re-derive the token figures the result.usage bug to…
colbymchenry Aug 6, 2026
2cf63fd
CG-33: record index-drift measurement and add a drift diff tool
colbymchenry Aug 6, 2026
765c06a
fix(explore): bound how far an oversize cluster member may overshoot …
colbymchenry Aug 6, 2026
85e9ac6
fix(c,cpp,objc,rust): index union declarations
ctype-lab Aug 6, 2026
d652c14
docs(cg-30): changelog entry + record the self-query probe flip honestly
colbymchenry Aug 6, 2026
11acc50
test(union): regression cases + kernel-parity torture coverage
ctype-lab Aug 6, 2026
86854cd
docs(union): changelog entry + port-checklist annotations
ctype-lab Aug 6, 2026
cd1ea27
fix(explore): restore the CG-30 bound d652c14 reverted
colbymchenry Aug 6, 2026
0d014a6
docs(benchmarks): record the CG-30 A/B — deterministic win, no behavi…
colbymchenry Aug 6, 2026
089dcc2
fix(explore): hold back what is still owed below a clustered render (…
colbymchenry Aug 6, 2026
f1fecb8
fix(explore): fund the guard from room that exists, and cut the epilo…
colbymchenry Aug 6, 2026
6978acc
feat(extraction): model union declarations distinctly
ctype-lab Aug 6, 2026
8e3cde6
feat(kernel): preserve union nodes across extraction
ctype-lab Aug 6, 2026
ba58365
docs(union): describe first-class union nodes
ctype-lab Aug 6, 2026
e922563
fix(resolution): recognize union instantiation
ctype-lab Aug 6, 2026
be7c968
docs(benchmarks): record the CG-31 A/B — no regression, four repos st…
colbymchenry Aug 6, 2026
c54e008
fix(explore): keep the drift warning out of the cuttable epilogue (CG…
colbymchenry Aug 6, 2026
7cbde95
fix(explore): pay every admitted file on every render path (CG-26)
colbymchenry Aug 6, 2026
e219594
fix(union): complete downstream container handling
ctype-lab Aug 6, 2026
5f32478
docs(benchmarks): record the CG-26 A/B — the invariant holds on every…
colbymchenry Aug 6, 2026
03893b0
CG-33: converge incremental sync with a full rebuild
colbymchenry Aug 6, 2026
02ee151
CG-35: give the sync-convergence suite teeth against the rebind pass
colbymchenry Aug 6, 2026
57e0854
fix(explore): recognize Wrangler-style "generated by … by running" ba…
colbymchenry Aug 6, 2026
8bb0f53
merge: explore allocation — bounded overshoot, displacement guard, ex…
colbymchenry Aug 6, 2026
dc4fd75
merge: recognize Wrangler-style generated banners (CG-25)
colbymchenry Aug 6, 2026
d492650
test(explore): add the factory-closure fixture and its selection prob…
colbymchenry Aug 6, 2026
91cb5b4
measure(explore): the factory-closure envelope premise does not hold …
colbymchenry Aug 6, 2026
463f6e7
merge: factory-closure envelope premise measured and rejected (CG-27)
colbymchenry Aug 6, 2026
9efae0f
fix(explore): damp ambient declaration files on flow queries (CG-28)
colbymchenry Aug 6, 2026
ed6c56f
merge: damp undepended-on ambient declaration files on flow queries (…
colbymchenry Aug 6, 2026
76ab1fe
docs(benchmarks): record the CG-24 epic resolution
colbymchenry Aug 6, 2026
eed1644
fix(explore): shrink a later cluster into the remainder instead of dr…
colbymchenry Aug 6, 2026
10f1ac6
docs(benchmarks): record the CG-36 cluster-starvation measurement
colbymchenry Aug 6, 2026
8a46234
merge: shrink a later cluster into the remainder instead of dropping …
colbymchenry Aug 6, 2026
07338ff
docs(benchmarks): record CG-38 as open, and correct the regression claim
colbymchenry Aug 7, 2026
969ea1e
Merge pull request #1525 from colbymchenry/feature/CG-24
colbymchenry Aug 7, 2026
89c53dd
fix(explore): guarantee an agent-named symbol renders, wherever it si…
colbymchenry Aug 7, 2026
2c708ca
Merge branch 'main' into feature/CG-35
colbymchenry Aug 7, 2026
fa8a3d7
Merge pull request #1526 from colbymchenry/feature/CG-35
colbymchenry Aug 7, 2026
99f2ebf
Merge pull request #1527 from colbymchenry/bugfix/CG-38
colbymchenry Aug 7, 2026
1b36132
Merge pull request #1498 from colbymchenry/bugfix/CG-16
colbymchenry Aug 7, 2026
2962e7e
feat(mcp): surface supported languages in MCP server instructions (#671)
colbymchenry Aug 7, 2026
c84ce55
Merge pull request #1528 from colbymchenry/issue/671-mcp-supported-la…
colbymchenry Aug 7, 2026
493d421
Merge branch 'main' into feat/copilot-installer-targets
colbymchenry Aug 7, 2026
222f82b
Merge pull request #1440 from colbymchenry/feat/copilot-installer-tar…
colbymchenry Aug 7, 2026
5b0c4b8
fix(resolution): trait dispatch reaches union implementors (#1515)
colbymchenry Aug 8, 2026
d289bf8
Merge main into fix/union-declarations-not-indexed
colbymchenry Aug 8, 2026
c6aaa20
Merge pull request #1516 from ctype-lab/fix/union-declarations-not-in…
colbymchenry Aug 8, 2026
38d1f97
Merge upstream main (c6aaa20) into fork main
Dshuishui Aug 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .claude/skills/agent-eval/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ scripts/agent-eval/audit.sh <VERSION> <repo-name> <repo-url> "<question>" <MODE>
codegraph-tool calls, duration, **total cost**.
- Interactive (`parse-session.mjs`): the `VERDICT: codegraph_explore used Nx |
Read N | Grep/Bash N` and `TOKENS:` lines.
- Both paths also print the three feedback metrics — residual context occupancy,
explore sufficiency, allocation efficiency — and a headless A/B ends with a
side-by-side `ARM COMPARISON` table. Report that table, and check its
contamination row first: `CLI calls that RETURNED output` > 0 means the arm
reached codegraph through Bash and its numbers are void. How to read the rest:
`docs/benchmarks/agent-eval-feedback-metrics.md`.

Lead with cost + tool/Read counts — they are the reliable signals; raw token
in/out are confounded by subagent delegation and prompt caching. State whether
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ __tests__/zz-scratch*

# linux-arm64 kernel cross-build cache (rust:1-bookworm builder)
target-linux/
.kommandr/kommandr.db
.kommandr/kommandr.db-wal
.kommandr/kommandr.db-shm
Binary file removed .kommandr/kommandr.db
Binary file not shown.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,41 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### New Features

- Anonymous usage telemetry is now stored entirely on CodeGraph's own first-party infrastructure — no third-party analytics vendor receives any of it, and the endpoint that receives it makes no outbound requests at all. Individual events are deleted after 90 days, leaving only anonymous daily totals. Nothing about what is collected changed, your IP address is still never read or stored, and every off-switch works exactly as before (`codegraph telemetry off`, `CODEGRAPH_TELEMETRY=0`, `DO_NOT_TRACK=1`). `TELEMETRY.md` remains the complete field-by-field list.

- `codegraph_explore` no longer re-sends source it already returned earlier in the same conversation. A file it has already shown you comes back as a short pointer — the path, the symbols and the exact line range, with confirmation that the file hasn't changed since — and the space that frees is spent on code you haven't seen yet, so a follow-up call covers new ground instead of repeating the last one. If a file was edited in between, its source is always shown again in full. Set `CODEGRAPH_EXPLORE_DEDUP=0` to turn this off.

- When an agent connects over MCP, CodeGraph now states up front that it indexes 30+ languages — TypeScript/JavaScript, Python, Go, Rust, Java, C#, C/C++, PHP, Ruby, Swift, Kotlin, and more — so agents no longer assume a language isn't supported and skip the graph. (#671)

- GitHub Copilot is now a supported agent: `codegraph install` can configure Copilot Chat in VS Code (`copilot-vscode`), the GitHub Copilot CLI (`copilot-cli`), and the Copilot plugin in JetBrains IDEs (`copilot-jetbrains`). Installed Copilot surfaces are auto-detected like every other agent, existing MCP server entries in their config files are preserved, and `codegraph uninstall` reverses the setup cleanly. Restart VS Code or your JetBrains IDE after installing so Copilot picks up the server.

### Fixes

- C, C++, Objective-C and Rust unions are now indexed as first-class `union` nodes. A `union` declaration previously produced no symbol at all, so it never appeared in search or `codegraph_explore`, and anything attached to it disappeared with it — in Rust, every `impl SomeTrait for MyUnion` lost its edge, the methods from that impl were left pointing at a type the graph did not contain, and asking which types implement a trait quietly skipped the union ones. A union-shaped dispatch table in C now resolves its function pointers like a struct-shaped one. A `typedef union { … } Name;` in C keeps the typedef's name and is no longer mistaken for a plain type alias. Thanks @ctype-lab. Re-index after upgrading to pick up unions in existing projects. (#1515)

- A long-lived index no longer drifts away from what a fresh `codegraph index` would produce. When a file gained or lost a symbol, references to that name in files the sync never touched kept pointing at the definition that was correct before the change, and — because nothing distinguished two same-named definitions — the winner could come down to the order files happened to be written, which differs between a full index and a sync. On this project's own repository, replaying 80 commits through `sync` left 5.7% of connections wrong; it is now 1.3%, and the wrong-answers-still-being-asserted half drops by 99.7%. Since call edges are what flow questions follow and what `codegraph_explore` ranks files by, this quietly degraded answers as an index aged, with nothing to indicate it. Syncing is unchanged in speed, and an edit that only changes a function's body does no extra work at all. Set `CODEGRAPH_NO_REBIND=1` to opt out.
- `codegraph_explore` now concentrates its answer on the code that actually answers your question instead of spreading it across files that merely share a word with it, so more of the answer arrives in a single call. Thanks @LeDuyViet for the detailed measurements and reproduction. (#1500)
- Files only weakly related to your question now come back as a name, symbol and line number instead of spending the answer on their source — name one of them in a follow-up `codegraph_explore` to get it back in full. (#1500)
- A generated CRUD or protobuf layer no longer crowds out the hand-written code sitting beside it: generated files are now recognized by the `// Code generated by … DO NOT EDIT.` style banner written at the top of the file, not just by a filename that looks generated. Re-index after upgrading to pick up the new detection. (#1500)
- Test and spec files in a repository's top-level `test/` or `spec/` directory are now recognized as such, so they no longer take room from the code you asked about. (#1500)
- Generated type-declaration files that announce themselves with a "Generated by … by running …" banner — Cloudflare Wrangler's `worker-configuration.d.ts` is the common one — are now recognized as generated. Previously a file like that could take most of a `codegraph_explore` answer on nothing more than a few common words, pushing the hand-written code you asked about out of the response entirely. Re-index after upgrading to pick up the new detection.
- A hand-written type-declaration file — an ambient `.d.ts` of global shims, vendored typings, module augmentation — no longer takes over a `codegraph_explore` answer about how something works. Files like these declare common names (`Body`, `Message`, `ImageMetadata`) and nothing else, so a plainly-worded question could match one strongly enough that it ranked first and crowded the actual handler out of the answer. They are now ranked lower for questions about behaviour, and are still listed by name so one follow-up call fetches them. Asking about a type by name still returns its declaration first, and a shared types module the rest of your code imports is unaffected.
- A CodeGraph process that gets force-killed — by the stuck-process watchdog, a crash, or the OS — no longer leaves the database's write-ahead log behind to grow without bound. Previously each killed session stacked more data onto the same log file and nothing ever shrank it, which on machines where sessions were killed regularly could quietly eat tens of gigabytes of disk. The log is now capped, and any oversized leftover is reclaimed automatically the next time the project is opened. Thanks @tiendungdev for the exceptional Windows report that pinned this down. (#1431)
- The background server's watchdog no longer kills a healthy server that is just waiting on a slow disk: like indexing already does, it now checks whether the database files are still making progress before concluding the process is stuck. Fewer spurious kills also means fewer leftover write-ahead logs. (#1431)
- `codegraph status` now shows the write-ahead log's size next to the database size and warns when killed sessions have left it oversized, and every line in the background server's log now carries a timestamp so kills and restarts can be placed in time. (#1431)
- On Windows, the Claude Code prompt hook written by `codegraph install` failed with "command not found" when hooks run through Git Bash, which needs the `.cmd` extension to find the launcher. The installer now writes the platform-correct command, and re-running `codegraph install` (or `codegraph upgrade`) repairs an existing install in place. (#1466)
- Python classes used as values — `return SomeSerializer` from a factory method, `handler = SomeClass` aliases, registry dicts and lists, and classes passed as arguments — now produce reference edges in the graph. Previously these idioms were invisible, so on Django and Django REST Framework projects, asking for a serializer's callers or the impact of editing it missed the views that actually use it. Re-index after upgrading to pick up the new edges. (#1478)
- When a file changed on disk after its last index sync, `codegraph_node` and `codegraph_explore` could return a different symbol's code under the requested name — current file bytes cut at outdated line positions — while presenting it as verbatim, trustworthy source. This hit hardest on projects queried through `projectPath` (for example, sub-projects of a monorepo), which have no live file watcher to flag pending edits. Both tools now verify each file against the index before showing sliced code: an out-of-date file is either shown whole with its full current source, or its code is withheld with a clear "changed on disk" notice — never served as a wrong slice. A fresh re-index restores normal output automatically. Thanks @inth3shadows for the thorough report and verification passes. (#1474)
- A file built around one very long function no longer takes the whole `codegraph_explore` answer for itself — or disappears from it. Previously such a file was shown in full however big it was, which used up the room every file after it needed, and when the function was larger than the entire response the file was dropped without a word. These files now come back as a bounded window on whole lines — the signature and the top of the body, plus the call site when the call path runs through it — with the rest one follow-up `codegraph_explore` away.
- `codegraph_explore` no longer lets the first file in an answer spend the room set aside for the files below it, so the rest of the answer still arrives. Previously a large file near the top could quietly use up everything left, and the files ranked under it — each already judged relevant enough to include — were dropped with no source at all; on one question only one of six made it into the answer. Every file now keeps what it was given, and a question that really is about one file still concentrates on that file.
- When a `codegraph_explore` answer runs right up against its size limit, it now drops the trailing notes rather than a whole file's source. Previously the last file was cut even though trimming the notes alone would have fit, so a file that had already been read, ranked and rendered was thrown away at the last moment. Across a range of real projects this returns one more file and up to 20% more source per call.
- Every file `codegraph_explore` decides to include now actually arrives. A file shown in full could still spend room set aside for files below it — the fix above covered files shown as excerpts but not files shown whole — and the answer's own size bookkeeping under-counted each file's heading, so the answer ran past its limit and a fully prepared file was discarded at the end. A file that no longer fits whole is now shown as excerpts instead of vanishing, and one that overshoots by a little is trimmed to fit rather than dropped.
- The list of files an answer could not cover — the "explore these names for their source" pointers — is no longer thrown away when the answer is full. It is now budgeted for and trimmed to fit, so a full answer still tells you what it left out and which names to ask for next, instead of ending with no pointers at all.
- When a `codegraph_explore` answer shows a file as excerpts, a large excerpt that no longer fit was dropped entirely instead of being shortened. If the file's first excerpt happened to be a trivial one — an import block, a one-line helper next to the code you asked about — the excerpt carrying the actual answer was the one thrown away, and the file came back with a quarter of the room it had been given. On real projects that meant the top-ranked file delivered a fraction of its share while a far less relevant file took the rest. Excerpts are now shortened to fit, whole method by whole method, and only dropped when what is left is too small to hold anything readable.
- When you name a symbol in a `codegraph_explore` query, its definition now actually comes back. Two cases previously lost it. If the symbols you named don't call one another — sibling functions inside the same factory or module are the everyday example — CodeGraph stopped treating them as symbols you had asked for, and answered with whatever sat at the top of their file instead; on one 1,400-line file that meant a same-stem `QueuedMessage` interface on line 70 came back while the `queueMessage` function on line 1087 did not. And when an answer had to be trimmed to fit, it was trimmed from the bottom of the file down, so a symbol near the end of a long file was always the first thing cut. Trimming now protects the definitions you named wherever they sit in the file.
- The blast-radius section of `codegraph_explore` flagged "no covering tests found" whenever no test called a symbol directly — falsely branding helpers that tests exercise through their callers as untested (about 40% of flagged symbols in a measured sample). The check now follows caller chains up to 3 hops and reports indirect coverage as "tested via callers"; when nothing is found it states exactly what was checked instead of an unconditional warning. Thanks @inth3shadows for measuring the false-positive rate. (#1475)

## [1.5.0] - 2026-07-21

Expand Down Expand Up @@ -48,6 +83,7 @@ Full details in the entries below.

### Fixes

- Codex installs, upgrades, and uninstalls now preserve TOML array-of-table sections that appear after CodeGraph's MCP configuration instead of accidentally removing them. (#1351)
- TypeScript, TSX, and JavaScript files now parse with up-to-date grammars — modern syntax such as `using` declarations and import attributes no longer trips parse errors that could drop surrounding symbols. (The previously bundled grammars dated from 2023.)
- Rust files also parse with an up-to-date grammar now (the previously bundled build dated from 2023), which additionally sharpens method-call attribution: calls through struct fields resolve with receiver context instead of falling back to ambiguous bare-name matching, removing a class of wrong call edges on common names like `len` and `start`.
- Ruby files also parse with an up-to-date grammar now (the previously bundled build dated from early 2024), which fixes a misparse of safe-navigation operator-method calls (`recv&.!= x`) that had recorded the wrong callee name.
Expand Down
4 changes: 3 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The public API surface is `src/index.ts` — the `CodeGraph` class wires all the

Defined in `src/types.ts`. Both extractors and resolvers must use these exact strings.

- **NodeKind**: `file`, `module`, `class`, `struct`, `interface`, `trait`, `protocol`, `function`, `method`, `property`, `field`, `variable`, `constant`, `enum`, `enum_member`, `type_alias`, `namespace`, `parameter`, `import`, `export`, `route`, `component`.
- **NodeKind**: `file`, `module`, `class`, `struct`, `interface`, `trait`, `protocol`, `function`, `method`, `property`, `field`, `variable`, `constant`, `enum`, `enum_member`, `type_alias`, `namespace`, `parameter`, `import`, `export`, `route`, `component`, `union`.
- **EdgeKind**: `contains`, `calls`, `imports`, `exports`, `extends`, `implements`, `references`, `type_of`, `returns`, `instantiates`, `overrides`, `decorates`.

### Multi-agent installer
Expand Down Expand Up @@ -138,6 +138,8 @@ For each **language × framework**, validate on **small, medium, and large** rea
1. **Pick the canonical flow** for the framework ("how does X reach Y": state→render, request→handler→view, query→SQL, action→reducer→store…).
2. **Deterministic probes** (`scripts/agent-eval/probe-{node,explore}.mjs` against the built `dist/`): `codegraph_explore` with the flow's symbol names connects from→to end-to-end with no break (its Flow section shows the path); **no node explosion** (`select count(*) from nodes` stable before/after re-index); synthesized-edge **precision** spot-check (`select … where provenance='heuristic'`).
3. **Agent A/B** (`scripts/agent-eval/run-all.sh <repo> "<Q>"`): with vs without codegraph, **≥2 runs/arm** (run-to-run variance is large — never conclude from n=1). Record **duration, total tool calls, Read, Grep**. Optional forced-Read-0 sufficiency proof via the block-read hook (`scripts/agent-eval/hook-settings.json`).
- **Every run also reports three feedback metrics** — residual context occupancy, explore sufficiency (what the agent did NEXT after each explore), and allocation efficiency (share of returned bytes the answer cited) — under each run, plus a side-by-side arm table (`compare-arms.mjs`). Entry point: `docs/benchmarks/agent-eval-feedback-metrics.md`. Reading them: `Read a file we returned` is an allocation miss, `Read a file we did NOT return`/`Grep` is recall; allocation efficiency is **relative** (attribution is by citation) so it is only valid between builds on the same question; occupancy *shares* are Claude Code / 200k and don't transfer to another host — the arm ratio does.
- **The `codegraph` CLI is blocked in every arm** (`no-cli-shim.sh`: sanitized PATH + a PreToolUse hook, shared by both harnesses). Without it 14 of 15 without-arm runs in one 7-repo pass reached codegraph through Bash. Check the contamination row before believing any number: `CLI calls that RETURNED output` > 0 invalidates the run (in a new-vs-baseline A/B it silently drops calls from all three metrics, since a CLI explore is not a tool call).
- **Model policy — every A/B arm runs Claude with `--model sonnet --effort high`. Always. Never Opus/Fable.** All `scripts/agent-eval/*.sh` default to this (`MODEL`/`EFFORT` env override exists — don't raise it without an explicit reason from the maintainer). Two reasons, and the second matters more than cost: (a) Sonnet doesn't burn tokens; (b) **Sonnet is the deliberate floor model** — codegraph's real users attach it to whatever agent they already run (Cursor Composer, Gemini, etc.), so we validate on a "dumber" model on purpose: a stronger model's tool-use covers up the salience/sufficiency problems a weaker one exposes. An affordance that lands on Sonnet generalizes up to every host; one that only works on Opus/Fable doesn't generalize down to the agents most users actually have. Both arms always use the same model.
- **MCP attach is a startup-latency issue, not a hard block.** On a multi-step task the agent dives into Read/grep before codegraph finishes its ~2-3s startup (worse when the eval is itself run nested inside a Claude session, under CPU contention), so it runs with no codegraph. Fix: **pre-warm a persistent daemon** for the target (`CODEGRAPH_DAEMON_IDLE_TIMEOUT_MS` high; spawn `serve --mcp --path <target> </dev/null &`; wait for `.codegraph/daemon.sock`) **and skip the startup re-exec** (`CODEGRAPH_WASM_RELAUNCHED=1`) so claude connects before the agent's first turn. Don't trust claude's `init` snapshot — it can read `status:"pending"` / 0 tools even when it then connects; judge by actual codegraph usage in `parse-run.mjs`'s `by type`. To isolate a change — **new-build vs baseline-build, both codegraph-on** (vs run-all.sh's with-vs-without) — use `scripts/agent-eval/ab-new-vs-baseline.sh <indexed-repo> "<task>" [baseline-ref]` (it bakes in the pre-warm).
4. **Pass bar:** a normal flow question reaches **~0 Read/Grep within the repo's explore-call budget**, runs **faster** than without-codegraph, and shows **no regression on a control repo**. Record the numbers in `docs/design/dynamic-dispatch-coverage-playbook.md` (the coverage matrix).
Expand Down
Loading