Skip to content

Stop ads served history from burying organic For You posts - #66

Closed
Pitchfork-and-Torch wants to merge 1 commit into
mainfrom
cursor/ads-served-bury-organic-be50
Closed

Pitchfork-and-Torch wants to merge 1 commit into
mainfrom
cursor/ads-served-bury-organic-be50

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown
Owner

Bug

Ads bleed into organic For You via served history.

UpdateServedHistorySideEffect writes ads as PROMOTED_TWEET with tweet_id = ad.post_id. recently_served_ids ignored entity_type and copied every tweet_id / source_tweet_id into query.served_ids. PreviouslyServedPostsFilter then drops any organic candidate whose id is in that set.

Two effects:

  1. One ad impression buries the organic post for the exclude window (default 10 minutes, 100 ids).
  2. Ad rows consume the ExcludeServedTweetIdsNumber budget, so recent organic served ids fall off and can repeat.

Not brand-safety rank leak (xai-org#127). Not seen/served reply-parent (xai-org#179). Not quoted related ids (xai-org#151).

Proof

INPUT:  ad.post_id=P served as PROMOTED_TWEET; organic candidate P on next For You
PATH:   put(ad) -> MH key stamps served_time_ms
        -> recently_served_ids copies P (no entity_type gate)
        -> PreviouslyServedPostsFilter.related_post_ids contains P
OUTPUT: organic P DROPPED
        ads also take max_items slots so older organic served ids fall off

Fix

Allowlist EntityIdType::TWEET in recently_served_ids. Ads stay in served history for ad fatigue. Organic exclude-already-served stays organic.

Tests: promoted ids stay out; ads do not eat the budget; organic TWEET / retweet source ids still exclude; PreviouslyServedPostsFilter keeps P after an ad impression and still drops P after an organic impression.

Open in Web Open in Cursor 

recently_served_ids treated every ServedHistory tweet_id as organic,
including PROMOTED_TWEET rows written with ad.post_id. One ad impression
then dropped the organic post and consumed the served-id budget.

Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants