JMCP: Papers - jmcp/build-the-discovery-and-recommendation-e-Tr10Mvva#6
Closed
landigf wants to merge 1 commit into
Closed
JMCP: Papers - jmcp/build-the-discovery-and-recommendation-e-Tr10Mvva#6landigf wants to merge 1 commit into
landigf wants to merge 1 commit into
Conversation
…based on follows, stars, and topic overlap
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.
All 5 tests pass, types check, Next.js build succeeds.
Review Summary
Change summary
Adds a discovery/recommendation engine to the Papers platform:
Data model — Introduces first-class
FollowandStarentity arrays inDemoState, replacing the previous implicit follow/star tracking that only toggled boolean flags on papers. Seed data covers all three demo users.Feed scoring —
scoreFeedPapernow incorporates follow-boost (+6) and network-star-boost (up to +9), with human-readable reasons ("from someone you follow", "starred by N in your network").Recommendation engine (
getRecommendations) — Surfaces up to 5 papers the viewer hasn't authored or starred, scored by:UI — Feed page renders a "Recommended / Based on your network" section. Daily digest gains a "From your network" section.
Toggle persistence —
toggleFollowandtoggleStarnow push/splice into thefollows/starsarrays, keeping the relational data consistent with the boolean flags on papers.Tests — Three new tests: follow-boost in feed, recommendation properties (sorted, non-empty reasons), and exclusion of viewer-authored/starred papers.
Validation confidence: High
npm run test— 5/5 pass (including 3 new)npm run check— clean across all 7 packagesgetRecommendationscall in the feed pageRemaining risks
for…ofoverviewerStarredIds × starsis fine for demo data but would need indexing for real scalereadDemoStatecalled twicegetRecommendationsre-reads state from disk even thoughgetDailyDigestalready read it — no correctness issue, just redundant I/Odemo-state.jsonfiles won't havefollows/starsarrays — handled gracefully by theArray.isArrayfallback to initial state, but old star/follow toggles done before this change are lost