Fail closed when TES edit-control lookup is Err or missing - #33
Closed
Pitchfork-and-Torch wants to merge 19 commits into
Closed
Fail closed when TES edit-control lookup is Err or missing#33Pitchfork-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 get_edit_control already returns Found / NotFound / Failed. Assemble collapsed Failed to None, and is_stale_tweet treated None as current, so DropStaleTweetsRule allowed superseded edits. 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.
TES
get_edit_controltimeout or per-idErrwas collapsed toedit_control = None.is_stale_tweettreatsNoneas current and Allows.EditControl::Editwith noedit_control_initialdid the same.This is not xai-org#134 (NSFW / takedown / nullcast / media TES flags). xai-org#134 leftover left edit-control out. Not xai-org#141 (exclusive TES). ConversationControl / TrustedFriends / MentionFilter have no TES hydrator on this dump (schema-only).
TesHydrator::hydrate_tweets→get_edit_control(timed_resultsalready Found / NotFound / Failed)DropStaleTweetsRule(is_stale() && !is_retweet()). Wired on TimelineHome and TimelineHomeRecommendations viaTES_HOME_DROPS/VFFilter.edit_control_initialon the Edit variant also assembled as current.Ok(None)(never edited) is unchanged.Stamp
edit_control_lookup_failedwhen the edit-control slot is Failed.is_stale_tweetDrops Failed, empty edit chains, and Edit-without-initial.DropStaleTweetsRulealready drops stale non-retweets.is_stale_tweettrue for lookup-failed, empty chain, and Edit-without-initialDropStaleTweetsRuledrops Failed for viewer, author, and logged-outstale_edit_control_lookup_failed_drops,stale_edit_control_missing_initial_dropsStandalone decision-table harness (same Found / NotFound / Failed / missing-initial arms): 12/12 passed.
cargo testcannot run. Public dump has no visibility-filtering / Home Mixer manifest.ConversationControl / TrustedFriends / MentionFilter are schema-only (thunder tweet/user). No TES RPC on this dump to hydrate an ACL. Exclusive TES fail-closed is xai-org#141. DropStaleTweetsRule still Allows stale retweets.
Fork PR: none