Skip to content

PR #62 follow-up 16: match resolve_dataset names on token boundaries - #68

Merged
VibeSWE merged 5 commits into
mainfrom
fix/pr62-16-resolve-dataset-token-match
Oct 24, 2026
Merged

VibeSWE merged 5 commits into
mainfrom
fix/pr62-16-resolve-dataset-token-match

Conversation

@VibeSWE

@VibeSWE VibeSWE commented Oct 24, 2026 •

Copy link
Copy Markdown

Problem

resolve_dataset (resolve_dataset_candidates in src/tool_executor.rs) gave a dataset 750 points ("dataset name explicitly mentioned in the question") whenever its name appeared anywhere in the query, including inside another word. With visible datasets [api, web], the query show rapid failures matched api inside "rapid". That made api the unique top candidate, so the tool returned status: "resolved" with confidence 0.95 when it should have reported the query as ambiguous.

Fix

The mention score now requires the dataset name to appear as a whole token. A new helper, query_mentions_dataset_name, accepts a match only when the characters on both sides are not name characters ([A-Za-z0-9_-]). Dataset names often contain - and _, so those count as part of a name: otel-metrics is mentioned in show otel-metrics, but not in otel-metrics-v2 or my_otel-metrics. The exact-match, reverse-substring (500) and per-term (25) scoring are unchanged.

docs/tool-api.md now says that a name only counts as mentioned when it is a whole word.

Tests

New test shared_dataset_resolution_requires_whole_name_mentions:

  • show rapid failures no longer resolves api. This assertion fails without the fix.
  • show api errors and errors in (api)? still resolve api.
  • show otel-metrics-v2 errors and show my_otel-metrics no longer resolve otel-metrics. Both fail without the fix.

The existing test shared_dataset_resolution_does_not_select_an_arbitrary_fallback still passes.

Upstream fidelity

This changes code inherited from upstream parseablehq/parseable 32979cb (parseablehq#1831). The change is one call site plus a small free function, so it should merge cleanly with future upstream updates. Proposing the same fix upstream is a good idea; a draft issue is ready, but nothing has been filed.

Stacking

This PR is stacked on #62 (base upstream/tool-catalog-1831). Retarget it to main once #62 merges.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

VibeSWE and others added 3 commits October 24, 2026 13:40
resolve_dataset awarded the 750-point "explicitly mentioned" score whenever
a dataset name occurred anywhere inside the query, so `api` matched inside
"rapid" and resolved with confidence 0.95. Require the name to be a whole
token, treating `-` and `_` as part of dataset names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fix/pr62-16-resolve-dataset-token-match

# Conflicts:
#	docs/tool-api.md
@VibeSWE
VibeSWE changed the base branch from upstream/tool-catalog-1831 to main October 24, 2026 21:53
…ataset-token-match

# Conflicts:
#	docs/tool-api.md
#	src/tool_executor.rs
@VibeSWE
VibeSWE merged commit e170b6f into main Oct 24, 2026
9 checks passed
@VibeSWE
VibeSWE deleted the fix/pr62-16-resolve-dataset-token-match branch October 24, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant