Commit Graph
12 Commits
Author SHA1 Message Date
rohit-jsfreaky 0083ee78e5 fix(python): keep missing relative-import targets out of the checkout path
A relative import of a module with no file behind it (`from .absent
import x`) built its target from the attempted absolute path, so the id
became e.g. `c_users_<user>_..._pkg_absent_py`. The root-relative id
remap never rewrites it (there is no node to anchor on), so the checkout
location and the OS username ended up in graph.json and every clone got
a different id.

Use the dotted module name relative to the scan root instead
(`pkg_absent`), the id an unresolved absolute import of the same module
already gets, so `from .absent` and `from pkg.absent` now meet on one
node. An import that climbs above the scan root falls back to a `ref`
id. Imports that resolve, and attempted paths that exist, are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8gwEpjajiWHVW3c9smuKf
(cherry picked from commit 8cdbb0ea4f)
2026-10-06 20:54:15 +01:00
Alex Tumanov 33edd89b43 fix(extract): preserve Python import bindings across sibling cases
Use existing plain-import provenance to distinguish separate and same-line from-imports. Reject type aliases and dynamic namespace references, and protect changed and unchanged external callers through incremental CLI extraction.

Fixes #3793

AI-Assisted-By: OpenAI Codex
(cherry picked from commit 5e240c8bd3)
2026-10-04 20:40:34 +01:00
Alex Tumanov 6868fff846 fix(extract): track calls to external Python modules
AI-Assisted-By: OpenAI Codex
(cherry picked from commit 3464399d4f)
2026-10-04 20:40:34 +01:00
nikhil2004 c66eebe25f fix(python): resolve nested scan-root imports via namespace projection (#3843)
When the scan root is a sub-directory of a monorepo package hierarchy
(e.g., root = Company/Apps/Jobs/Team/), absolute imports using the full
dotted namespace (from Company.Apps.Jobs.Team.lib import delivery) were
unresolved because the scan root probed root/Company/Apps/Jobs/Team/lib
which doesn't exist inside root.

_infer_scan_root_namespace walks above the scan root collecting ancestor
directory names that contain __init__.py, establishing the root's
namespace prefix. When an absolute import's module name starts with that
prefix, the prefix is stripped and the remainder is re-probed relative
to root.

The existing root/rel fast path, ancestor walk (#2072), ambiguous import
guard (#3729), and phantom-edge retraction (#3784) are all untouched.
Third-party imports cannot false-match because the prefix check requires
a strict dotted prefix plus a remaining local component.

Co-Authored-By: Google Antigravity <noreply@google.com>
(cherry picked from commit 640e39efc4)
2026-09-27 18:40:06 +01:00
himanshupatro-334 310b317355 fix: retract provisional package import edges
(cherry picked from commit 9a54565cb4)
2026-09-23 17:02:17 +01:00
Ha1baraA11 45e9af94db fix: guard ambiguous absolute Python imports
(cherry picked from commit 238c9df3d0)
2026-09-23 17:01:39 +01:00
Ha1baraA11 1c12006360 fix: resolve Python imports within scan root
(cherry picked from commit 962a0569b1)
2026-09-23 17:01:39 +01:00
Ha1baraA11 2944b2d8ec fix: resolve absolute Python package imports
(cherry picked from commit f1b880c726)
2026-09-23 17:01:39 +01:00
Ousama Ben Younes 51cf1481b6 fix(python): resolve relative subpackage imports to their __init__ (#2688) 2026-08-13 13:30:24 +01:00
SinghAman21 5fd4ab650b fix(python): avoid crash resolving overdeep relative imports 2026-08-11 14:40:01 +01:00
TheFedaikin ab4e5424ca feat: add cross-language semantic contexts for Python, JS/TS, C#, and Java (#996) 2026-05-24 20:38:10 +01:00
Danil Tarasov e44e6e986c feat: add v8 affected and import-resolution support 2026-05-22 13:24:54 +01:00