fix(resolution): keep unknown Python import members unresolved (#2040)

Bisect identifies 5eaa6fed (#2034, #1820) as the first bad commit: its Python named-import fallback resolves task.delay() to the task function itself, hiding the queue effect in API steps. Require member resolution before returning a named Python import's target for attribute access.

Keep direct calls, callbacks, constructors, and known members working. Add absolute/relative aliased-import regression coverage without changing the existing steps assertions.

Validation: git bisect with preserved steps test, tsc and copy-assets at every step, CODEGRAPH_KERNEL=0 throughout bisect. 338 tests pass across ui-steps-api-servers, function-ref, rebuilt kernel-tsjs-parity, resolution, and ui-effects. Issue #1820 repro and tsc --noEmit pass.
This commit is contained in:
Colby Mchenry
2026-09-27 14:02:38 +00:00
committed by GitHub
parent 68085f3997
commit 9be3f1a8a2
2 changed files with 57 additions and 0 deletions
+7
View File
@@ -1725,6 +1725,13 @@ export function resolveViaImport(
// constant edge below rather than fabricating a wrong one.
const instanceMember = resolveImportedInstanceMember(targetNode, ref, imp.localName, context);
if (instanceMember) return instanceMember;
// Finding a named Python import proves the receiver exists, not
// its requested attribute. In particular, task.delay() enqueues
// work; it does not call the imported task function directly.
// Keep unknown members unresolved (including callback values)
// instead of falling back to the receiver as their target.
if (ref.language === 'python') return null;
}
return {