Skip to content

scarecrow: treat failed RTF label reads as labeled in URL tweet lookup - #107

Open
Pitchfork-and-Torch wants to merge 1 commit into
xai-org:mainfrom
Pitchfork-and-Torch:cursor/nsfw-card-tweet-label-fail-closed-upstream-acd8
Open

scarecrow: treat failed RTF label reads as labeled in URL tweet lookup#107
Pitchfork-and-Torch wants to merge 1 commit into
xai-org:mainfrom
Pitchfork-and-Torch:cursor/nsfw-card-tweet-label-fail-closed-upstream-acd8

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown

Problem

GetTweetLabelInfoFromURL walks tweets that share a URL and asks GetTweetRtfLabels whether each already has the interstitial. A failed read was replaced with an empty list, so every tweet looked unlabeled.

Bot 7413 (NSFW_Card_Image_URL_to_Tweet_Verdict) uses those two lists as-is:

  • PUT applies NSFW_CARD_IMAGE to notLabeled
  • DELETE only removes the label from labeled

After a URL-verdict delete, a Strato miss left the tweet interstitial in place. A miss on PUT could also apply the label when the current state was unknown.

This is the tweet-side counterpart of the URL-verdict cleanup fix. That change can now fire a DELETE; this lookup was still swallowing the label read that DELETE depends on.

Change

Treat a failed GetTweetRtfLabels read as already labeled (TryOrElse(..., TRUE)). Successful empty reads still count as unlabeled.

  • DELETE can still call TweetRtfRemoveLabel when the read fails
  • PUT will not apply on an unknown state
  • A confirmed empty label set is unchanged

No write-path, TTL, or rule-condition changes.

Tests

This derived feature runs inside Botmaker against internal Strato. There is no in-repo harness. Correctness is the list split plus the bot 7413 apply/remove branches, and TryOrElse already substitutes the backup on a failed future (botmaker/.../TryOrElse.java).

Decision table:

GetTweetRtfLabels Has label Before After
ok yes labeled labeled
ok no not labeled not labeled
error unknown not labeled (apply / no remove) labeled (no apply / remove)

Cherry-picked from Pitchfork-and-Torch#11. The file matches this tree.

GetTweetLabelInfoFromURL listed tweets that share a URL, then asked
GetTweetRtfLabels whether each already had the interstitial. A failed
read was replaced with an empty list, so every tweet looked unlabeled.

Bot 7413 (NSFW_Card_Image_URL_to_Tweet_Verdict) uses those two lists
directly: PUT applies NSFW_CARD_IMAGE to notLabeled, and DELETE only
removes it from labeled. After a URL-verdict delete, a Strato miss
left the tweet interstitial in place. A miss on PUT could also apply
the label on an unknown state.

Treat a failed lookup as already labeled so DELETE can still clear
and PUT will not apply.

Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
@Pitchfork-and-Torch
Pitchfork-and-Torch marked this pull request as ready for review September 4, 2026 17:49
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