Inline explain reverses incoming canonical links and drops parallel relationships
The shared /graphify explain fallback reverses incoming canonical links and drops parallel relationships
Graphify 0.9.91 exports canonical graph JSON with directed: false, while link source/target (or legacy _src/_tgt) retain the relationship direction. The shared query reference loads that JSON as an undirected NetworkX graph, then prints every neighbor as outgoing and chooses only the first parallel edge.
A synthetic graph with Caller -> Center relations calls and uses demonstrates both problems: explaining Center reports an outgoing relationship to Caller and omits one relation. The CLI already forces directed loading, but the shared skill fallback does not. A self-loop must also appear once, and the printed source location should come from the relationship's call site.
Reproduced on v8 commit 10130e79ed9caf8f60d998073e097531eaa1a395 and the shared fragment in PR #4370 at 84bd0c3c. That PR fixes directed input but explicitly retains the old renderer for directed: false, leaving the canonical export case affected.
Expected: the shared explanation fallback follows stored link direction, retains every parallel relationship, deduplicates the self-loop, and displays available edge source locations. No real project graph or external provider is needed for reproduction.
Minimal synthetic input (graphify-out/graph.json):
{
"directed": false, "multigraph": true, "graph": {},
"nodes": [{"id": "caller", "label": "Caller"}, {"id": "center", "label": "Center"}],
"links": [
{"source": "caller", "target": "center", "key": 0, "relation": "calls", "confidence": "EXTRACTED"},
{"source": "caller", "target": "center", "key": 1, "relation": "uses", "confidence": "EXTRACTED"}
]
}
Run the inline Python fallback under ## For /graphify explain in graphify/skills/codex/references/query.md, with NODE_NAME replaced by Center. It currently prints only one relationship, pointing from Center to Caller. Both stored relationships are incoming to Center and should be listed. Changing only directed to true is a control for the related PR's branch. The same shared fragment is rendered to the other progressive-host references.
This report contains only synthetic node names; no private graph or source code is needed.
Thanks for opening this issue, @cagdasyurekli. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.