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
AST import edges silently dropped: short ID vs full path ID mismatch #256
imports_from edges extracted by graphify.extract.extract() are silently dropped during build_from_json() because the import target IDs don't match the file node IDs.
Repro
fromgraphify.extractimportextractfrompathlibimportPathresult=extract([
Path('backend/src/pipeline/steps/summarise-step.ts'),
Path('backend/src/services/openai/structured-generation.ts'),
])
# Import edge created:# source: "backend_src_pipeline_steps_summarise_step_ts"# target: "structured_generation_js" <-- SHORT ID## But the actual file node ID is:# "backend_src_services_openai_structured_generation_ts" <-- FULL PATH ID## Result: edge points to a non-existent node and is silently dropped
Impact
On a 388-file TypeScript codebase, AST extraction found 1443 raw import edges but the final graph had 0 imports_from edges. This makes all cross-file dependencies invisible, causing the graph to fragment into hundreds of disconnected communities that should be connected.
Root cause
extract() creates import target IDs from the import specifier ('./structured-generation.js' → structured_generation_js) without resolving the relative path to the full filesystem path. File node IDs use the full path (backend_src_services_openai_structured_generation_ts).
Expected behavior
Import target IDs should resolve to the actual file node IDs, either:
During extraction (resolve ./foo.js relative to the importing file's directory)
During build_from_json() (fuzzy match foo_js → *_foo_ts)
Workaround
Post-build script that matches import targets by stem name:
# Strip _js suffix, match stem to file nodestem="structured_generation"# from "structured_generation_js"full_id=file_nodes.get(stem) # -> "backend_src_services_openai_structured_generation_ts"
This recovered 527 out of 1443 import edges (the rest are external/node_modules).
Environment
graphifyy 0.4.2
TypeScript/ESM codebase with .js import extensions
Fixed in v0.4.3. Relative JS/TS imports (e.g. ./foo.js) now resolve to the full filesystem path before generating the node ID, so they match the file node IDs introduced in v0.4.2. Python relative imports (from .foo import bar) fixed the same way.
Activity
fix bugs #256, #253, #244, #226, #254 and bump to 0.4.3
safishamsi commentedon Apr 12, 2026
Fixed in v0.4.3. Relative JS/TS imports (e.g.
./foo.js) now resolve to the full filesystem path before generating the node ID, so they match the file node IDs introduced in v0.4.2. Python relative imports (from .foo import bar) fixed the same way.fix bugs Graphify-Labs#256, Graphify-Labs#253, Graphify-Labs#244, Gra…
fix bugs #256, #253, #244, #226, #254 and bump to 0.4.3
fix bugs Graphify-Labs#256, Graphify-Labs#253, Graphify-Labs#244, Gra…