Fail closed when exclusive TES lookup is Err or missing - #28
Closed
Pitchfork-and-Torch wants to merge 19 commits into
Closed
Fail closed when exclusive TES lookup is Err or missing#28Pitchfork-and-Torch wants to merge 19 commits into
Pitchfork-and-Torch wants to merge 19 commits into
Conversation
in_network_ids is passed to the VF client without deduplication, while oon_ids is deduped four lines below. retweeted_tweet_id is pushed for every candidate that has one, so the same ID repeats once per retweet of a given post — most often when that post is going viral. Neither VfClient implementation dedupes its input: StratoVfClient builds one call per element, and XaiVfClient chunks by XAI_VF_MAX_BATCH_SIZE, so duplicates consume batch slots and can force an extra round trip. Not a correctness issue — results collapse into a HashMap keyed by tweet ID — but redundant work on the For You serving path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deduplicate in_network_ids before VF lookup
TES exclusive_controls timeout/error and mixer subscription_author_ids miss were assembled as not-exclusive, so Super Follow posts ranked as normal organic. Stamp exclusive_hydration_failed and drop those ids. Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
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
TES
get_exclusive_controlstimeout or per-idErrwas collapsed toexclusive_content = None.DropExclusiveTweetContentRuletreatsNoneas not exclusive and Allows.Mixer
SubscriptionHydratorreturnedErronget_subscription_author_idsmiss.CachedHydrator::update_allskips that write, sosubscription_author_idstaysNone.IneligibleSubscriptionFilterkeepsNone.This is not xai-org#129 (viewer subscription-list miss starve). xai-org#129 keeps exclusive posts when the list was not loaded and relies on VF. VF was fail-opening the same TES exclusive read.
ExclusiveContentHydrator(timed_rpcempty map on timeout;Err/Noneboth become not exclusive). MixerSubscriptionHydrator::hydrate_from_client.DropExclusiveTweetContentRule(!is_exclusive() => Allow). For You alsoIneligibleSubscriptionFilter(None => keep). Both sit inphoenix_candidate_pipeline/reverse_chron_posts_pipelineviaVFFilter.Ok(None)(tweet is not exclusive) is unchanged. Super-follow graph miss still fail-closes as not subscribed.Fix
VF: run exclusive TES through
timed_resultsso Found / NotFound / Failed stay distinct. Failed or missing id setsexclusive_hydration_failed. The exclusive rule Drops that candidate withExclusiveTweet.Mixer: write
subscription_lookup_failedon TESError missing key soupdate_allapplies it. Cache stores Failed separately fromResolved(None). The mixer filter drops a failed lookup.Tests
exclusive_slot: Found exclusive, NotFound, Err, missing key, timeout batchexclusive_hydration_failedon TES Err; NotFound stays not exclusiveDropExclusiveTweetContentRuledrops Failed for viewer, author, and logged-outexclusive_tes_lookup_failed_dropsOk(None)stays not exclusiveStandalone decision-table harness (same VF + mixer arms): 12/12 passed.
cargo testcannot run. Public dump has no visibility-filtering / Home Mixer manifest.Leftover
Gizmoduck author NSFW miss remains xai-org#125. Socialgraph mute/block Failed is xai-org#137. Interstitial on an ancillary quote/RT/ancestor still does not set
drop_ancillary_posts(keep-and-warn; xai-org#134 left it).Fork PR: none