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
bug: to_json does not relativize source_file on graph.hyperedges[] entries — only nodes[] and links[] #1418
build_from_json(extraction, root=...) correctly relativizes source_file on nodes[] and links[], but entries in graph.hyperedges[] retain their absolute paths.
Steps to reproduce
Run /graphify . on a project with at least one doc/md file (so semantic extraction fires and produces hyperedges)
Check graphify-out/graph.json — hyperedge source_file values are absolute
All other source_file values (nodes, links) are correctly relative
Example
// graph.json — nodes and links are relative:
{ "source_file": "package.json" }
// But hyperedges retain absolute paths:
{
"graph": {
"hyperedges": [
{
"id": "watchdog_architecture_patterns",
"source_file": "/Users/.../CLAUDE.md"// ← absolute, should be "CLAUDE.md"
}
]
}
}
Root cause
The semantic extraction subagent is told to copy source_file verbatim from FILE_LIST (which contains absolute paths per the extraction spec). The contract is that build_from_json() relativizes everything downstream, but to_json only processes nodes[] and links[] — the graph.hyperedges[] array is written as-is.
Expected behavior
source_file on hyperedge entries should be relativized to the scan root, same as nodes and links.
Workaround
Manually strip the root prefix from hyperedge source_file values after the graph is written.
build_from_json now relativizes source_file on graph.hyperedges[] exactly like it does for nodes[] and links[] (d168de9). The fix lives in build_from_json rather than to_json because build_from_json is the one that has the scan root — to_json has no root to relativize against, so it can only write what it's given.
Verified end-to-end with a real claude-cli extraction: a doc that produces a hyperedge now writes it with a relative source_file (architecture.md, not an absolute path).
Related follow-up: while verifying this, I found the native-backend extraction prompt never actually requested hyperedges (its schema example showed "hyperedges":[] and never described them), so graphify extract --backend X emitted zero — only the agent/skill path produced them. That prompt drift is now fixed too (aad3b47), so native backends emit hyperedges and this relativization path is exercised in practice.
Activity
safishamsi commentedon Jun 22, 2026
Fixed on
v8(ships in the next release).build_from_jsonnow relativizessource_fileongraph.hyperedges[]exactly like it does fornodes[]andlinks[](d168de9). The fix lives inbuild_from_jsonrather thanto_jsonbecausebuild_from_jsonis the one that has the scanroot—to_jsonhas norootto relativize against, so it can only write what it's given.Verified end-to-end with a real
claude-cliextraction: a doc that produces a hyperedge now writes it with a relativesource_file(architecture.md, not an absolute path).Related follow-up: while verifying this, I found the native-backend extraction prompt never actually requested hyperedges (its schema example showed
"hyperedges":[]and never described them), sographify extract --backend Xemitted zero — only the agent/skill path produced them. That prompt drift is now fixed too (aad3b47), so native backends emit hyperedges and this relativization path is exercised in practice.Release 0.8.45
Relativize hyperedge source_file and honour GRAPHIFY_OUT everywhere (G…
Request hyperedges in the native-backend extraction prompt (Graphify-…
Release 0.8.45