-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Found during dogfooding v2.3.0
Severity: Medium
Command: codegraph build (incremental) then codegraph structure
Reproduction
-
Build the graph with native engine:
codegraph build . --engine native --no-incrementalVerify:
codegraph statsshowscontains: 111,structureshows all files correctly. -
Modify a file (e.g., add a comment to
src/logger.js) -
Run an incremental build using a different engine (e.g., WASM):
codegraph build . --engine wasm -
Check structure:
codegraph structure
Expected behavior
structureshould still show all 99 files across all directoriesstatsshould show consistentcontainsedge counts- Incremental builds should be engine-agnostic
Actual behavior
structureshows most directories as "0 files, 0 symbols"statsshowscontainsedges drop from 111 to ~15- Only the incrementally-rebuilt file's directory retains correct data
- This corrupted state also caused a downstream
embed --strategy sourcecrash withFOREIGN KEY constraint failed
Root cause
The incremental build appears to re-write structure/contains edges for the entire project, but only has data for the changed files. The unchanged files' contains edges are dropped. When the rebuild engine differs from the original, this is more likely to surface since partial rebuilds with engine mismatch trigger different code paths.
Suggested fix
- Ensure structure rebuild during incremental builds only modifies directories containing changed files
- Or store engine info in DB metadata and warn/force full rebuild when engine changes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working