You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
watch: _rebuild_code overwrites semantic nodes instead of merging with existing graph #253
_rebuild_code() in watch.py does a full AST-only rebuild and writes the
result directly to graph.json, overwriting any semantic nodes previously
extracted from docs/papers by the full /graphify pipeline.
In a mixed repo (code + markdown docs), every code file save destroys the
semantic layer (INFERRED edges, rationale nodes, cross-doc surprises,
hyperedges, community labels).
Reproduction
Run /graphify . on a repo with code + markdown docs
Auto-sync (--watch) - run in a background terminal and the graph updates itself as your codebase changes. Code file saves trigger an instant rebuild (AST only, no LLM). Doc/image changes notify you to run --update for the LLM re-pass.
"The graph updates itself" implies an incremental merge, consistent with how --update is described separately:
/graphify ./raw --update - re-extract only changed files, merge into existing graph
But --watch doesn't merge. _rebuild_code builds a new graph from AST-only data and overwrites graph.json entirely. On a mixed repo (code + docs), this silently destroys all semantic nodes, INFERRED edges, hyperedges, and community labels from the prior /graphify run.
The distinction between --update (merge) and --watch (overwrite) is not documented and contradicts the "auto-sync" framing.
Fixed in v0.4.3. _rebuild_code now loads the existing graph.json before overwriting — it keeps all non-code nodes (docs, papers, images) and their edges, then merges in fresh AST results. Semantic nodes from a full /graphify run survive code file saves.
Activity
Joseph94m commentedon Apr 12, 2026
The README describes
--watchas:"The graph updates itself" implies an incremental merge, consistent with how
--updateis described separately:But
--watchdoesn't merge._rebuild_codebuilds a new graph from AST-only data and overwritesgraph.jsonentirely. On a mixed repo (code + docs), this silently destroys all semantic nodes, INFERRED edges, hyperedges, and community labels from the prior/graphifyrun.The distinction between
--update(merge) and--watch(overwrite) is not documented and contradicts the "auto-sync" framing.fix bugs #256, #253, #244, #226, #254 and bump to 0.4.3
safishamsi commentedon Apr 12, 2026
Fixed in v0.4.3.
_rebuild_codenow loads the existinggraph.jsonbefore overwriting — it keeps all non-code nodes (docs, papers, images) and their edges, then merges in fresh AST results. Semantic nodes from a full/graphifyrun survive code file saves.fix bugs Graphify-Labs#256, Graphify-Labs#253, Graphify-Labs#244, Gra…
fix bugs #256, #253, #244, #226, #254 and bump to 0.4.3
fix bugs Graphify-Labs#256, Graphify-Labs#253, Graphify-Labs#244, Gra…