Repository navigation
Conversation
SEARCH_SCORE.deprecated is meant to push deprecated operations down, but no test compares a deprecated and a current document that match a query equally, so a flipped or dropped penalty would go unnoticed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Thanks @Trenyx, looks good! I've approved the CI run and will merge once it's green 🙌 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why/How?
If the
deprecatedweight inSEARCH_SCOREever flipped sign (or was dropped), search would list a deprecated operation above the current one that replaces it, and readers would land on the old endpoint first. No test would notice: no test compares a deprecated and a current document that match a query equally.Tests only: one test (+19 lines) in
src/services/search/__tests__/engine.test.ts. No change to library code.The test adds two documents with the same title and text, the first marked
deprecated: true(the flag the indexer copies from item meta), searches for their title, and expects the current one first.Reference
No linked issue: this PR only adds a test.
Tests
On main
6cd4168, Node 22.23.4:CI=true npx vitest run src/services/search/__tests__/engine.test.ts: 44 passed.vitest run(whole unit suite): 3905 passed, 5 skipped, 0 failed.oxlint --max-warnings=0on the file andtsgo --noEmit --skipLibCheckpass.deprecated: -40changed todeprecated: 40insrc/services/search/engine/constants.ts, the whole suite shows exactly one failure, this new test (['list-pets-v1', 'list-pets-v2']instead of['list-pets-v2', 'list-pets-v1']).npm run e2e.Screenshots (optional)
Check yourself
This test was written with Claude Code during a planted-bug run by SK @ Trenyx.