nothariharan
c6d4c25135
fix(mcp): a substring near-miss is no longer the answer ( #3917 )
...
`get_node` / `get_neighbors` share `_resolve_single_node`, which takes the
first node of the winning tier. The substring tier matches a query anywhere
inside a label, so `get_node(label="MailController")` on a codebase with no
`MailController` returned `EmailController` as if it were the exact symbol,
with no hint that the name does not exist.
The resolver now splits the two fuzzy tiers by intent. A prefix match still
resolves, because the caller started typing the real name (`email` ->
`EmailController`). A substring-only match is a search hit, not the symbol
the caller named, so it returns `No exact match for '<query>'` followed by
up to five closest names with their source location, plus a `path::symbol`
retry example. `get_neighbors` inherits the same answer through the shared
resolver, so both tools report one lookup the same way (ADR-0001).
Exact, source-exact and prefix resolution, the ambiguity refusals, the
dotted/Python and `path::symbol` forms and scoring are unchanged. The other
near-miss case in the issue (`get_node(label="edit")` with several `.edit()`
methods) already refused as Ambiguous under ADR-0001; tests cover both.
Tests: the issue's MailController repro, prefix shorthand, exact-over-substring
precedence, the five-candidate cap.
(cherry picked from commit d3875f4f1c )
2026-10-22 13:47:04 +01:00
..
2026-10-13 10:27:02 +01:00
2026-10-10 22:13:39 +01:00
2026-10-11 20:47:55 +01:00
2026-10-20 10:35:23 +01:00
2026-10-08 14:27:06 +01:00
2026-10-05 19:40:12 +01:00
2026-10-09 19:18:06 +01:00
2026-10-16 17:10:31 +01:00
2026-10-12 12:16:17 +01:00
2026-10-16 17:10:31 +01:00
2026-10-12 14:49:28 +01:00
2026-10-05 20:11:30 +01:00
2026-10-16 18:25:28 +01:00
2026-10-12 23:02:50 +01:00
2026-10-07 17:26:00 +01:00
2026-10-13 22:21:43 +01:00
2026-10-12 14:49:28 +01:00
2026-10-16 18:25:28 +01:00
2026-10-22 13:16:25 +01:00
2026-10-09 02:48:22 +01:00
2026-10-08 14:27:06 +01:00
2026-10-16 17:14:07 +01:00
2026-10-11 21:07:15 +01:00
2026-10-06 20:54:55 +01:00
2026-10-13 11:14:16 +01:00
2026-10-22 13:46:54 +01:00
2026-10-20 10:35:24 +01:00
2026-10-13 22:21:48 +01:00
2026-10-13 22:21:48 +01:00
2026-10-13 11:14:16 +01:00
2026-10-06 20:54:15 +01:00
2026-10-13 22:21:48 +01:00
2026-10-13 22:21:48 +01:00
2026-10-13 22:21:48 +01:00
2026-10-13 22:21:43 +01:00
2026-10-12 14:50:32 +01:00
2026-10-13 22:21:48 +01:00
2026-10-12 13:01:00 +01:00
2026-10-12 22:37:55 +01:00
2026-10-12 12:29:39 +01:00
2026-10-16 18:21:28 +01:00
2026-10-13 22:21:43 +01:00
2026-10-20 11:28:07 +01:00
2026-10-12 22:58:40 +01:00
2026-10-10 21:20:29 +01:00
2026-10-08 14:28:54 +01:00
2026-10-08 14:28:27 +01:00
2026-10-07 17:26:00 +01:00
2026-10-11 20:49:42 +01:00
2026-10-11 20:49:42 +01:00
2026-10-09 02:51:03 +01:00
2026-10-11 21:06:09 +01:00
2026-10-20 10:50:37 +01:00
2026-10-14 22:53:26 +01:00
2026-10-07 17:26:17 +01:00
2026-10-22 13:46:54 +01:00
2026-10-07 17:52:47 +01:00
2026-10-20 11:28:07 +01:00
2026-10-16 18:21:28 +01:00
2026-10-14 22:31:57 +01:00
2026-10-13 22:53:44 +01:00
2026-10-12 22:37:54 +01:00
2026-10-13 11:14:22 +01:00
2026-10-16 17:12:53 +01:00
2026-10-22 13:46:54 +01:00
2026-10-09 19:46:57 +01:00
2026-10-08 14:27:06 +01:00
2026-10-10 21:37:39 +01:00
2026-10-13 10:26:57 +01:00
2026-10-13 10:26:57 +01:00
2026-10-16 17:10:31 +01:00
2026-10-16 17:10:31 +01:00
2026-10-10 21:20:29 +01:00
2026-10-12 14:49:28 +01:00
2026-10-13 11:14:16 +01:00
2026-10-09 19:18:06 +01:00
2026-10-06 20:54:35 +01:00
2026-10-14 22:31:57 +01:00
2026-10-22 13:12:56 +01:00
2026-10-12 22:37:54 +01:00
2026-10-12 22:37:54 +01:00
2026-10-09 19:18:06 +01:00
2026-10-09 19:18:06 +01:00
2026-10-22 13:12:56 +01:00
2026-10-07 17:26:00 +01:00
2026-10-12 23:02:44 +01:00
2026-10-12 23:02:50 +01:00
2026-10-16 17:10:31 +01:00
2026-10-21 19:33:01 +01:00
2026-10-16 17:11:41 +01:00
2026-10-21 19:33:10 +01:00
2026-10-10 22:11:03 +01:00
2026-10-13 11:14:16 +01:00
2026-10-05 19:40:12 +01:00
2026-10-20 10:35:23 +01:00
2026-10-20 10:35:22 +01:00
2026-10-12 12:16:17 +01:00
2026-10-12 12:16:17 +01:00
2026-10-20 10:35:22 +01:00
2026-10-20 11:28:04 +01:00
2026-10-16 17:10:31 +01:00
2026-10-11 20:47:44 +01:00
2026-10-20 14:57:06 +01:00
2026-10-10 01:24:41 +01:00
2026-10-12 22:58:40 +01:00
2026-10-21 19:33:01 +01:00
2026-10-22 13:46:52 +01:00
2026-10-07 17:26:00 +01:00
2026-10-09 19:18:06 +01:00
2026-10-05 20:12:06 +01:00
2026-10-13 22:53:44 +01:00
2026-10-16 17:12:53 +01:00
2026-10-07 17:26:17 +01:00
2026-10-07 17:26:17 +01:00
2026-10-09 19:18:06 +01:00
2026-10-13 11:16:15 +01:00
2026-10-22 13:46:53 +01:00
2026-10-22 13:13:03 +01:00
2026-10-13 11:14:16 +01:00
2026-10-14 22:53:26 +01:00
2026-10-14 22:53:26 +01:00
2026-10-20 11:28:03 +01:00
2026-10-22 13:46:54 +01:00
2026-10-07 17:26:00 +01:00
2026-10-11 20:49:42 +01:00
2026-10-20 11:28:05 +01:00
2026-10-05 19:40:12 +01:00
2026-10-12 14:49:34 +01:00
2026-10-22 13:46:54 +01:00
2026-10-13 11:14:30 +01:00
2026-10-08 14:27:06 +01:00
2026-10-13 10:27:02 +01:00
2026-10-12 12:16:17 +01:00
2026-10-12 12:16:17 +01:00
2026-10-12 12:16:17 +01:00
2026-10-20 10:50:36 +01:00
2026-10-12 22:37:54 +01:00
2026-10-12 22:37:55 +01:00
2026-10-08 14:28:20 +01:00
2026-10-06 20:54:15 +01:00
2026-10-08 14:29:00 +01:00
2026-10-20 10:55:51 +01:00
2026-10-08 14:29:19 +01:00
2026-10-12 13:02:22 +01:00
2026-10-16 17:11:42 +01:00
2026-10-10 01:33:40 +01:00
2026-10-12 22:37:54 +01:00
2026-10-08 14:28:54 +01:00
2026-10-16 17:11:41 +01:00
2026-10-10 01:28:39 +01:00
2026-10-13 22:53:44 +01:00
2026-10-12 13:01:00 +01:00
2026-10-12 22:58:40 +01:00
2026-10-10 01:01:10 +01:00
2026-10-20 10:53:04 +01:00
2026-10-09 19:17:53 +01:00
2026-10-08 14:27:06 +01:00
2026-10-10 22:11:03 +01:00
2026-10-05 20:11:30 +01:00
2026-10-16 17:12:53 +01:00
2026-10-09 02:48:23 +01:00
2026-10-20 10:35:37 +01:00
2026-10-11 21:06:10 +01:00
2026-10-13 11:14:16 +01:00
2026-10-10 21:20:29 +01:00
2026-10-21 19:32:46 +01:00
2026-10-12 12:18:15 +01:00
2026-10-22 13:12:57 +01:00
2026-10-22 13:47:04 +01:00
2026-10-20 11:28:03 +01:00
2026-10-16 17:13:49 +01:00
2026-10-20 16:56:09 +01:00
2026-10-16 17:13:54 +01:00
2026-10-12 14:49:29 +01:00
2026-10-09 19:17:53 +01:00
2026-10-20 16:56:09 +01:00
2026-10-09 19:18:06 +01:00
2026-10-20 15:40:39 +01:00
2026-10-07 17:26:00 +01:00
2026-10-16 17:12:42 +01:00
2026-10-07 17:26:00 +01:00
2026-10-10 22:11:03 +01:00
2026-10-08 14:27:06 +01:00
2026-10-13 11:14:16 +01:00
2026-10-20 10:35:25 +01:00
2026-10-13 11:14:16 +01:00
2026-10-12 22:37:54 +01:00
2026-10-09 19:18:06 +01:00
2026-10-11 20:49:48 +01:00
2026-10-10 21:38:54 +01:00
2026-10-22 13:46:54 +01:00
2026-10-07 17:26:11 +01:00
2026-10-11 20:47:44 +01:00
2026-10-09 19:18:06 +01:00
2026-10-12 23:02:50 +01:00
2026-10-07 17:26:00 +01:00
2026-10-06 20:54:15 +01:00
2026-10-14 22:53:26 +01:00
2026-10-12 22:58:40 +01:00