Skip to content

Fail closed when TES edit-control lookup is Err or missing - #33

Closed
Pitchfork-and-Torch wants to merge 19 commits into
mainfrom
cursor/conversation-control-fail-open-bbb4
Closed

Fail closed when TES edit-control lookup is Err or missing#33
Pitchfork-and-Torch wants to merge 19 commits into
mainfrom
cursor/conversation-control-fail-open-bbb4

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown
Owner

TES get_edit_control timeout or per-id Err was collapsed to edit_control = None. is_stale_tweet treats None as current and Allows. EditControl::Edit with no edit_control_initial did 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).

  • Entry: TesHydrator::hydrate_tweetsget_edit_control (timed_results already Found / NotFound / Failed)
  • Sink: DropStaleTweetsRule (is_stale() && !is_retweet()). Wired on TimelineHome and TimelineHomeRecommendations via TES_HOME_DROPS / VFFilter.
  • Break: Failed TES edit-control RPC or omitted id assembled as not-stale. Missing edit_control_initial on the Edit variant also assembled as current.
  • Viewer effect: a superseded / edited post ranks as the current card on For You and Latest Following.
  • Twin: Genuine Ok(None) (never edited) is unchanged.

Stamp edit_control_lookup_failed when the edit-control slot is Failed. is_stale_tweet Drops Failed, empty edit chains, and Edit-without-initial. DropStaleTweetsRule already drops stale non-retweets.

  • Assemble stamps lookup-failed on TES Err; NotFound stays not failed; Found current stays current
  • Failed still stamps when core data is missing
  • is_stale_tweet true for lookup-failed, empty chain, and Edit-without-initial
  • DropStaleTweetsRule drops Failed for viewer, author, and logged-out
  • Golden corpus: stale_edit_control_lookup_failed_drops, stale_edit_control_missing_initial_drops

Standalone decision-table harness (same Found / NotFound / Failed / missing-initial arms): 12/12 passed.

cargo test cannot 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

Open in Web Open in Cursor 

CI agent and others added 19 commits August 14, 2026 20:55
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>
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.

4 participants