Skip to content

Call resolver: explain one link (rung, candidates, qualifier) without reading call_resolver.py #3776

Closed

Description

@squid-protocol

Part of #3772.

Why

Diagnosing a wrong or missing link during #3756–#3767 meant re-deriving the resolver's ladder from source. CLAUDE.md already makes this point for extraction: check what the engine actually did before tracing regex logic.

What

python tests/tools/explain_call.py <master.db | repo> <file>:<function> [<callee>] prints, for each callee of that function:

  • the resolver's step;
  • the qualifier it used and the alternatives it tried;
  • the candidate definitions in each lookup set (free, methods, by_owner), with their def_shape;
  • the import set the caller sees, including barrel re-exports;
  • the reason a candidate was excluded (bodyless signature, member not bare-callable, not visible).

With a repo path, it scans first. The resolver gets an opt-in trace hook for this, with no behaviour change and no cost when the hook is off.

Done when

Explaining zod's v3/types.ts:_parse → addIssue (#3756) shows the file step and why the untyped ctx receiver reached the object-literal addIssue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-engineenhancement

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions