fix(cli): include resolution + synthesizer edges in indexAll report (#413)
The orchestrator's per-file counter only sees extraction-phase edges, so the `X nodes, Y edges` line printed after `codegraph init -i` / `codegraph index` undercounts the graph — often by more than half on repos with heavy cross-file resolution (mall: 20 047 reported vs 45 629 actually in the DB). Snapshot (nodes, edges) before/after the full pipeline in `indexAll` and write the true delta back to the result. New lightweight `QueryBuilder.getNodeAndEdgeCount()` is one round-trip with no per-kind breakdowns. `indexFiles` (no resolution) and `sync` (uses `nodesUpdated`, not `nodesCreated`) are unaffected. Regression test added: `__tests__/integration/full-pipeline.test.ts > reports edgesCreated including resolution + synthesizer phases`.
This commit is contained in:
@@ -1445,6 +1445,19 @@ export class QueryBuilder {
|
||||
// Statistics
|
||||
// ===========================================================================
|
||||
|
||||
/**
|
||||
* Lightweight (nodes, edges) count snapshot. Used around an index/sync
|
||||
* run to compute true additions across extraction + resolution +
|
||||
* synthesis — the per-phase counter in the orchestrator only sees
|
||||
* extraction's contribution, which is why the CLI summary under-reported
|
||||
* the edge count (resolution + synthesizer edges were invisible).
|
||||
*/
|
||||
getNodeAndEdgeCount(): { nodes: number; edges: number } {
|
||||
return this.db
|
||||
.prepare('SELECT (SELECT COUNT(*) FROM nodes) AS nodes, (SELECT COUNT(*) FROM edges) AS edges')
|
||||
.get() as { nodes: number; edges: number };
|
||||
}
|
||||
|
||||
/**
|
||||
* Get graph statistics
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user