[#560] Improve trending algorithm — recency boost, Bayesian ratings, default sort#561
[#560] Improve trending algorithm — recency boost, Bayesian ratings, default sort#561realproject7 merged 2 commits intomainfrom
Conversation
- Add recency signal (20% weight) using last_plot_time with inverse-time decay so recently updated stories rank higher - Replace raw average rating with Bayesian weighted rating (prior_count=5, prior_mean=3.0) so stories need multiple good ratings to rank high - Redistribute weights: rating 25%, price 20%, TVL 20%, continuation 15%, recency 20% - Change default homepage sort tab from "new" to "trending" Fixes #560 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
project7-interns
left a comment
There was a problem hiding this comment.
T2b APPROVE. Bayesian rating formula is correct (prior_count=5, prior_mean=3.0). Weights sum to 1.00. Recency decay is clean with proper null fallback to createdAt. ratingMap refactor is well-structured. Default sort change is straightforward. No issues found.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The Bayesian weighting and default-tab change are reasonable, but the recency requirement is still not implemented end-to-end.
Findings
- [high] The new recency signal only reorders the newest 50 stories by creation time, because the candidate query still sorts by
block_timestampand truncates before scoring. Older stories with a freshlast_plot_timenever enter the candidate set, so they cannot receive the intended recency boost.- File:
lib/ranking.ts:95 - Suggestion: Build the candidate set from
last_plot_timeor widen the pre-score window enough that recently updated older stories remain eligible before the final ranking pass.
- File:
Decision
Requesting changes because queue #560 explicitly requires trending to favor recently updated stories, and the current candidate selection still filters those stories out before the new signal is applied.
Fetch two pools (newest by creation + recently active by last_plot_time) and merge/deduplicate, so older stories with fresh plot activity are eligible for the recency boost instead of being cut off by the block_timestamp ordering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The recency signal is now wired through the candidate-selection stage instead of only the final scoring stage.
Findings
- None.
Decision
Approving because the updated lib/ranking.ts now merges newest-by-creation and newest-by-activity candidate pools before scoring, so older stories with fresh last_plot_time updates are eligible for the recency boost, and the PR still satisfies the Bayesian-rating and default-tab requirements.
Summary
last_plot_timewith inverse-time decay (1 / (1 + daysSince)) so recently updated stories rank higher than stale ones.(count × avg + 5 × 3.0) / (count + 5)— a story with 1 rating of 5.0 now scores 3.33 instead of 5.0, while 20 ratings of 4.5 scores 4.20.trendingtab instead ofnew.Files Changed
lib/ranking.ts—computeTrendScore()updated with 5th signal + Bayesian rating;fetchCandidatesAndRatings()now returns rating countssrc/app/page.tsx— default tab changed from"new"to"trending"Test plan
?tab=newstill works as beforeFixes #560
🤖 Generated with Claude Code