Stop POSSIBLY_NSFW_ACCOUNT from requiring 11 matches in a window of 10 - #168
Open
Pitchfork-and-Torch wants to merge 1 commit into
Open
Conversation
The default post-to-user rule asked for more matching posts than the window can hold, so the account label never applied. Clamp the required count to the window and set the default to 10 of 10. Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
Pitchfork-and-Torch
marked this pull request as ready for review
September 7, 2026 06:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
safety-label-user-aggis the only writer ofPOSSIBLY_NSFW_ACCOUNT. That label is how soft-NSFW posting becomes an account signal (nsfw_author_adsin gizmoduck hydration → ads brand safety).The production default rule is unsatisfiable:
matchesPostLabelCountdoesposts.take(windowSize).filter(match).size >= minimumMatchingPosts. A window of 10 can never contain 11 matches.enabled: truedoes not matter. The soft-NSFW account path never writes.NSFW_HIGH_PRECISION(3 of last 5) still works. Accounts that postSOFT_NSFWwithout hitting 3/5 high-precision posts get no account label.Validation allows this:
maxConfiguredWindowSize = 10andmaxConfiguredMinimumMatchingPosts = 11, with nominimum <= windowcheck.Proof
take(10).size >= 11is false for every timeline.NSFW_HIGH_PRECISION/SOFT_NSFWPOSSIBLY_NSFW_ACCOUNTNSFW_HIGH_PRECISIONNSFW_HIGH_PRECISIONNSFW_HIGH_PRECISION(unchanged)Stale feature-switch copies of the old 11/10 JSON still fire: required count is clamped to the window. Rejecting 11/10 in
validRuleswould have dropped both default rules (all-or-nothing), including the working 3/5 path.evaluateForTeston 10 labeled posts with the old default returns[]. After clamp / 10-of-10 it returnsPOSSIBLY_NSFW_ACCOUNT.Fix
minimumMatchingPostsis 10 (all of the last 10).requiredMatchingPostsclampsminimumMatchingPoststowindowSizeso a leftover 11/10 FS payload cannot keep the rule dead.One file:
safety-label-user-agg/postToUserLabelRules.strato.Not a home-mixer / VF leftover. Not #165 (user-cred linked edges). Not a fork PR.
Fork PR: none