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
Stub-rewire pass does not fire: cross-module refs to a single located type stay unbound #4262
The stub-rewire pass (_rewire_unique_stub_nodes) does not fire, so cross-module references to a single located type never bind to the real definition.
Repro
A class Settings is defined exactly once at config/settings/_models.py:38 (node config_settings_models_settings).
159 per-file Settings stub nodes (338 links) are emitted across the tree.
The stub-rewire pass (graphify/extract.py:2165, called once at :6128) should bind those stubs to the single located definition, but after the build the stubs remain unbound.
Candidate-count hypothesis
Two candidate causes were recorded by the reporting team (on their internal card GRAPHIFY-007): the pass is keyed on the bare name while the located definition is keyed on a module-qualified path, so the key never matches; and/or the pass runs before all located definitions are indexed, so the singleton lookup sees zero candidates. A minimal reproduction is one class plus one cross-module reference.
Impact
Downstream code that relies on graph edges to trace "who uses Settings" sees 338 links to stubs and none to the real class, which defeats the stub-rewire feature.
Reported by a downstream consumer of the graphify CLI (pipx graphifyy).
This no longer reproduces on the current v8 line (released as 0.9.84). A type defined exactly once binds across modules through the re-export chain (simple, multi-hop, star, and as re-exports all verified), and where there is no import at all the unique-stub rewire binds every reference to the single located definition. I added regression coverage matching the reported layout (config/settings/_models.py -> config_settings_models_settings) plus an import-free inheritance control so it cannot silently regress. If you still see unbound stubs on 0.9.84, please reopen with a small sample and I will dig in. Thanks, @waynegault.
Activity
github-actions commentedon Oct 9, 2026
Thanks for opening this issue, @waynegault. 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.
test(python): lock in cross-module type-reference binding (#4262)
docs(changelog): fold #4039/#4261/#4269/#4247/#4262 into 0.9.84
safishamsi commentedon Oct 10, 2026
This no longer reproduces on the current
v8line (released as 0.9.84). A type defined exactly once binds across modules through the re-export chain (simple, multi-hop, star, andasre-exports all verified), and where there is no import at all the unique-stub rewire binds every reference to the single located definition. I added regression coverage matching the reported layout (config/settings/_models.py->config_settings_models_settings) plus an import-free inheritance control so it cannot silently regress. If you still see unbound stubs on 0.9.84, please reopen with a small sample and I will dig in. Thanks, @waynegault.