[Bug]: graphify tree ignores the repo tag on merged graphs: no per-repo roots, and identical relative paths from different repos collapse together
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- developer-experience
Research direction
Start in tree_html.py at build_tree, which currently ignores the merged nodes’ repo attribute; then read the tree tests in tests/test_tree_html.py. Reproduce with two repos that share src/engine.py and inspect whether their nodes collapse into one file node. Done when the tree shows separate repo roots and preserves each repo’s directory and file hierarchy, including with --root.
Written by the indexing model from the issue text.
Description
Pre-flight checks
- I have checked the Troubleshooting section in the README
What happened?
On a graph produced by graphify merge-graphs, graphify tree does not use the repo attribute that merge-graphs sets on every node. As a result:
- There are no per-repo roots. The root is the common prefix of the repo-relative
source_filevalues, which is empty when the repos differ, so the viewer title is "/". - Files that share a repo-relative path in different repos (e.g.
src/engine.pyin both) collapse into ONE file node with all of their symbols interleaved.
Expected: each repo tag is a top-level root with its own directory/file hierarchy built from that repo's relative paths. This would also fix --root on merged graphs, since each repo subtree would be anchored by its tag rather than an absolute path.
Steps to reproduce
1. Create two graph.json files (repo-a, repo-b) whose nodes have source_file "src/engine.py".
2. graphify merge-graphs repo-a/graphify-out/graph.json repo-b/graphify-out/graph.json --out world/graphify-out/graph.json
3. graphify tree --graph world/graphify-out/graph.json --output WORLD_TREE.html
4. Or inspect directly: python3 -c "import json; from graphify.tree_html import build_tree; print(build_tree(json.load(open('world/graphify-out/graph.json'))))"
Merged nodes do carry `repo: "repo-a"` / `"repo-b"` and `local_id`, so the data needed to group by repo is present. tree_html.py never reads `repo`.
Error output or graph output
build_tree output (name, total_count), both repos sharing src/engine.py:
engine.py (8)
src (8)
engine.py (8)
Cls (1) x4
fn (1) x4
Symbols from repo-a and repo-b are mixed under one file node. Viewer title: "/".
Graphify version
0.9.92
Operating System
Linux
Python Version
3.13
Installation Method
uv tool install (recommended)
Additional Environment Details
No provider environment variables set. Reproduced on a fresh shallow clone of main at the 0.9.92 release commit.Also reproduced with a fresh uv venv; same result.”
Additional context
Suggested fix: in build_tree (tree_html.py), if nodes carry repo, group by it first and build each repo's subtree independently under a root named after the tag. A test in tests/test_tree_html.py with two repos sharing a relative path would cover it.
Related to #4522 (merged-graph tree rendering), but a different cause: here source_file is intact and the repo tag is simply unused by tree.
- Dominant language
- Python
- Stars
- 124k
- Forks
- 11.9k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Graphify-Labs/graphify
-
[Bug] Pi skill uses unsupported general-purpose subagent instead of delegatePossibly taken @bercedev claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Graphify-Labs/graphify#4494 · 5 comments ·
Maintainers usually reply within 1 day
-
ID collision: a node with no source_file beats a sourced node with the same id (dedup._collision_rank)May be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Graphify-Labs/graphify#4492 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Graphify-Labs/graphify#3763 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Graphify-Labs/graphify#3611 · 1 comment ·
Maintainers usually reply within 1 day
-
Nix supportOpen
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Graphify-Labs/graphify#3193 · 2 reactions ·
Maintainers usually reply within 1 day
All issues in Graphify-Labs/graphify
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
collective/icalendar#1968 · 1 comment ·
Maintainers usually reply within 1 day
-
Deferred from #1869: Complete the companion pytest guardrail update noted in the PR description...Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#140958 ·
Maintainers usually reply within 1 day
-
Bug triage/confirmed
Difficulty 2/5 Half a day Newbie friendliness 85/100
agentscope-ai/agentscope#3355 ·
Maintainers usually reply within 2 days