feat: implement project recommendation engine with scoring logic and …#306
Open
Abhiraj-Agarwal wants to merge 1 commit into
Open
Conversation
…associated unit tests
|
@Abhiraj-Agarwal is attempting to deploy a commit to the komalsony234-1530'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.
Summary [required]
This PR fixes a one-sided alias normalisation bug in
utils/recommender.py. TheSKILL_ALIASESdictionary was only applied to user input insideparse_skills(), but never to project skills insidescore_single_project(). As a result, a user typing"js"would have their input correctly resolved to"javascript", but a project storing the skill as"JS"would only be lowercased to"js"— never aliased — causing the comparison to silently fail and the project to be excluded from results. The fix applies the sameSKILL_ALIASESlookup to project skills, ensuring both sides of the match resolve to the same canonical form.Related Issue [required]
Closes #205
Type of Change [required]
data/projects.jsonWhat Was Changed [required]
File modified:
tests/test_basic.pyHow to run:
Expected output:
Test Results [required]
Screenshots (if UI change)
No visual changes in this PR — section removed.
Self-Review Checklist [required]
fix/skill-alias-normalisation-project-sidepython tests/test_basic.pyand all 31 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
The core change is a single line inside
score_single_project()inutils/recommender.py:Please pay attention to whether
SKILL_ALIASESshould be extended to cover any additional common variants (e.g."node"→"node.js") as a follow-up — that is out of scope for this PR but worth noting.Summary [required]
This PR fixes a one-sided alias normalisation bug in
utils/recommender.py. TheSKILL_ALIASESdictionary was only applied to user input insideparse_skills(), but never to project skills insidescore_single_project(). As a result, a user typing"js"would have their input correctly resolved to"javascript", but a project storing the skill as"JS"would only be lowercased to"js"— never aliased — causing the comparison to silently fail and the project to be excluded from results. The fix applies the sameSKILL_ALIASESlookup to project skills, ensuring both sides of the match resolve to the same canonical form.Related Issue [required]
Closes #205
Type of Change [required]
data/projects.jsonWhat Was Changed [required]
utils/recommender.pyscore_single_project()to applySKILL_ALIASESto project skills before comparison, not just lowercase themtests/test_basic.pyHow to Test This PR [required]
git checkout fix/skill-alias-normalisation-project-sidepip install -r requirements.txtpython app.pyhttp://127.0.0.1:5000, typejsas your skill, select any level/interest/time, and submit — confirm that projects storing"JS"in their skills are returnedpython tests/test_basic.pyExpected test output:
Associated Unit Tests
test_alias_match_project_side_js"js"matches a project whoseskillsfield stores"JS"— confirms alias is now applied on the project sidetest_alias_match_project_side_py"py"matches a project storing"Python"— verifies alias resolution isn't limited to thejscasetest_alias_match_project_side_cpp"c++"matches a project storing"cpp"— edge case sincec++contains a special charactertest_no_regression_exact_skill_match"python"still matches a project storing"Python"— ensures existing lowercase normalisation wasn't broken by the changeFile modified:
tests/test_basic.pyHow to run:
Expected output:
Test Results [required]
Screenshots (if UI change)
No visual changes in this PR — section removed.
Self-Review Checklist [required]
fix/skill-alias-normalisation-project-sidepython tests/test_basic.pyand all 31 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
The core change is a single line inside
score_single_project()inutils/recommender.py:Please pay attention to whether
SKILL_ALIASESshould be extended to cover any additional common variants (e.g."node"→"node.js") as a follow-up — that is out of scope for this PR but worth noting.