feed: make For You lead with "your people first" (tiering + discovery fallback)

For You shared the full active set with Recent/Explore and only re-ranked by a
blended score, so when a user's signals were thin it collapsed toward freshness
and looked identical to Recently-added.

Give it a structural identity:
- The scorer tags each item forYouTier: 2 = followed author, 1 = interest/
  watch-topic match, 0 = other.
- The sorter leads with tier (your people first) regardless of raw score, then
  ranks within tier; trusted-muted still sinks last.
- When NOTHING is tiered (logged-out / no follows / no interests) it falls back
  to an author-interleaved discovery order (new interleaveByAuthor) so the feed
  never reads as a chronological clone of Recently-added.

Tests: tests/for-you-tiering.test.mjs (tier beats score, tiers stack, muted
last, no-signal interleave, scorer tier tagging). Existing for-you-scorer suite
still green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
thePR0M3TH3ANandClaude Opus 4.8 committed 2026-06-24 08:46:30 -04:00
1 parent f05ba5edf9
commit 4873a43135
3 files changed
+203 -17

No files matched your search

+15
View File
@@ -459,6 +459,11 @@ const FOR_YOU_WEIGHTS = Object.freeze({
disinterestOverlap: 0.3, // penalty for disinterested tags
});
// Affinity at/above this counts as a real interest match (tier 1), so
// interest/watch-topic videos lead the feed alongside follows. Tuned low because
// cosine affinity against a sparse user vector rarely gets near 1.
const FOR_YOU_AFFINITY_TIER = 0.15;
/**
* For You scorer (docs/feed-algo-audit.md). Inclusive + ranked: it scores (never
* filters) so the feed is never empty — when you have no follows/interests/
@@ -540,6 +545,16 @@ export function createForYouScorerStage({
item.metadata = {};
}
item.metadata.forYouScore = score;
// Tier drives "your people first": followed authors (2) and interest/
// watch-topic matches (1) lead the feed regardless of recency; everything
// else (0) ranks below by score. The sorter reads this; when NO item is
// tiered (logged-out / no follows / no interests) it falls back to a
// discovery ordering so For You never mirrors Recently-added.
item.metadata.forYouTier = followsMatch
? 2
: affinity >= FOR_YOU_AFFINITY_TIER
? 1
: 0;
item.metadata.forYouComponents = {
followsMatch,
affinity,