Skip to content

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

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

Stop ads served history from burying organic For You posts#184
Pitchfork-and-Torch wants to merge 1 commit into
xai-org:mainfrom
Pitchfork-and-Torch:cursor/ads-served-bury-organic-be50

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown

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 (#127). Not seen/served reply-parent (#179). Not quoted related ids (#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.

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.
@Pitchfork-and-Torch
Pitchfork-and-Torch force-pushed the cursor/ads-served-bury-organic-be50 branch from 45cd05f to 902a06f Compare September 8, 2026 23:07
@Pitchfork-and-Torch

Copy link
Copy Markdown
Author

Parking this intern-stack PR per operator GitHub cleanup (2026-09-08). Hunt notes remain local. Not a reject of the class.

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.

1 participant