Skip to content

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

Merged
Pitchfork-and-Torch merged 1 commit into
mainfrom
cursor/nsfw-card-tweet-label-fail-closed-acd8
Sep 4, 2026
Merged

Pitchfork-and-Torch merged 1 commit into
mainfrom
cursor/nsfw-card-tweet-label-fail-closed-acd8

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown
Owner

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 already-shipped URL-verdict cleanup fix (fork #8). 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)

Leftover hunches (not shipped)

  • UthDailyAccountLabelsJob midnight fence: start-of-day snapshot, same as the legacy job. Same-day-only labels never appear. Not proven that end-of-day was intended.
  • Permanent SpamHighRecall on anchor_campaign_* (and SpamEmbeddingPtosDistilled): siblings use a 30-day TTL. Parser treats missing TTL as no expiry on purpose. Policy vs omission, not proven.
Open in Web Open in Cursor 

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