Skip to content

full fix for named search#80

Merged
duncankmckinnon merged 17 commits intonamed-search-fixfrom
workbench-1
Apr 6, 2026
Merged

full fix for named search#80
duncankmckinnon merged 17 commits intonamed-search-fixfrom
workbench-1

Conversation

@duncankmckinnon
Copy link
Copy Markdown
Owner

No description provided.

duncankmckinnon and others added 17 commits April 2, 2026 11:04
Tests verify that partial name matches are rejected and that the correct
evaluator is selected from multiple search results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests cover: exact match success, fuzzy-only results rejection,
finding exact match among multiple candidates, empty results,
and case-sensitive matching. These tests will fail until the
exact name match pattern is applied to GetDashboardQuery.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests cover GetPromptQuery and GetAllPromptVersionsQuery:
- No exact match (fuzzy match rejected)
- Multiple results (correct exact match selected)
- Existing tests updated with name field for compatibility

These tests will FAIL until the implementation is applied.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests cover GetMonitorQuery and GetModelMetricValueQuery to verify:
- GraphQL queries use first: 10 (not first: 1) for multiple candidates
- Exact name match selects correct monitor from multiple results
- Partial/fuzzy matches are rejected with specific error messages
- Similar names (e.g., 'model-v1' vs 'model-v10') are not confused
- Empty edges still raise the original error

These tests will FAIL until the exact match pattern is applied to
monitor_queries.py (_find_exact_name_match + __query_variables__).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change evaluators query from first:1 to first:10 and use
_find_exact_name_match to verify the search result matches
the requested name exactly, preventing fuzzy/partial matches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…st result

Apply the same fix pattern used in model_queries.py and space_queries.py:
fetch up to 10 candidates and use _find_exact_name_match to verify.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix GetPromptQuery and GetAllPromptVersionsQuery to use exact name
matching instead of blindly taking the first search result. Changes:
- Increase search results from first:1 to first:10
- Add name field to GetAllPromptVersionsQuery GraphQL
- Use _find_exact_name_match to verify exact name match
- Raise specific error when no exact match found

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests that will fail until the implementation is updated:
- test_get_custom_metric_no_exact_match: partial match should be rejected
- test_get_custom_metric_multiple_results: correct metric selected from multiple candidates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Changes custom metric search from first:1 to first:10 and uses
_find_exact_name_match to verify the result matches the requested
metric name exactly, preventing fuzzy/partial match false positives.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- GetMonitorQuery: Change first: 1 to first: 10, use _find_exact_name_match
  instead of edges[0] to prevent fuzzy match false positives
- GetModelMetricValueQuery: Change monitors first: 1 to first: 10, add name
  field to GraphQL query, use _find_exact_name_match with fallback for
  backward compatibility when name field is not present in response

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests cover exact match, no match, partial match rejection, empty edges,
custom name field, missing/None nodes, and case sensitivity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@duncankmckinnon duncankmckinnon merged commit 112a1fd into named-search-fix Apr 6, 2026
1 check passed
@duncankmckinnon duncankmckinnon deleted the workbench-1 branch April 6, 2026 17:44
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