From 2c662c7917c854b20a08e3d575b743c7c4a7a617 Mon Sep 17 00:00:00 2001 From: Safi Date: Wed, 17 Jun 2026 13:30:02 +0100 Subject: [PATCH] Pass root to build_merge in the update runbook so stale nodes get pruned (#1361) The /graphify --update runbook called build_merge with absolute prune_sources but no root=, so _norm_source_file never relativized them to match the graph's relative source_file values. Nothing was pruned and changed/deleted files left ghost nodes that compounded on every incremental update. Fix the shared skillgen fragment to pass root='INPUT_PATH' and re-render all platform artifacts. Co-Authored-By: Claude Opus 4.8 (1M context) --- graphify/skills/amp/references/update.md | 4 ++++ graphify/skills/claude/references/update.md | 4 ++++ graphify/skills/claw/references/update.md | 4 ++++ graphify/skills/codex/references/update.md | 4 ++++ graphify/skills/copilot/references/update.md | 4 ++++ graphify/skills/droid/references/update.md | 4 ++++ graphify/skills/kilo/references/update.md | 4 ++++ graphify/skills/kiro/references/update.md | 4 ++++ graphify/skills/opencode/references/update.md | 4 ++++ graphify/skills/pi/references/update.md | 4 ++++ graphify/skills/trae/references/update.md | 4 ++++ graphify/skills/vscode/references/update.md | 4 ++++ graphify/skills/windows/references/update.md | 4 ++++ .../expected/graphify__skills__amp__references__update.md | 4 ++++ .../expected/graphify__skills__claude__references__update.md | 4 ++++ .../expected/graphify__skills__claw__references__update.md | 4 ++++ .../expected/graphify__skills__codex__references__update.md | 4 ++++ .../expected/graphify__skills__copilot__references__update.md | 4 ++++ .../expected/graphify__skills__droid__references__update.md | 4 ++++ .../expected/graphify__skills__kilo__references__update.md | 4 ++++ .../expected/graphify__skills__kiro__references__update.md | 4 ++++ .../graphify__skills__opencode__references__update.md | 4 ++++ .../expected/graphify__skills__pi__references__update.md | 4 ++++ .../expected/graphify__skills__trae__references__update.md | 4 ++++ .../expected/graphify__skills__vscode__references__update.md | 4 ++++ .../expected/graphify__skills__windows__references__update.md | 4 ++++ tools/skillgen/fragments/references/shared/update.md | 4 ++++ 27 files changed, 108 insertions(+) diff --git a/graphify/skills/amp/references/update.md b/graphify/skills/amp/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/amp/references/update.md +++ b/graphify/skills/amp/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/claude/references/update.md b/graphify/skills/claude/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/claude/references/update.md +++ b/graphify/skills/claude/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/claw/references/update.md b/graphify/skills/claw/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/claw/references/update.md +++ b/graphify/skills/claw/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/codex/references/update.md b/graphify/skills/codex/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/codex/references/update.md +++ b/graphify/skills/codex/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/copilot/references/update.md b/graphify/skills/copilot/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/copilot/references/update.md +++ b/graphify/skills/copilot/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/droid/references/update.md b/graphify/skills/droid/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/droid/references/update.md +++ b/graphify/skills/droid/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/kilo/references/update.md b/graphify/skills/kilo/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/kilo/references/update.md +++ b/graphify/skills/kilo/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/kiro/references/update.md b/graphify/skills/kiro/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/kiro/references/update.md +++ b/graphify/skills/kiro/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/opencode/references/update.md b/graphify/skills/opencode/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/opencode/references/update.md +++ b/graphify/skills/opencode/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/pi/references/update.md b/graphify/skills/pi/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/pi/references/update.md +++ b/graphify/skills/pi/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/trae/references/update.md b/graphify/skills/trae/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/trae/references/update.md +++ b/graphify/skills/trae/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/vscode/references/update.md b/graphify/skills/vscode/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/vscode/references/update.md +++ b/graphify/skills/vscode/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/graphify/skills/windows/references/update.md b/graphify/skills/windows/references/update.md index d35b665..66523b0 100644 --- a/graphify/skills/windows/references/update.md +++ b/graphify/skills/windows/references/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__amp__references__update.md b/tools/skillgen/expected/graphify__skills__amp__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__update.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__claude__references__update.md b/tools/skillgen/expected/graphify__skills__claude__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__update.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__claw__references__update.md b/tools/skillgen/expected/graphify__skills__claw__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__update.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__codex__references__update.md b/tools/skillgen/expected/graphify__skills__codex__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__update.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__update.md b/tools/skillgen/expected/graphify__skills__copilot__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__update.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__droid__references__update.md b/tools/skillgen/expected/graphify__skills__droid__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__update.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__update.md b/tools/skillgen/expected/graphify__skills__kilo__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__update.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__update.md b/tools/skillgen/expected/graphify__skills__kiro__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__update.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__update.md b/tools/skillgen/expected/graphify__skills__opencode__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__update.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__pi__references__update.md b/tools/skillgen/expected/graphify__skills__pi__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__update.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__trae__references__update.md b/tools/skillgen/expected/graphify__skills__trae__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__update.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__update.md b/tools/skillgen/expected/graphify__skills__vscode__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__update.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/expected/graphify__skills__windows__references__update.md b/tools/skillgen/expected/graphify__skills__windows__references__update.md index d35b665..66523b0 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__update.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges') diff --git a/tools/skillgen/fragments/references/shared/update.md b/tools/skillgen/fragments/references/shared/update.md index d35b665..66523b0 100644 --- a/tools/skillgen/fragments/references/shared/update.md +++ b/tools/skillgen/fragments/references/shared/update.md @@ -101,10 +101,14 @@ prune = list(dict.fromkeys(deleted + changed)) or None # Use build_merge() — reads graph.json directly without NetworkX round-trip # so edge direction (calls, implements, imports) is always preserved (#801). +# Pass root= so prune_sources (absolute paths from detect_incremental) are +# relativized to match the graph's relative source_file values; without it +# nothing is pruned and stale nodes accumulate on every update (#1361). G = build_merge( [new_extraction], graph_path='graphify-out/graph.json', prune_sources=prune, + root='INPUT_PATH', ) print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges')