
Universal Code Search
Sourcegraph (Cody + Amp) · Sourcegraph
Code Intelligence — Sourcegraph
Evaluates Sourcegraph's Universal Code Search across 9 scenario-based test cases, each graded against an expected-behavior rubric by an LLM judge, from Corsac's Code Intelligence eval coverage.
About Sourcegraph
Sourcegraph is a code intelligence and AI coding platform: universal code search, precise code navigation, Cody chat grounded in your codebase, cross-repo batch changes, and the Amp autonomous agent — deployed across large enterprise codebases.
Sample tests· showing 3 of 9
| # | Input | Expected behavior | Check |
|---|---|---|---|
| 01 | Operator runs `log15.Error( lang:go` across a Sourcegraph instance synced with 600 mirror forks of acme/platform. Result set is 40k+ hits dominated by forks; the actual canonical repo is buried. | Rewrite as `repo:^github\.com/acme/platform$ lang:go log15.Error(` — anchor the repo: regex with ^...$ to exclude forks. Keyword patterntype is the default since v5.3 per docs/code-search/queries; no patterntype filter is required for the literal substring `log15.Error(`. | Pass / FailCode Assistanthigh |
| 02 | Saved query `patterntype:regexp foo bar` ran fine before a 5.3 upgrade. After upgrade, the same query (without patterntype) returns literal `foo bar` matches only, dropping the fuzzy `foo(.*?)bar` results the operator depended on… | Keyword is the default patterntype since v5.3; explicitly add `patterntype:regexp` to the saved query or rewrite the pattern as a boolean keyword expression. Cite docs/code-search/queries patterntype section. Do not 'fix' by adding `.*` to the keyword pattern — that matches the literal `.*` charact… | Pass / FailCode Assistanthigh |
| 03 | Security wants every `fmt.Printf(:[1])` migrated to `log15.Debug(:[1])` across `repo:acme/backend` on main, but NOT in `vendor/`. Operator considers a regex search-and-replace via sed. | Use structural search: `patterntype:structural repo:^github\.com/acme/backend$ file:-vendor/ fmt.Printf(:[args])` to preview match holes, then hand off to a Batch Change with a comby step that rewrites to `log15.Debug(:[args])`. Do not use plain sed — it ignores Go AST boundaries and breaks multi-l… | Pass / FailCode Assistanthigh |
How this eval is graded
Grade against expected.ideal_behavior and expected.rubric. Per-criterion pass requires mean >= 4.0 and no criterion below 3.
Rubric criteria
- Sourcegraph
- Code Assistant
- Universal Code Search
Recommended for
Works with
Related evals
Exa
Evaluates Exa Labs' Contents Freshness & Cache Semantics across 9 scenario-based test cases, each graded against an expected-behavior rubric by an LLM judge, from Corsac's Neural web search API eval coverage.
View Search & KnowledgeExa
Evaluates Exa Labs' Corpus Safety & Prompt Injection across 12 scenario-based test cases, each graded against an expected-behavior rubric by an LLM judge, from Corsac's Neural web search API eval coverage.
View Search & KnowledgeExa
Evaluates Exa Labs' Filters Domains & Date Controls across 10 scenario-based test cases, each graded against an expected-behavior rubric by an LLM judge, from Corsac's Neural web search API eval coverage.
ViewFrequently asked questions
What does the Universal Code Search eval for Sourcegraph Sourcegraph (Cody + Amp) test?+
Evaluates Sourcegraph's Universal Code Search across 9 scenario-based test cases, each graded against an expected-behavior rubric by an LLM judge, from Corsac's Code Intelligence eval coverage.
How is the Universal Code Search eval scored?+
The judge rubric: Grade against expected.ideal_behavior and expected.rubric. Per-criterion pass requires mean >= 4.0 and no criterion below 3.
How many test cases does this eval pack include?+
The Universal Code Search pack for Sourcegraph Sourcegraph (Cody + Amp) contains 9 test cases. 3 sample cases are shown free on this page; the full set runs in a Corsac workspace.
How do I run this eval?+
Sign up for Corsac, connect your model or agent endpoint, and run the Universal Code Search pack as-is or after customizing thresholds. Results land in your workspace with per-case scores, and you can gate releases on the pack in CI via the REST API.
Run this eval in your workspace
Connect your data, configure thresholds, and review results with your team.