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
Bash: calls to functions defined in a sourced file never get call edges #2141
When a Bash script calls a function that's defined in a sourced file, graphify never records the call edge. The function definitions and the source/import edge are all indexed fine, but the caller shows zero outgoing calls to the sourced function — so shell scripts look disconnected from the libraries they use.
This is separate from #2079. #2079 is about the source edge (source "${VAR}/lib.sh" pointing at nothing). This one is about the call edge, and it happens even with a plain source ./lib.sh where the source edge resolves fine.
b_func has no incoming call edge, so graphify path main b_func and graphify callers b_func come up empty even though both functions are indexed.
Root cause
extract_bash (graphify/extractors/bash.py) only records a call edge when the callee is defined in the same file (name in defined_functions). A call to a function from a sourced file is silently dropped, and the extractor returns just {"nodes", "edges"} — it never emits the raw_calls / bash_sources that other languages use for cross-file resolution.
There's already a resolver for exactly this — resolve_bash_source_edges (graphify/symbol_resolution.py:404), with unit tests — but it has no call site anywhere in graphify/. It's defined and tested but not wired into the extract pipeline, and it has no raw_calls / bash_sources to work from anyway.
Suggested fix
Have extract_bash emit raw_calls for calls whose callee isn't defined in the current file (plus bash_sources for the source edges), then run them through resolve_bash_source_edges in the pipeline so cross-file calls to sourced functions become real calls edges.
Acceptance
main -> b_func call edge exists for the repro above.
graphify callers b_func and graphify path main b_func resolve.
A call to a genuinely undefined/external command still produces no edge.
Prior art
Aziron's atlas hit the same thing and split it into these two exact halves — source resolution and the intra-function call — in aziron-ai/atlas#13, which also references #2079.
Fixed in v0.9.26 (#2157, thanks @HerenderKumar). Calls into a sourced-file function now resolve to calls edges (both source file and . file), in-corpus and single-match only, so a genuine external command still fabricates nothing. Two narrower cases (extensionless shebang scripts, bare source lib.sh) are tracked as follow-ups in #2171. https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.26
Activity
fix(extract): resolve bash calls into sourced-file functions (#2141)
chore: bump to 0.9.26; changelog for #2137/#2126/#2148/#2141/#2079/#2163
safishamsi commentedon Jul 24, 2026
Fixed in v0.9.26 (#2157, thanks @HerenderKumar). Calls into a
sourced-file function now resolve tocallsedges (bothsource fileand. file), in-corpus and single-match only, so a genuine external command still fabricates nothing. Two narrower cases (extensionless shebang scripts, baresource lib.sh) are tracked as follow-ups in #2171. https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.26fix: resolve bash sources for extensionless libs and bare names (#2171)
Squashed commit of the following:
fix(extract): resolve bash calls into sourced-file functions (Graphif…
chore: bump to 0.9.26; changelog for Graphify-Labs#2137/Graphify-Labs…
fix: resolve bash sources for extensionless libs and bare names (Grap…