The middleware/controller/service heuristics took the first same-named node
anywhere; a JS/TS module reaches another file's only through an import or
require (the import resolver's), so they now keep a same-file pick only.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>