Problem
Current typeinfer_engine.py does lightweight inference but doesn't track import chains. Result: user.profile.update() gets recorded as a call to update with no target type — the call graph has holes wherever methods are called on imported objects.
Proposed Change
Add a Hybrid Type Resolution pass that runs after the AST parse pass:
- Build a per-file import registry:
from models import User -> User -> models.User
- For each call site, resolve the receiver type via the import registry
- Refine the CALLS edge:
user.profile.update -> Profile.update in models/profile.py
Priority Languages (for CodeLens agent use case)
- Python: dotted imports, dataclasses,
@property, isinstance narrowing
- TypeScript: module re-exports, generic return types, method chaining
Why This Matters
Accurate call edges = accurate trace + accurate impact = agents can trust the graph. Without this, agents can't rely on trace for anything beyond same-file calls.
Problem
Current
typeinfer_engine.pydoes lightweight inference but doesn't track import chains. Result:user.profile.update()gets recorded as a call toupdatewith no target type — the call graph has holes wherever methods are called on imported objects.Proposed Change
Add a Hybrid Type Resolution pass that runs after the AST parse pass:
from models import User->User -> models.Useruser.profile.update->Profile.updateinmodels/profile.pyPriority Languages (for CodeLens agent use case)
@property,isinstancenarrowingWhy This Matters
Accurate call edges = accurate trace + accurate impact = agents can trust the graph. Without this, agents can't rely on
tracefor anything beyond same-file calls.