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
Also present at the v0.9.57 tag commit 3f82bf7f837a07fb0f7668fbdbd5662801906942
Summary
The Rust extractor emits no graph node for module-level static or const declarations.
Functions, structs, enums, traits and impl methods from the same file are extracted normally,
so the declaration is silently absent rather than obviously broken.
In a mixed-language repository this omits the declaration's provenance and skews query
vocabulary: a constant's name can end up in the graph only from shell scripts or test
fixtures that reference it, never from the Rust that defines it.
Settings, Mode and retry_limit() are the positive controls: the file is parsed and the
other declaration kinds in it are extracted in the same run.
Expected
RETRY_LIMIT and DEFAULT_MODE should each get a node sourced from src/lib.rs, with a
file-level defines (or contains) edge, alongside the struct, enum and function.
There is no branch for tree-sitter-rust's static_item or const_item. Grepping the
installed package for either name returns 0 hits (control: struct_item 2, function_item 3, enum_item 2). extract_rust's own docstring (rust.py:62) states the contract as "functions, structs, enums, traits, impl methods, and use declarations".
Quantified impact
Measured against a jdx/mise snapshot (tag v2026.9.4, commit 794948606e02cde091653a165291b06cae43c352),
extracted with graphify extract <dir> --code-only --force:
617 Rust files represented in the graph, contributing 17,159 nodes.
0 of those 783 names appear as an exact-label node sourced from any Rust file.
src/env.rs alone contributed 101 nodes — 99 functions, 1 type, 1 file node — and no static/const node, despite 105 static and 14 const declaration lines in it.
The 29 of those names that do appear anywhere in the graph are sourced from shell, Ruby and
fixture files that reference them (e2e/**, benchmarks/**/*.sh, src/assets/bash/activate.sh),
because the Bash extractor does node top-level exported variables
(extractors/bash.py:501-513).
So a query for e.g. MISE_SHIMS_DIR returns test fixtures and not the declaration:
Version / environment
graphifyy==0.9.57(PyPI wheel, clean venv)v0.9.57tag commit3f82bf7f837a07fb0f7668fbdbd5662801906942Summary
The Rust extractor emits no graph node for module-level
staticorconstdeclarations.Functions, structs, enums, traits and impl methods from the same file are extracted normally,
so the declaration is silently absent rather than obviously broken.
In a mixed-language repository this omits the declaration's provenance and skews query
vocabulary: a constant's name can end up in the graph only from shell scripts or test
fixtures that reference it, never from the Rust that defines it.
Minimal reproduction
Actual
Settings,Modeandretry_limit()are the positive controls: the file is parsed and theother declaration kinds in it are extracted in the same run.
Expected
RETRY_LIMITandDEFAULT_MODEshould each get a node sourced fromsrc/lib.rs, with afile-level
defines(orcontains) edge, alongside the struct, enum and function.Cause
graphify/extractors/rust.py:206gates every non-function item on:
There is no branch for tree-sitter-rust's
static_itemorconst_item. Grepping theinstalled package for either name returns 0 hits (control:
struct_item2,function_item3,enum_item2).extract_rust's own docstring (rust.py:62) states the contract as"functions, structs, enums, traits, impl methods, and use declarations".
Quantified impact
Measured against a
jdx/misesnapshot (tagv2026.9.4, commit794948606e02cde091653a165291b06cae43c352),extracted with
graphify extract <dir> --code-only --force:static/constdeclaration sites → 783 distinct names.src/env.rsalone contributed 101 nodes — 99 functions, 1 type, 1 file node — and nostatic/constnode, despite 105staticand 14constdeclaration lines in it.The 29 of those names that do appear anywhere in the graph are sourced from shell, Ruby and
fixture files that reference them (
e2e/**,benchmarks/**/*.sh,src/assets/bash/activate.sh),because the Bash extractor does node top-level exported variables
(
extractors/bash.py:501-513).So a query for e.g.
MISE_SHIMS_DIRreturns test fixtures and not the declaration:Prior art
export constwith a scalar initializer #2266 reported the equivalent omission for exported JS/TS scalar bindings; fixed byfix(extract): emit nodes for exported scalar bindings #2300, released in v0.9.31.
var/constand are still open.
corpus measurements, then fixed.
node. Related but not required to fix this; see below.
Suggested fix scope
static_itemandconst_itemingraphify/extractors/rust.py, emitting a nodeper declared name plus a file-level edge.
pub staticandpub const.Lazy::new(|| var_path("X"))producing nocallsedge follows from the call harvest walking only function bodies(
rust.py:431,for caller_nid, body_node in function_bodies:) and belongs to Calls and constant reads in top-level / script context never get a caller node, so they emit no edges (uniform across languages) #1972.