Skip to content

Fail closed when socialgraph mute/block relationship reads fail - #137

Open
Pitchfork-and-Torch wants to merge 1 commit into
xai-org:mainfrom
Pitchfork-and-Torch:cursor/socialgraph-relationship-fail-closed-cc06
Open

Fail closed when socialgraph mute/block relationship reads fail#137
Pitchfork-and-Torch wants to merge 1 commit into
xai-org:mainfrom
Pitchfork-and-Torch:cursor/socialgraph-relationship-fail-closed-cc06

Conversation

@Pitchfork-and-Torch

@Pitchfork-and-Torch Pitchfork-and-Torch commented Sep 7, 2026

Copy link
Copy Markdown

Wave 3 check

#134 leftover: socialgraph relationship miss still fail-opens as not muted / not blocked. Verified on xai-org/main (902a06f).

This is not #134 (TES NSFW / takedown / nullcast / media flags). This is not #121 (mixer VF Err / missing key). Those stay on their own PRs.

Bug

SocialgraphHydrator already marks an empty or failed Flock read as Hydrated::Failed. assemble then does relationships.get_or_default, so Failed becomes all-false. ViewerMutesAuthorRule / ViewerBlocksAuthorRule / MutedRetweetsRule never fire.

Latest Following never loads mixer mute/block lists (reverse_chron_posts_pipeline query hydrators are empty). For You list hydrators return Err on RPC failure; hydrate_query ignores that and leaves empty lists. In both cases VF is the mute/block sink. The sink was assembling Failed as not-muted / not-blocked.

Mixer BlockedByHydrator / FollowingBlockedByHydrator returned Err on check_blocked_by failure. update_all skips Err, so author_blocks_viewer stays None. AuthorSocialgraphFilter does unwrap_or(false). VF does not check author-blocks-viewer.

  • Entry: SocialgraphHydrator::hydrateCandidateFeatures::assemble; mixer BlockedByHydrator / FollowingBlockedByHydrator
  • Sink: VF mute/block/mute-retweet rules; mixer AuthorSocialgraphFilter
  • Break: Failed relationship assembled as false; mixer graph Err written as not-blocked
  • Viewer effect: a muted or blocked author (or an author who blocked the viewer) still serves when the graph RPC fails
  • Twin: Fail closed when TES NSFW, takedown, nullcast, or media reads error #134 drops a candidate whose TES safety-flag read Failed. Same retain → unresolved_author path.

Genuine Found (including all-false, nobody muted/blocked) is unchanged. Logged-out viewers are Found(default), not Failed.

Fix

If the relationship lookup is Failed for a tweet id, drop that candidate from the hydrated set. FilterTweets already maps a missing hydrated candidate to Verdict::unresolved_author.

On mixer check_blocked_by Err, write author_blocks_viewer: Some(true) (and quoted Some(true) when a quoted author is present) so update_all applies it and the filter drops.

Tests

  • Failed relationship dropped; Found default kept
  • Found mute/block still assembled (rules drop)
  • Missing relationship key dropped
  • Assemble-without-retain still defaults Failed to false (documents the hole)

Standalone decision-table harness (same retain / BlockedBy / filter arms): 15 assertions passed.

cargo test cannot run. Public dump has no visibility-filtering / Home Mixer manifest.

Leftover

QuoteHydrator::get_blocked_by still unwrap_or_default() (#117). Partial Flock result slots still default missing mute/block graphs to empty. Mixer mute/block list miss on For You still leaves empty lists; Latest Following never loads those lists. VF Failed is the sink for viewer mute/block after this change.

Fork pointer (do not merge): Pitchfork-and-Torch#27

VF already marks a failed relationship RPC as Failed, then assemble
defaults that to not muted / not blocked. Drop those candidates so
FilterTweets can emit unresolved_author.

Mixer BlockedBy hydrators returned Err on the same class of RPC
failure. update_all skipped the write, so author_blocks_viewer stayed
None and the filter treated that as not-blocked. Stamp Some(true).

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.

2 participants