mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-05 08:23:53 +08:00
Python attribute calls were not classified as member calls, so weak short-name strategies (suffix_match / unique_name / field_type_hint) could bind `obj.method()` to an arbitrary same-named project symbol — `accelerator.print()` resolving to MockAccelerator.print. Flag a Python attribute call is_method when its receiver is unresolved, and extend the existing TS/JS weak-member guard to Python. Receivers that ARE known stay exempt: self/cls, super(), and any identifier bound by one of the file's imports (including the root of an attribute chain), so Python's canonical `module.function()` cross-file call still resolves. The guard helper is renamed cbm_tsjs_suppress_weak_method_match -> cbm_suppress_weak_member_match. Its drop-list is unchanged, and the per-language gate stays at the two call sites, which enumerate the same language set in pass_calls.c and pass_parallel.c so the sequential and parallel resolvers cannot diverge. ArkTS remains in that set. python/S6/inherited_method in the resolution probe now asserts calls == 0, recording the same trade TypeScript took when the receiver-aware guard landed: the edge it used to produce came from a unique_name registry fallback (measured on main: strategy=unique_name, cands=1, conf=0.7500) where a weak short-name guess happened to be right in a 2-file fixture. It flips back to >= 1 once py_lsp_cross resolves inheritance, matching the flip-back note already carried on the TypeScript S6 case. Fixes #1276 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com> Co-authored-by: Enferlain <15861396+Enferlain@users.noreply.github.com>