#3913·graphify

[Bug]: path resolves an ambiguous endpoint to one node without refusing; <file>::<symbol> and node id do not select the node asked for

Author: treebird7Created Sep 28, 2026Updated Sep 28, 2026

What happened?

graphify path does not refuse an ambiguous endpoint the way explain does, and the two other ways to disambiguate (<file>::<symbol> and the full node id) do not select the node asked for.

  1. Bare ambiguous label: path resolves it to one candidate and prints a confident route, exit 0. The tied-score warning goes to stderr and names no candidates; explain on the same label lists both ids.
  2. <file>::<symbol>: explain tells the user to "Retry with path::symbol", but path resolves src/b.ts::.nonce() to the file node b.ts, not the method.
  3. Full node id: the route ends at the containing class (BetaClient), not at the method node given.

Expected: an ambiguous endpoint is refused with the candidate ids (as explain does), and the path::symbol form and node id resolve to the node named, so the route ends there.

Related: #1969 (explain silently resolving ambiguity, where it notes path warns). This is the other half: the warning path emits is not a refusal.

Steps to reproduce

bash
mkdir -p src
cat > src/a.ts <<'X'
export class AlphaClient { nonce() { return 1 } }
X
cat > src/b.ts <<'X'
export class BetaClient { nonce() { return 2 } }
X
cat > src/main.ts <<'X'
import { AlphaClient } from './a'
import { BetaClient } from './b'
export function run() { new AlphaClient(); new BetaClient() }
X
graphify extract . --code-only --force && graphify cluster-only . --no-label

graphify path "run()" ".nonce()"                          # 1
graphify explain ".nonce()"                               # for comparison
graphify path "run()" "src/b.ts::.nonce()" --undirected   # 2
graphify path "run()" src_b_betaclient_nonce              # 3

Error output or graph output

# 1  (exit 0; the warning is on stderr)
warning: target match was ambiguous (top score 12994.1, runner-up 12994.1)
Shortest path (2 hops):
  run() --calls [EXTRACTED]--> AlphaClient --method [EXTRACTED]--> .nonce()

# explain, same label
Ambiguous: '.nonce()' matches 2 nodes in different files.
  src/a.ts   id: src_a_alphaclient_nonce
  src/b.ts   id: src_b_betaclient_nonce
Retry with path::symbol using one of the paths above (e.g. <path>::.nonce()) or the full node id.

# 2  (without --undirected: "No directed path found")
Shortest path (2 hops):
  run() --calls [EXTRACTED]--> BetaClient <--contains [EXTRACTED]-- b.ts

# 3
Shortest path (1 hops):
  run() --calls [EXTRACTED]--> BetaClient

Found on real repos where this matters (a method name defined on two classes in different files; one repo has six .cleanup() nodes): the confident route through the wrong candidate is what a script or agent reads.

Graphify version

0.9.64

Additional Environment Details

macOS 26.6, Python 3.14.2 (not in the dropdown, so I picked 3.13), run via uvx --from graphifyy==0.9.64. Clean checkout of the repro above; the environment was stripped with env -i (no provider variables set).