-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Found during dogfooding v3.3.0
Severity: Medium
Command: `codegraph build` (incremental vs full)
Reproduction
```bash
1. Full rebuild
codegraph build --no-incremental
codegraph stats --json # record edge count
2. Touch one file, incremental rebuild
echo "// test" >> src/shared/constants.js
codegraph build
codegraph stats --json # record edge count
3. Compare
```
Expected behavior
Incremental and full builds should produce identical node and edge counts when analyzing the same source tree.
Actual behavior
| Metric | Incremental | Full Rebuild | Delta |
|---|---|---|---|
| Nodes | 5402 | 5402 | 0 |
| Edges | 11,444 | 11,834 | -390 (3.3%) |
| Dead exports warning | 104 unused | 86 unused | +18 |
The incremental pipeline misses ~390 edges compared to a full rebuild. The higher dead export count in incremental mode suggests some cross-file edges (likely dataflow or call edges) are not being rebuilt for files outside the reverse-dependency set.
Root cause
Likely the reverse-dependency set computed during incremental builds doesn't capture all files that need edge re-evaluation. Files that consume dataflow edges or have indirect call relationships through the changed file may not be included in the re-parse set.
Suggested fix
Compare the edge sets between incremental and full builds to identify which edge kinds are missing (calls, dataflow, contains, etc.) and which files they belong to. The reverse-dependency computation in the incremental pipeline may need to consider additional edge types.