Skip to content

feat(agent-runtime): add indexed candidate verification for code search#443

Merged
yacosta738 merged 1 commit into
mainfrom
feat/indexed-candidate-selection
Apr 5, 2026
Merged

feat(agent-runtime): add indexed candidate verification for code search#443
yacosta738 merged 1 commit into
mainfrom
feat/indexed-candidate-selection

Conversation

@yacosta738
Copy link
Copy Markdown
Contributor

Use the workspace trigram index only to narrow candidate files, then verify matches against live file contents for deterministic and correct results.

This pull request adds a new candidate planning system to the search index, enabling efficient and accurate selection of search candidate files based on query patterns and index coverage. It introduces new types and logic to assess index completeness, filter candidates using trigrams, and determine when the index is stale or insufficient. The PR also provides comprehensive tests for these features.

Candidate Planning and Index Coverage:

  • Added CandidateCoverage, CandidateRequest, and CandidatePlan types to represent candidate search planning and index coverage status in WorkspaceTrigramIndex.
  • Implemented plan_candidates method in WorkspaceTrigramIndex to plan candidate search files, check for required trigrams, intersect with discovered files, and classify coverage as complete, partial, or unavailable.
  • Added helper functions normalized_relative_root and extract_required_trigrams for processing search requests and extracting trigrams.

Database Query Enhancements:

  • Added read_candidate_paths and read_index_file_count to sqlite.rs for efficiently querying candidate file paths matching required trigrams and counting indexed files.

Testing and API Exposure:

  • Exposed new types and methods in the module API, and added extensive tests covering candidate planning, index coverage classification, and candidate path selection. [1] [2]

Other:

  • Minor import and dependency updates to support the new functionality. [1] [2] [3]

Use the workspace trigram index only to narrow candidate files, then verify matches against live file contents for deterministic and correct results.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 5, 2026

Warning

Rate limit exceeded

@yacosta738 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 45 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 20 minutes and 45 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a896f78b-4ae4-4669-959d-24229a72b52c

📥 Commits

Reviewing files that changed from the base of the PR and between 024aa20 and 42c01f5.

📒 Files selected for processing (18)
  • clients/agent-runtime/src/search/index.rs
  • clients/agent-runtime/src/search/mod.rs
  • clients/agent-runtime/src/search/sqlite.rs
  • clients/agent-runtime/src/search/tests.rs
  • clients/agent-runtime/src/tools/code_search.rs
  • openspec/changes/archive/2026-04-05-indexed-candidate-selection/design.md
  • openspec/changes/archive/2026-04-05-indexed-candidate-selection/proposal.md
  • openspec/changes/archive/2026-04-05-indexed-candidate-selection/specs/regex-semantics/spec.md
  • openspec/changes/archive/2026-04-05-indexed-candidate-selection/specs/result-format/spec.md
  • openspec/changes/archive/2026-04-05-indexed-candidate-selection/specs/safety-model/spec.md
  • openspec/changes/archive/2026-04-05-indexed-candidate-selection/specs/workspace-index/spec.md
  • openspec/changes/archive/2026-04-05-indexed-candidate-selection/state.yaml
  • openspec/changes/archive/2026-04-05-indexed-candidate-selection/tasks.md
  • openspec/changes/archive/2026-04-05-indexed-candidate-selection/verify-report.md
  • openspec/specs/regex-semantics/spec.md
  • openspec/specs/result-format/spec.md
  • openspec/specs/safety-model/spec.md
  • openspec/specs/workspace-index/spec.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/indexed-candidate-selection

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 5, 2026

✅ Contributor Report

User: @yacosta738
Status: Passed (12/13 metrics passed)

Metric Description Value Threshold Status
PR Merge Rate PRs merged vs closed 89% >= 30%
Repo Quality Repos with ≥100 stars 0 >= 0
Positive Reactions Positive reactions received 10 >= 1
Negative Reactions Negative reactions received 0 <= 5
Account Age GitHub account age 3082 days >= 30 days
Activity Consistency Regular activity over time 108% >= 0%
Issue Engagement Issues with community engagement 0 >= 0
Code Reviews Code reviews given to others 515 >= 0
Merger Diversity Unique maintainers who merged PRs 2 >= 0
Repo History Merge Rate Merge rate in this repo 90% >= 0%
Repo History Min PRs Previous PRs in this repo 200 >= 0
Profile Completeness Profile richness (bio, followers) 90 >= 0
Suspicious Patterns Spam-like activity detection 1 N/A

Contributor Report evaluates based on public GitHub activity. Analysis period: 2025-04-05 to 2026-04-05

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 5, 2026

@yacosta738 yacosta738 merged commit 79080e4 into main Apr 5, 2026
13 checks passed
@yacosta738 yacosta738 deleted the feat/indexed-candidate-selection branch April 5, 2026 17:23
@yacosta738 yacosta738 mentioned this pull request Apr 5, 2026
@dallay-bot dallay-bot Bot mentioned this pull request May 3, 2026
@dallay-bot dallay-bot Bot mentioned this pull request May 6, 2026
This was referenced May 10, 2026
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.

Implement indexed candidate selection and deterministic regex verification

1 participant