Repository navigation
fix(python): resolve a base class spelled through a root-binding import - #2679
Merged
Merged
Conversation
`import pkg.mod.nodes` binds the ROOT name `pkg`, so `class X(pkg.mod.nodes.Context)` names module pkg.mod.nodes's Context. The cross-LSP base resolution asked the registry, whose import_map step joined the imported MODULE (the IMPORTS edge target, pkg.mod.nodes) with the whole remaining spelling (mod.nodes.Context) and missed; the base kept its raw spelling, so the Python LSP's inheritance view never saw it. Every member inherited through a dotted base fell to a name guess or to nothing: self.m() became unique_name, super().m() suffix_match, super().__init__() only resolved through a synthesized QN. pxc_resolve_base_qn now resolves such a spelling against the module the import names: the import map's module when the root local is unique there, else the dotted module path under the project's QN rule. Python only, import-backed and exact (no short-name step), and only a type-like project node is accepted. `import a.b as m` and `from a import b` bind the module itself and keep resolving through the import map. Tests: python_dotted_base_inheritance(_parallel): self.m(), super().m() and super().__init__() through a dotted base resolve by the LSP; the from-imported control keeps resolving; an untyped receiver stays without an LSP edge. Signed-off-by: Martin Vogel <[email protected]>
Whitespace only; the token stream is unchanged. Signed-off-by: Martin Vogel <[email protected]>
Signed-off-by: Martin Vogel <[email protected]>
…lection fix #2684) Signed-off-by: Martin Vogel <[email protected]>
yermakoffivan
pushed a commit
to yermakoffivan/codebase-memory-mcp
that referenced
this pull request
Oct 18, 2026
…ONAL on every selection path A runner suite registered only under a preprocessor condition (the four coverage_* suites under `#if defined(CBM_TEST_COVERAGE) && !defined(_WIN32)` in tests/test_main.c) is absent from builds without that condition. The selection marked such a suite CONDITIONAL only on the per-registration path, and only when a registration of its own was conditional and contributed a reason. Every suite-level path (setup unknown or hit, suite-body, changed and rule triggers, inventory, rejected artifact) made the suite whole without it, and the runner registration's own condition was never recorded. PR CI on the x86 Linux gcc leg then failed with "the test selection names suites this build does not register: coverage_setup_success coverage_setup_uncertain" (DeusData#2679, DeusData#2680): the suite-body trigger and an incomplete setup row selected both suites whole without CONDITIONAL, so selection.py left them out of optional-suites.txt. The model now records whether a runner registration sits under a condition (conditional only when every site of the suite is), and the selection marks any selected conditionally registered suite whole with CONDITIONAL after every whole-suite path. Unconditionally registered suites keep the strict contract. Signed-off-by: Martin Vogel <[email protected]>
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
import pkg.mod.nodesbinds the ROOT namepkg, soclass X(pkg.mod.nodes.Context)names modulepkg.mod.nodes'sContext. The cross-LSP base resolution (pxc_resolve_base_qn) asked the registry,whose import-map step joins the imported MODULE (the IMPORTS edge target,
pkg.mod.nodes) with the wholeremaining spelling (
mod.nodes.Context) and misses. The base kept its raw spelling, so the Python LSP'sinheritance view never saw it, and every member inherited through a dotted base fell to a name guess or
to nothing:
self.m()becameunique_name,super().m()suffix_match, andsuper().__init__()onlyresolved through a synthesized QN.
pxc_resolve_base_qnnow resolves such a spelling against the module the import names: the importmap's module when the root local is unique there, else the dotted module path under the project's QN
rule. Python only, import-backed and exact (no short-name step), and only a type-like project node is
accepted.
import a.b as mandfrom a import bbind the module itself and keep resolving through theimport map. Import maps are not changed.
Evidence
Base origin/main 9f85f10 vs this head, 26 Python repos (manifest v1), production builds, macOS arm64,
--repeat 2, every repeat byte-identical.lsp_method, +25lsp_super, -19suffix_match, -3same_module. Three reposchange; the other 23 are identical:
class Type(mypy.nodes.Context)makesInstance.type->TypeInfomethodsresolvable;
ASTStubGenerator(..., mypy.traverser.TraverserVisitor)andFreshenCallableVisitor(mypy.type_visitor.TypeTranslator)super()calls reach their base.class X(salt.utils.process.SignalHandlingProcess);super()andself.calls reach the right base methods (_handle_signals,__setstate__,fileclient.Client.*)instead of a same-module function,
logmod.error, or a CI helper'sProxyClient.start.super().__new__throughmitmproxy.hooks.Hook.super()), every removal pointedat an overridden or unrelated definition. scip-python agrees exactly: +70 correct and +48 answerable
(= 70 added - 22 removed), i.e. every added edge is a SCIP true positive and every removed one was a
false positive.
IDF; no change in its logic here.
ast): 316 class bases spelled through a root-binding import on the corpus.Tests
python_dotted_base_inheritanceand..._parallel(sequential and parallel venues):self.m(),super().m()andsuper().__init__()through a dotted base resolve by the LSP; the from-importedcontrol keeps resolving; an untyped receiver stays without an LSP edge. GREEN here; with
pass_lsp_cross.creverted to main both fail (dotted_self == 0). Affected suites (complexity,registry, pipeline, cross_repo, py_lsp, py_lsp_stress, py_lsp_scale, lsp_resolution_probe,
incremental) pass on the merged tree. clang-format and cppcheck 2.20.0 clean on the changed file.
No index-format change: the fix only changes which project node a base spelling resolves to.