Skip to content

Add search quality expectation tests for lexical search#2431

Open
Mbeaulne wants to merge 1 commit into
06-18-improve_ai_rerank_payload_for_component_searchfrom
06-18-improve_component_search_relevance_and_ai_reranking
Open

Add search quality expectation tests for lexical search#2431
Mbeaulne wants to merge 1 commit into
06-18-improve_ai_rerank_payload_for_component_searchfrom
06-18-improve_component_search_relevance_and_ai_reranking

Conversation

@Mbeaulne

Copy link
Copy Markdown
Collaborator

Description

Related Issue and Pull requests

Type of Change

  • Bug fix
  • New feature
  • Improvement
  • Cleanup/Refactor
  • Breaking change
  • Documentation update

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

Test Instructions

Additional Comments

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 06-18-improve_component_search_relevance_and_ai_reranking/c379d9b

@Mbeaulne Mbeaulne changed the title Improve component search relevance and AI reranking Add search quality expectation tests for lexical search Jun 18, 2026
@Mbeaulne Mbeaulne marked this pull request as ready for review June 18, 2026 18:00
@Mbeaulne Mbeaulne requested a review from a team as a code owner June 18, 2026 18:00
expectedDigests: ["text-embeddings"],
},
{
query: "upload a file but not to GCS",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 This is an AI-generated code review comment.

This case passes even if negative-constraint parsing is removed entirely: the plain query "upload a file" already ranks local-upload #1 (upload_file matches "file"; upload_to_gcs does not), and the assertion only pins rank #1 via slice(0,1). It does not exercise the exclusion. Assert the exclusion directly (e.g. expect(results.map(r => r.digest)).not.toContain("gcs-upload")), or shape the fixture so gcs-upload would out-rank local-upload absent the negative clause.

expectedDigests: ["predict-labels"],
},
{
query: "make vector embeddings for text",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 This is an AI-generated code review comment.

No query in this suite requires synonym expansion: each shares a literal token/stem with its target (this one matches on literal vector/embeddings/text), so the synonym feature is never isolated and the suite would not catch it regressing. Add 1-2 synonym-only cases, e.g. "vectorize text documents" → ["text-embeddings"] and "store a file in a bucket" → ["gcs-upload"].

(result) => result.digest,
);

expect(results.slice(0, expectedDigests.length)).toEqual(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 This is an AI-generated code review comment.

These assertions pin only rank #1, not the ordering of close competitors nor that irrelevant components stay out of the visible top-5. Optional: add a couple of 2-element expectedDigests where the secondary match is stable (deterministic tie-break, so not flaky).

}),
]);

it.each([

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 This is an AI-generated code review comment.

No ambiguous-multi-match or empty/nonsense-result case in the suite. Optional: add a query that should return multiple relevant components and assert both are present in the top-N.

@Mbeaulne Mbeaulne changed the base branch from 06-18-improve_ai_rerank_payload_for_component_search to graphite-base/2431 June 18, 2026 19:12
@Mbeaulne Mbeaulne force-pushed the 06-18-improve_component_search_relevance_and_ai_reranking branch from 28a8928 to 6e2b2ae Compare June 18, 2026 19:46
@Mbeaulne Mbeaulne force-pushed the graphite-base/2431 branch from 7d30372 to c443c7a Compare June 18, 2026 19:46
@Mbeaulne Mbeaulne changed the base branch from graphite-base/2431 to 06-18-improve_ai_rerank_payload_for_component_search June 18, 2026 19:47
@Mbeaulne Mbeaulne force-pushed the 06-18-improve_component_search_relevance_and_ai_reranking branch from 6e2b2ae to d8565d2 Compare June 18, 2026 20:28
@Mbeaulne Mbeaulne force-pushed the 06-18-improve_ai_rerank_payload_for_component_search branch from c443c7a to 9fdd3d5 Compare June 18, 2026 20:28
@Mbeaulne Mbeaulne force-pushed the 06-18-improve_component_search_relevance_and_ai_reranking branch from d8565d2 to 761f88a Compare June 18, 2026 20:49
@Mbeaulne Mbeaulne force-pushed the 06-18-improve_ai_rerank_payload_for_component_search branch 2 times, most recently from d9e254e to 1351eea Compare June 18, 2026 21:02
@Mbeaulne Mbeaulne force-pushed the 06-18-improve_component_search_relevance_and_ai_reranking branch from 761f88a to 41a7bd9 Compare June 18, 2026 21:02
@Mbeaulne Mbeaulne force-pushed the 06-18-improve_component_search_relevance_and_ai_reranking branch from 41a7bd9 to c379d9b Compare June 18, 2026 21:16
@Mbeaulne Mbeaulne force-pushed the 06-18-improve_ai_rerank_payload_for_component_search branch from 1351eea to 817441b Compare June 18, 2026 21:16
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