Repository navigation
test(recommendation): add automated scoring tests - #406
Merged
DivyashreeR008 merged 1 commit intoOct 20, 2026
Merged
DivyashreeR008 merged 1 commit into
DivyashreeR008 merged 1 commit into
Conversation
|
@Subodh-17 is attempting to deploy a commit to the DIVYA's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Description
Fixes #175.
This PR introduces an automated, deterministic Vitest test suite for the agent recommendation engine in
src/lib/agentRecommendation/scoring.test.js.Scope and Coverage
The test suite covers the following areas:
Free-Text Tokenization (
tokenizeFreeText):/,&,!,,,;) while preserving allowed technical symbols (+,#,.,-).STOP_WORDSset.FREE_TEXT_TOKEN_LIMIT).Score Normalization (
normalizeScore):Math.round).NaN,Infinity, strings, null/undefined).Agent Scoring (
scoreAgent&getMaxPossibleScore):exactCategory(+30),goalCategory(+20),taskType(+18 per task),capabilityKeyword(+6 per capability),providerExact(+8),providerAny/ compatible (+4),freeTextName(+10),freeTextDescription(+5),experience(+3), andurgency(+3).Recommendation Ranking & Public Boundary (
recommendAgents):null,undefined, and agent records missingid.id.exactCategorymatch presenceprovidermatch presenceRESULT_LIMIT = 10default and custom limits).MIN_CONFIDENT_SCORE = 12).{ agentId, score, matchedSignals, reasons, isConfident, matchPercentage }and do not leak the internalagentreference.Explanation Integrity (
buildRecommendationReasons):Issue-Specific Known-Defect Characterization:
AI,ML,Go,JS,DB,C#) being dropped by thetoken.length > 2filter.Production Code Notice
No production code, dependencies, or build configurations were modified in this PR. This is a strictly tests-only addition at
src/lib/agentRecommendation/scoring.test.js.Verification Results
All checks freshly verified locally:
npx vitest run src/lib/agentRecommendation/scoring.test.jsResult: 58 passed (58) in
34ms(Duration:1.69s, exit code0).npm test(vitest run)Result: 25 passed (25) test files, 165 passed (165) tests in
7.35s(exit code0).npm run build(vite build)Result: Built successfully in
9.27s(exit code0).git diff --checkResult: Clean, 0 warnings (exit code
0).Review Request
Requesting review from the maintainers. Thank you!