under-the-hood: count still-labeled posts, not cleared ones, in the report - #9
Merged
Merged
Conversation
…eport
Daily post-label rows store carried (posts that received the label in
the observation window) and removed (how many of those were later taken
off or expired). The monthly aggregate keeps both. The public Under the
Hood report summed only carried, so a post that was labeled and then
cleared still counted toward posts and percentageOfPosts.
The label copy is present tense ("Post hidden from recommendations to
non-followers"). Subtract removed, floored at zero, so the report shows
posts that still carry the label.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
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.
Problem
The daily Under the Hood post-label job (
UthDailyPostsApp.countLabelsAsOf) writes two counters per author, authored day, and label:carried: 1 for every post that received the label in the observation windowremoved: 1 of those if the last action was a removal, or the label expired before the observation deadlineThe monthly publisher stores both on
UthDayCarriedRemoved. The public report inunderTheHoodReport.Userthen did:and published that as
posts/percentageOfPosts.A post that was labeled and later cleared still counted. The label copy served next to that number is present tense ("Post hidden from recommendations to non-followers"). Readers were told more of their posts were still limited than still carried the label.
Example from the same control flow: three days with
(carried, removed)=(10, 7),(4, 0),(2, 2)reported 16 posts. Net still labeled is 7.removedis computed, written to daily parquet, copied into the monthly aggregate, and was then ignored by the only user-facing reader.Change
sumCarriednow reportsmax(0, carried - removed)per day. Missingremoved(older rows) is treated as 0, so those days stay unchanged. Tweet-flag rows already storeremoved = 0.Daily and monthly writers are unchanged. Existing Manhattan month rows already have both fields, so the serving fix applies without a backfill.
Why it matters
Under the Hood is the public account of which labels limited a person's posts. Overstating the still-labeled count makes reach look more restricted than the stored data says, and it hides that a label expired or was taken off.
Verification
Strato cannot compile here. The daily writer is the spec:
countLabelsAsOfemits(1L, removed)for each ever-applied post, withremovedfromremovedAfterLastAction(carried, 0L)UthDayCarriedRemovedA scratch model of old vs new
sumCarriedon(10,7)+(4,0)+(2,2)is 16 vs 7; a single post that was applied then removed or expired nets to 0; a still-labeled post stays 1. Nothing from that model is committed.Out of scope
UthDailyAccountLabelsJobmidnight snapshot (labels applied after UTC midnight land on the next day). Internally consistent as an at-midnight snapshot; not changed here.anchor_campaign_*SpamHighRecallrules with no TTL. Sibling rules use 30 days, but the compact form may be deliberate campaign policy. Not changed without a stronger proof.carriedonly. That job is marked experimental / unused.Upstream
Cherry-pick is clean on
xai-org/x-algorithmmain (same file blob). Matching PR: xai-org#105