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]: incremental graphify extract prunes the node of an unresolved import() target and its dynamic_import edge (#4160 on the extract path) #5544
I have checked the Troubleshooting section in the README
What happened?
An unresolved dynamic import (import('left-pad')) gives a node whose source_file is the specifier. #4161 stopped graphify update from evicting
such nodes. The incremental graphify extract path has its own sweep, _stale_graph_sources, which reads the specifier as a deleted file, and the
prune removes the node and the referrer's dynamic_import edge. A full extract
of the same tree keeps both. It happens whether the referrer is carried over or
re-extracted, because the prune runs on the merged graph.
Expected: the placeholder and its edge survive while a live referrer still
imports it, as in a full extract and in update.
Steps to reproduce
V=$(mktemp -d)&& uv venv -q -p 3.11 "$V"&& uv pip install -q -p "$V" graphifyy==0.9.121
G="$V/bin/graphify"
W=$(mktemp -d)&&cd"$W"printf'export function foo() { return 1 }\n'> a.ts
printf"export async function load() { return await import('left-pad'); }\n"> dyn.ts
$G extract . --code-only > /dev/null
# change a.ts only; dyn.ts is carried over
sed -i.bak 's/return 1/return 2/' a.ts && rm a.ts.bak
$G extract . --code-only | grep -E 'Pruned|incremental summary'
C=$(mktemp -d)&& cp a.ts dyn.ts "$C"&& (cd "$C"&&$G extract . --code-only > /dev/null)
"$V/bin/python" - "$C/graphify-out/graph.json""$W/graphify-out/graph.json"<<'EOF'import json, sysfor label, path in zip(("cold", "warm"), sys.argv[1:]): g = json.load(open(path)) print(label, "left_pad node:", any(n["id"] == "left_pad" for n in g["nodes"]), "| dynamic_import edges:", [(l["source"], l["target"]) for l in g["links"] if l["relation"] == "dynamic_import"])EOF
_stale_graph_sources
(cli.py#L604-L788)
lists every in-root source_file that is neither scanned nor on disk; left-pad is both. The list reaches build_merge as prune_sources. The #4161
guard (watch._referenced_unscanned_identities, watch.py#L1132-L1204)
exists only on the watch path.
Activity
github-actions commentedon Nov 27, 2026
Thanks for opening this issue, @poberherr. 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.
poberherr commentedon Dec 1, 2026
Fixed by #5545, shipped in v0.9.123. Thank you.