fix(virality): classify alert levels on percentile ranks of both indicators#77
Merged
Conversation
…cators
The alert levels compared composite_virality and acceleration_rate against
absolute cuts, as if the two ran 0..1 on comparable footing. They do not.
composite_virality is a blend of PERCENT_RANKs: bounded and bell-shaped. In
production it reaches only 0.904, with a 99th percentile of 0.805 — so the
`composite > 0.85` cut selected the top 0.14% of scored narratives, not the
"top ~15%" its comment claimed. acceleration_rate is a raw ratio capped at 5.0,
with a median of 0; `acceleration > 1.2` selected the top 0.064%, and 13 of the
14 narratives that reached it had change_views pinned at exactly the cap. Of
21,913 narratives, three were classified — all via the plateau fallback.
Both indicators are now ranked by PERCENT_RANK within the run's cohort, so each
threshold means a knowable fraction of that cohort, and a saturating raw value
cannot buy a top rank when the whole tail saturates together.
The levels become a partition of the percentile plane:
VIRAL composite >= 0.95 (any acceleration)
EARLY_SURGE composite <= 0.50 and acceleration >= 0.95
ALERT 0.50 < composite < 0.95 and acceleration >= 0.95
WATCH 0.70 <= composite < 0.95 and 0.70 <= acceleration < 0.95
NONE otherwise
Every pair of regions differs on at least one axis, so the branches are disjoint
as written and their order cannot decide the answer — a test asserts this over
the whole grid rather than trusting the chain. VIRAL now reads the composite axis
alone: a narrative that large is viral whether or not it is still climbing, which
is what the old "plateaued-but-popular" branch was reaching for when it emitted
WATCH for exactly that condition, badging the corpus's biggest narratives with
its weakest label.
A narrative is classified only when it has both indicators. A missing composite
used to be read as 0.0, which satisfies `composite < 0.65` and made an unscored
narrative eligible for EARLY_SURGE on acceleration alone — absence of data
masquerading as a signal, for the 90% of narratives that have no composite.
Narratives that cannot be scored now have their alert_level cleared rather than
keeping a stale badge.
This changes only how the indicators are compared, not how they are computed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
The alert levels compared composite_virality and acceleration_rate against absolute cuts, as if the two ran 0..1 on comparable footing. They do not.
composite_virality is a blend of PERCENT_RANKs: bounded and bell-shaped. In production it reaches only 0.904, with a 99th percentile of 0.805 — so the
composite > 0.85cut selected the top 0.14% of scored narratives, not the "top ~15%" its comment claimed. acceleration_rate is a raw ratio capped at 5.0, with a median of 0;acceleration > 1.2selected the top 0.064%, and 13 of the 14 narratives that reached it had change_views pinned at exactly the cap. Of 21,913 narratives, three were classified — all via the plateau fallback.Both indicators are now ranked by PERCENT_RANK within the run's cohort, so each threshold means a knowable fraction of that cohort, and a saturating raw value cannot buy a top rank when the whole tail saturates together.
The levels become a partition of the percentile plane:
Every pair of regions differs on at least one axis, so the branches are disjoint as written and their order cannot decide the answer — a test asserts this over the whole grid rather than trusting the chain. VIRAL now reads the composite axis alone: a narrative that large is viral whether or not it is still climbing, which is what the old "plateaued-but-popular" branch was reaching for when it emitted WATCH for exactly that condition, badging the corpus's biggest narratives with its weakest label.
A narrative is classified only when it has both indicators. A missing composite used to be read as 0.0, which satisfies
composite < 0.65and made an unscored narrative eligible for EARLY_SURGE on acceleration alone — absence of data masquerading as a signal, for the 90% of narratives that have no composite. Narratives that cannot be scored now have their alert_level cleared rather than keeping a stale badge.This changes only how the indicators are compared, not how they are computed.