Commit Graph
2 Commits
Author SHA1 Message Date
raditha dissanayake 1adadc7f79 fix(global): preserve stored edge direction in global add (#4066)
global add loaded graph.json with a plain undirected node_link_graph, so
every link whose target precedes its source in the node list was written
to ~/.graphify/global-graph.json reversed. Stamp _src/_tgt with
restore_arc_direction before the load, as the export loader and
load_node_link_graph do since #4088.

The external-node dedup rewired edge endpoints but not the markers, so a
deduplicated repo's markers named a node that no longer exists. Remap
_src/_tgt along with the endpoints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 477848390e)
2026-10-11 21:06:09 +01:00
raditha dissanayake 5eeb037929 fix(export): preserve stored edge direction when reloading graph.json (#4066)
graph.json is written "directed": false and carries direction in arc order
(#563), or in _src/_tgt markers on legacy files (#2309). A plain undirected
node_link_graph load re-orders endpoints by node-list position, so every
link whose target precedes its source in the node list came back reversed
(79% of links on graphify's own graph).

query, path/explain, affected, merge-graphs and the MCP server already
restore direction. The remaining reloaders did not:

- export html / neo4j / falkordb (cypher.txt and --push) / obsidian canvas
- graph.html re-rendered by update, watch and the git hooks
- the git merge driver, which wrote the reversal into the committed
  graph.json, even when merging three identical copies

Add paths.restore_arc_direction, the inline idiom query and merge-graphs
already use, and apply it in load_node_link_graph and the export loader.
to_cypher, to_canvas and push_to_neo4j/falkordb now read _src/_tgt as
to_html already does. The merge driver writes direction back into arc
order before saving, as to_json does, so the committed file keeps the
post-#563 convention.

global add has the same bug and is fixed separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5a461c99d7)
2026-10-05 19:40:13 +01:00