Skip to content

[Bug]: Calls through TypeScript aliases of typed parameter properties are missing #5529

Done

Description

@rvitaliy

What happened?

Graphify indexes a TypeScript interface method and resolves calls through a parameter annotated with the interface. The same call loses its calls edge when the receiver is a local const alias of an explicitly typed object property.

This affects dependency objects passed into factories. In our offboarding workflows the local authority is captured inside callbacks, and queries miss the calls to the authority's inspect, redeem, and recheck methods even though their declarations are indexed.

Steps to reproduce

# Run from a Graphify source checkout after uv sync --all-extras.
scratch=$(mktemp -d)
cat > "$scratch/contracts.ts" <<'TS'
export interface Authority {
  inspect(): number;
}
TS
cat > "$scratch/acquire.ts" <<'TS'
import type { Authority } from "./contracts";

export function direct(port: Authority) {
  return port.inspect();
}

export function acquire(ports: Readonly<{ authority: Authority }>) {
  const authority = ports.authority;
  return () => authority.inspect();
}
TS
uv run --frozen graphify extract "$scratch" --code-only --no-cluster --out "$scratch"

uv run --frozen python - "$scratch/graphify-out/graph.json" <<'PY'
import json
import sys
from pathlib import Path

graph = json.loads(Path(sys.argv[1]).read_text())
inspect = {node["id"] for node in graph["nodes"]
           if node["label"] == ".inspect()" and node["source_file"] == "contracts.ts"}
for edge in graph["edges"]:
    if edge["relation"] == "calls" and edge["target"] in inspect:
        print(edge["source_file"], edge["source_location"], "-> Authority.inspect")
PY

Actual output

acquire.ts L4 -> Authority.inspect

Expected output

Both the directly annotated parameter and the property alias resolve to the same interface method.

acquire.ts L4 -> Authority.inspect
acquire.ts L9 -> Authority.inspect

Environment

Reproduced from a clean checkout of v8 at 0f22ae762e3e3d0b689fc7ad2b8192740628413b (Graphify 0.9.121), macOS arm64, Python 3.14.6, installed from source with uv. The reproduction uses local AST extraction.

Activity

  1. github-actions commented on Nov 26, 2026

    @github-actions

    Thanks for opening this issue, @rvitaliy. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. added a commit that references this issue on Nov 28, 2026
    a6f205d
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions