Stop rank-all from indexing NSFW and VF-dropped posts into SFW retrieval - #169
Conversation
…val. getPostMetadataLightweight rebuilt TweetCoreData without nsfwUser/nsfwAdmin, so isAuthorEligible could not see account NSFW bits. The processor then called isNsfwPost (not isAdultPost), skipped VF on evergreen, fail-opened on VF errors, and dumped dropped NSFW video into the generic metadata topic that SidTail indexes as tail. Missing authors were written as -1. Restore the NSFW bits, drop adult/NSFW-author/VF-unsafe posts from SFW indexes (including evergreen), fail closed on VF errors, tag NSFW metadata so tail skips it, and reject non-positive ids. Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
238fde1 to
ffa9c0a
Compare
|
Thanks for working on this. I have one concern regarding the author-level NSFW check. As I understand the proposed behavior, a post from an account marked nsfwUser / nsfwAdmin can be excluded from SFW retrieval based on the author’s account-level status, even when the individual post itself has no adult/NSFW annotation. Would it make sense to distinguish between:
The second case matters because adult creators can also publish completely non-sensitive posts (text, commentary, everyday photos, SFW video, etc.). Using the account-level flag as a blanket retrieval exclusion could prevent otherwise eligible SFW posts from reaching out-of-network audiences solely because of the author’s account classification. This is related to the account-level vs. post-level visibility question raised in #79. Could the author-level flag be used as a safety signal while still allowing a post that is positively classified as SFW to enter appropriate SFW retrieval surfaces? |
|
Thanks. That is a product question, not a bug this PR is introducing.
The rest of the PR is independent of author vs post policy: the processor called Whether SFW posts from NSFW-labeled accounts should still enter SFW OON indexes is #79. Leaving that decision to xAI rather than changing the existing eligibility gate in this write-path fix. |
Problem
Phoenix Rank All is the out-of-network retrieval index for For You (
1fav,video,post_creation, topic options,evergreen_videowith a 5-year window, andtail). Several independent holes on that write path let adult / NSFW-author / VF-unsafe posts into the SFW indexes.1. Lightweight tweet rebuild stripped author NSFW bits
getPostMetadataLightweightis what every index event uses. It reconstructedTweetCoreDatawith user/text/reply/share only — nonsfwUser/nsfwAdmin.The older helper,
getTweetypieResponse, already fetches those federated fields and uses them forhasEligibleMedia. The lightweight path dropped the fetches, soisAuthorEligiblealways saw the Thrift defaults (false/false).isAuthorEligibleitself then fail-opened whencoreDatawas missing (getOrElse(true)).2. Processor called the wrong adult check
The processor named the local
isAdultPostbut calledisNsfwPost:isAdultPostisisNsfw || isAdult.isNsfwPostisisNsfwonly. Adult-labeled, non-NSFW posts went into SFW1fav/video/post_creation/ topic indexes. Combined with (1), NSFW accounts posting unlabeled media also went in — especially onPostCreation, before unified annotations exist.3. Evergreen skipped VF entirely
EvergreenVideo/EvergreenNsfwVideoindexed any immersive video with no VF and no adult/author-NSFW check.evergreen_videois retained for 5 years.4. VF lookup fail-opened
shouldDropPostByVFtreated a thrown VF read or a missing verdict as “do not drop” (getOrElse(false)). A VF outage indexed unsafe posts into every SFW window.5. Dropped NSFW video was dumped as generic metadata → tail
SidTail only accepts
indexName == "metadata"(default when the field is absent). TheshouldDropPostbranch still calledbuildMetadataDumpwith noindexName, so NSFW videos that were correctly kept out of1favwere written intotail.6. Missing author became
-1getPostPhoenixRankAllMetadatausedauthorId.getOrElse(-1). Consumers only rejectedauthor_id == 0, so every authorless row collided on-1in tail / metadata / topic / main.Fix
nsfwUser/nsfwAdminingetPostMetadataLightweightand write them ontoTweetCoreData(same federated columns asgetTweetypieResponse).isAuthorEligiblefail-closes whencoreDatais missing.isAdultPost|| NSFW author. Apply that to SFW evergreen. NSFW evergreen still respects VF (spam / violence / withheld) but allows adult.getOrElse(true)).indexName = "nsfw_metadata"so SidTail skips them.Noneinstead ofauthorId = -1.post_id <= 0orauthor_id <= 0.Proof
PostCreation)post_creation/video/1favisAuthorEligible == false)isAdult=true,isNsfw=falseisNsfwPost)isAdultPost)getOrElse(false))EvergreenVideo+ VF-drop / NSFW authortailnsfw_metadata, SidTail skipsauthorId = -1, storedNone; processors reject<= 0Rust processors cover sentinel
-1andnsfw_metadataskip.phoenix-rankallis not in the OSS Cargo workspace, so those tests are for the internal crate.Scope
One path: rank-all index writes. No RankingScorer, no ads blender, no home-mixer VF leftovers.