JMCP: Papers - jmcp/extract-recommendation-scoring-weights-i-AnLIKEry#8
Closed
landigf wants to merge 1 commit into
Closed
JMCP: Papers - jmcp/extract-recommendation-scoring-weights-i-AnLIKEry#8landigf wants to merge 1 commit into
landigf wants to merge 1 commit into
Conversation
Owner
Author
|
Closing: will integrate valuable features directly on main to avoid cascade merge conflicts. |
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.
Review: Extract recommendation scoring weights into config
Change summary: Moves hard-coded numeric weights from
scoreFeedPaperandscoreTrendingPaperinpackages/dbinto two namedas constconfig objects (feedScoringWeights,trendingScoringWeights) exported frompackages/contracts. The scoring functions now referencew.<field>instead of magic numbers. No logic changes — all values are identical to the originals.Validation confidence: High
5, 4, 3, 2, 2, 24for feed;4, 3, 3, 16for trending).as const satisfies Record<string, number>gives both literal types and structural safety.Risks that still remain:
ScoringWeightsunion type is loose — it's a union of two structurally different objects (feedScoringWeightshasinterestMatch/topicOverlapthat trending lacks). Consumers acceptingScoringWeightswon't get compile-time safety on field access without narrowing. If no consumer uses this type today it's harmless, but consider making it a discriminated union or splitting into two explicit types if you plan to pass weights generically.recencyMaxDaysis a ceiling, not a weight — naming it alongside multiplicative weights could mislead a future contributor. A comment or grouping would help, though low priority.Overall: clean, low-risk refactor. Good to merge after
npm run test && npm run checkpasses.