Skip to content

home-mixer: ignore expired safety labels in ads brand safety - #124

Closed
Pitchfork-and-Torch wants to merge 1 commit into
xai-org:mainfrom
Pitchfork-and-Torch:cursor/ads-ignore-expired-labels-upstream-8ee7
Closed

Pitchfork-and-Torch wants to merge 1 commit into
xai-org:mainfrom
Pitchfork-and-Torch:cursor/ads-ignore-expired-labels-upstream-8ee7

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown

Bug

GetSafetyLabels still returns expired rows. VF drop rules already skip them (PR 106). Ads brand safety did not.

AdsBrandSafetyVfHydrator calls compute_verdict / compute_verdict_v2, which used type presence only. A lapsed NSFA_COMMUNITY_NOTE (or any other TTL label in the high/medium/low-risk sets) kept the post HighRisk or MediumRisk. Ads blender then treats those verdicts as avoid, so ads would not sit next to a post whose note or label had already expired.

Community Notes have no VF drop rule in this dump. Ads adjacency is the ranking sink for NSFA_COMMUNITY_NOTE.

Fix

Skip labels whose expires_at_msec is at or before now before scoring v1 and v2 verdicts, and before listing labels on the scored post. A missing expiry stays permanent. Expired v2 written labels fall back to v1.

No change to write paths, TTLs, GetSafetyLabels, or VF drop rules.

Proof

  • Entry: AdsBrandSafetyVfHydrator → compute_verdict / compute_verdict_v2
  • Sink: ads blender avoid on HighRisk / MediumRisk
  • Break: type presence ignored expires_at_msec; GetSafetyLabels returns expired rows
  • Viewer effect: post with an expired Community Note (or other TTL label) still blocked ads next to it
  • Twin: VF from_proto_label_types expiry fence (PR 106)

Tests

  • expired_community_note_does_not_keep_medium_risk (fails on unmodified main)
  • future / missing / exactly-now expiry
  • expired sibling does not hide an active medium-risk label
  • expired high-risk and low-risk labels drop their tier
  • expired GROK_SFA treated as unscored
  • v2: expired note is Safe; expired v2 written labels fall back to v1
  • hydrator: expired note omitted from safety_labels; active note still MediumRisk

cargo test cannot run in the public dump (no Home Mixer Cargo.toml). Decision table for the expiry fence was run standalone and matched these cases.

Fork

Same fix on the older fork tree (no HighRisk / v2): Pitchfork-and-Torch#13

This is a port onto current xai-org/x-algorithm main rather than a clean cherry-pick.

cursor Bot pushed a commit to Pitchfork-and-Torch/x-algorithm that referenced this pull request Sep 7, 2026
Rebased onto latest xai-org/x-algorithm main. Missed ads-VF hydration
defaulted organics to MediumRisk, and ads-only nsfw_author_ads rewrote
the shared verdict. Default For You blender then pulled those posts out
of ranked order when placing ads.

Keep a real MediumRisk tweet-label verdict off ad neighbors. Following
still will not sit an ad next to Unspecified.

Compatibility with sibling PRs that touch the same files:
- expired ads brand-safety labels are ignored (xai-org#124)
- gizmoduck uses origin author size/NSFW OR and fails closed on miss (xai-org#125)

Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
Pitchfork-and-Torch added a commit to Pitchfork-and-Torch/x-algorithm that referenced this pull request Sep 8, 2026
Rebased onto latest xai-org/x-algorithm main. Missed ads-VF hydration
defaulted organics to MediumRisk, and ads-only nsfw_author_ads rewrote
the shared verdict. Default For You blender then pulled those posts out
of ranked order when placing ads.

Keep a real MediumRisk tweet-label verdict off ad neighbors. Following
still will not sit an ad next to Unspecified.

Compatibility with sibling PRs that touch the same files:
- expired ads brand-safety labels are ignored (xai-org#124)
- gizmoduck uses origin author size/NSFW OR and fails closed on miss (xai-org#125)
GetSafetyLabels still returns expired rows. VF drop rules already skip
them. Ads adjacency used type presence, so a lapsed NSFA_COMMUNITY_NOTE
(or any other TTL label) kept the post MediumRisk or HighRisk.

Skip labels whose expires_at_msec is at or before now in both v1 and v2
verdicts, and omit them from the scored-post label list. Missing expiry
stays permanent.
@Pitchfork-and-Torch
Pitchfork-and-Torch force-pushed the cursor/ads-ignore-expired-labels-upstream-8ee7 branch from bbdcb65 to 902a06f Compare September 8, 2026 23:13
@Pitchfork-and-Torch

Copy link
Copy Markdown
Author

Parking this intern-stack PR per operator GitHub cleanup (2026-09-08). Hunt notes remain local. Not a reject of the class.

@Pitchfork-and-Torch
Pitchfork-and-Torch deleted the cursor/ads-ignore-expired-labels-upstream-8ee7 branch September 18, 2026 00:33
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.

1 participant