Skip to content

test(workspace): regression test for document_path in search results - #509

Merged
ilblackdragon merged 4 commits into
mainfrom
we-have-should-have-a-test-the
Mar 6, 2026
Merged

ilblackdragon merged 4 commits into
mainfrom
we-have-should-have-a-test-the

Conversation

@zmanian

@zmanian zmanian commented Mar 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • cargo test workspace::search::tests::test_rrf_propagates_document_path passes

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

…rough RRF

Verifies that search results carry the source document's file path
through the RRF fusion pipeline, not the document UUID. Covers the
bug fixed in PR #503 / issue #481.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added scope: workspace Persistent memory / workspace size: M 50-199 changed lines labels Mar 4, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a crucial regression test to safeguard against a previously identified bug in the search functionality. The test ensures that the system consistently propagates the correct file paths for documents through the reciprocal rank fusion (RRF) process, preventing a scenario where internal document identifiers (UUIDs) might erroneously replace user-friendly file paths in search results. This enhancement improves the robustness of the search system by validating the integrity of document metadata.

Highlights

Changelog
  • src/workspace/search.rs
    • Added a new test function test_rrf_propagates_document_path to verify correct document_path propagation in search results.
    • Introduced a helper function make_result_with_path for creating RankedResult instances with specified paths.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@github-actions github-actions Bot added risk: low Changes to docs, tests, or low-risk modules contributor: core 20+ merged PRs labels Mar 4, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a valuable regression test to ensure that document_path is correctly propagated through the reciprocal rank fusion pipeline. The test covers full-text, vector, and hybrid search scenarios, and correctly asserts that file paths are preserved instead of being replaced by document UUIDs. The implementation is solid, and I've provided a suggestion to improve the clarity and robustness of an assertion in the new test, aligning with best practices for simpler, more reliable checks.

Comment thread src/workspace/search.rs Outdated
zmanian and others added 3 commits March 3, 2026 21:33
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
[skip-regression-check]
@github-actions github-actions Bot added the scope: dependencies Dependency updates label Mar 6, 2026
@ilblackdragon
ilblackdragon merged commit ffb9978 into main Mar 6, 2026
16 checks passed
@ilblackdragon
ilblackdragon deleted the we-have-should-have-a-test-the branch March 6, 2026 23:27
This was referenced Mar 6, 2026
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
…earai#509)

* test(workspace): add regression test for document_path propagation through RRF

Verifies that search results carry the source document's file path
through the RRF fusion pipeline, not the document UUID. Covers the
bug fixed in PR nearai#503 / issue nearai#481.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update src/workspace/search.rs

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* chore: merge main and fix formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
[skip-regression-check]

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
drchirag1991 pushed a commit to drchirag1991/ironclaw that referenced this pull request Apr 8, 2026
…earai#509)

* test(workspace): add regression test for document_path propagation through RRF

Verifies that search results carry the source document's file path
through the RRF fusion pipeline, not the document UUID. Covers the
bug fixed in PR nearai#503 / issue nearai#481.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update src/workspace/search.rs

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* chore: merge main and fix formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
[skip-regression-check]

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: low Changes to docs, tests, or low-risk modules scope: dependencies Dependency updates scope: workspace Persistent memory / workspace size: M 50-199 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants