Stop ads served history from burying organic For You posts - #184
Closed
Pitchfork-and-Torch wants to merge 1 commit into
Closed
Stop ads served history from burying organic For You posts#184Pitchfork-and-Torch wants to merge 1 commit into
Pitchfork-and-Torch wants to merge 1 commit into
Conversation
cursor
Bot
force-pushed
the
cursor/ads-served-bury-organic-be50
branch
from
September 8, 2026 00:48
c07b5e0 to
45cd05f
Compare
This was referenced Sep 8, 2026
Closed
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
force-pushed
the
cursor/ads-served-bury-organic-be50
branch
from
September 8, 2026 23:07
45cd05f to
902a06f
Compare
Author
|
Parking this intern-stack PR per operator GitHub cleanup (2026-09-08). Hunt notes remain local. Not a reject of the class. |
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.
Bug
Ads bleed into organic For You via served history.
UpdateServedHistorySideEffectwrites ads asPROMOTED_TWEETwithtweet_id = ad.post_id.recently_served_idsignoredentity_typeand copied everytweet_id/source_tweet_idintoquery.served_ids.PreviouslyServedPostsFilterthen drops any organic candidate whose id is in that set.Two effects:
ExcludeServedTweetIdsNumberbudget, 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
Fix
Allowlist
EntityIdType::TWEETinrecently_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.