Skip to content

Fail closed when exclusive TES lookup is Err or missing - #28

Closed
Pitchfork-and-Torch wants to merge 19 commits into
mainfrom
cursor/exclusive-tes-fail-closed-85bc
Closed

Fail closed when exclusive TES lookup is Err or missing#28
Pitchfork-and-Torch wants to merge 19 commits into
mainfrom
cursor/exclusive-tes-fail-closed-85bc

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown
Owner

Bug

TES get_exclusive_controls timeout or per-id Err was collapsed to exclusive_content = None. DropExclusiveTweetContentRule treats None as not exclusive and Allows.

Mixer SubscriptionHydrator returned Err on get_subscription_author_ids miss. CachedHydrator::update_all skips that write, so subscription_author_id stays None. IneligibleSubscriptionFilter keeps None.

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.

  • Entry: ExclusiveContentHydrator (timed_rpc empty map on timeout; Err/None both become not exclusive). Mixer SubscriptionHydrator::hydrate_from_client.
  • Sink: DropExclusiveTweetContentRule (!is_exclusive() => Allow). For You also IneligibleSubscriptionFilter (None => keep). Both sit in phoenix_candidate_pipeline / reverse_chron_posts_pipeline via VFFilter.
  • Break: TES exclusive RPC error or omitted id assembled as not-exclusive.
  • Viewer effect: a Super Follow / exclusive post ranks as a normal card for non-subscribers on For You and Latest Following.
  • Twin: Genuine 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_results so Found / NotFound / Failed stay distinct. Failed or missing id sets exclusive_hydration_failed. The exclusive rule Drops that candidate with ExclusiveTweet.

Mixer: write subscription_lookup_failed on TES Err or missing key so update_all applies it. Cache stores Failed separately from Resolved(None). The mixer filter drops a failed lookup.

Tests

  • exclusive_slot: Found exclusive, NotFound, Err, missing key, timeout batch
  • Assemble stamps exclusive_hydration_failed on TES Err; NotFound stays not exclusive
  • DropExclusiveTweetContentRule drops Failed for viewer, author, and logged-out
  • Golden corpus case exclusive_tes_lookup_failed_drops
  • Mixer TES Err/missing fail-closed; Ok(None) stays not exclusive
  • Mixer filter drops failed lookup; keeps genuine not-exclusive
  • Cache round-trip preserves Failed vs Resolved(None)

Standalone decision-table harness (same VF + mixer arms): 12/12 passed.

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

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 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>
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.

3 participants