Skip to content

Fail closed when gizmoduck viewer-age lookup errors - #42

Closed
Pitchfork-and-Torch wants to merge 19 commits into
mainfrom
cursor/vf-gizmoduck-fail-closed-abba
Closed

Fail closed when gizmoduck viewer-age lookup errors#42
Pitchfork-and-Torch wants to merge 19 commits into
mainfrom
cursor/vf-gizmoduck-fail-closed-abba

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown
Owner

Bug

Gizmoduck viewer RPC Err / timeout was collapsed to ViewerAge::Unknown. SensitiveViewerUnderageDropRule only matches Known(age) < 18. SensitiveViewerNoStatedAgeDropRule only matches NotStated in a gating country. Unknown Allows.

xai-org#133 left this: "RPC error already fails open as Unknown." Age-0 is now NotStated. A failed read of a real logged-in viewer is not "no such user."

This is not xai-org#133 (age 0 sentinel). This is not xai-org#125 (mixer origin NSFW). This is not xai-org#149 (VF author Failed → omit). This is not xai-org#144 (user-label miss).

Five-line proof

  • Entry: ViewerHydrator::hydrate (Err / timeout used to stamp Unknown)
  • Sink: SensitiveViewerUnderageDropRule (LookupFailed now hard-drops sensitive media)
  • Break: gizmoduck viewer RPC error assembled as un-aged, so NSFW/gore/card-image never age-gated
  • Viewer effect: a 15-year-old (or any viewer) whose gizmoduck row timed out still sees NSFW as a normal For You / Following card
  • Twin: confirmed Unknown (no such user) and NotStated (jurisdiction-scoped) are unchanged. Fail closed when VF gizmoduck author lookup is Err or missing xai-org/x-algorithm#149 owns author Failed.

Change

Stamp ViewerAge::LookupFailed on gizmoduck viewer Err / timeout. The underage drop also fires on age_lookup_failed so sensitive media hard-drops globally, including outside NSFW_GATING_COUNTRIES. Non-sensitive posts still serve.

Tests

  • Viewer RPC error / timeout → LookupFailed (not Unknown, not underage, not NotStated)
  • LookupFailed drops every sensitive firing candidate, including NSFW_TEXT in US
  • LookupFailed allows a clean non-sensitive post
  • Unknown still Allows (confirmed no-such-user)
  • Golden corpus gizmoduck_age_lookup_failed_drops_sensitive_media

Standalone decision-table harness (same match arms): 15/15 passed.

cargo test cannot run. Public dump has no visibility-filtering crate manifest.

Leftover

Author gizmoduck Failed is xai-org#149. Interstitial on an ancillary quote/RT is xai-org#143/xai-org#146. Account-country geo is xai-org#113.

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
Gizmoduck viewer RPC Err/timeout was mapped to ViewerAge::Unknown.
SensitiveViewerUnderageDropRule and NoStatedAgeDropRule both miss
Unknown, so NSFW/gore/card-image served as a normal card during an
outage. Stamp LookupFailed and hard-drop sensitive media globally.
Confirmed Unknown (no such user) and NotStated stay unchanged.

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