Repository navigation
feat(action-center): make the visibility drop detector fire, and give Protect a trigger - #823
Merged
Merged
Conversation
… Protect a trigger Phase 3a of #818. `sharp_drop` had never fired. Not once, across every brand, since it was written — and it is the only signal feeding the Recover family, which was therefore running on lost citations alone. The reason is the threshold. It demanded a 15-point fall in the AI Visibility Score, and that score is whatever a brand's own level happens to be: measured across live brands it averages 9.8 and tops out at 48. A brand sitting at 12 could lose four fifths of its visibility and go unreported, never having had 15 points to lose. The threshold decided which customers were allowed to have the signal at all, and excluded most of them. Severity is now led by the relative loss, with an absolute floor only to clear measurement noise — week-to-week movement averages 1.3 points on its own, so three sits above the wobble without excluding much. Against production data the pair reports roughly one brand a week rather than none. Protect had no definitions because nothing detected early deterioration, only collapse after the fact. `visibility_slipping` is that trigger: a brand with a position worth holding, losing ground, but not yet enough to be the collapse above. It is judged relatively like its severe sibling, one band below it, so the two are measured the same way and differ only in degree — a fixed points band would have been nearly empty, since five points from a baseline of twenty leaves less than a point of room under a 30% collapse threshold. The baseline keeps it to brands with something to protect. Ten is above the 9.8 average: a real position, not a brand that was barely visible to begin with. The two grades are exclusive and ordered. A fall severe enough to be a collapse is that, not an early warning; otherwise Protect and Recover would open on the same brand for the same week. `protect_visibility` is the Protect family's first definition, and the work it asks for differs from recovering on purpose: recovery asks what was lost and how to win it back, protection asks what is slipping and how to hold it while the position still exists to hold. The decision moved out of the middle of computePulseMetrics into classifyVisibilityFall, which is a boundary worth naming and testing rather than a condition buried in a 500-line function. Ten tests cover it, including the case that had never fired. Every threshold was calibrated against production rather than chosen: the score distribution, the average weekly wobble, and the resulting signal volume were all measured first. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj
33 of 37 tasks
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.
Phase 3a of #818.
The finding
Before writing any new detector I checked which existing ones actually fire. Nine of eleven do.
sharp_drophas never fired — not once, for any brand, since it was written. Neither hascompetitor_surge. Both are the ones gated on a 15-point threshold.That matters more than it first looks:
sharp_dropis the only signal feedingrecover_visibility, so the entire Recover family has been running on lost citations alone.Why it never fired
It demanded a 15-point fall in the AI Visibility Score — and that score is whatever a brand's own level happens to be. Measured across live brands:
A brand sitting at 12 could lose four fifths of its visibility and go unreported, never having had 15 points to lose. The threshold was deciding which customers were allowed to have the signal at all, and excluding most of them.
Production example from this week: one brand fell 6.5 → 2.3, a 65% loss, and the detector said nothing.
The change
Severity is led by the relative loss, with an absolute floor only to clear measurement noise. Movement averages 1.3 points on its own, so 3 sits above the wobble without excluding much. Against production the pair now reports roughly one brand a week rather than none.
Protect gets its trigger. The family had zero definitions because nothing detected early deterioration — only collapse, after the fact.
visibility_slippingfires for a brand with a position worth holding that is losing ground but has not yet collapsed.It is judged relatively like its severe sibling, one band below it, so the two are measured the same way and differ only in degree. A fixed points band would have been nearly empty: five points from a baseline of twenty leaves less than a point of room under a 30% collapse threshold.
The baseline keeps it to brands with something to protect — ten is above the 9.8 average, a real position rather than a brand that was barely visible to begin with.
The grades are exclusive and ordered. A fall severe enough to be a collapse is that, not an early warning; otherwise Protect and Recover would open on the same brand in the same week.
Verified against the real week-over-week pairs:
protect_visibilityis the Protect family's first definition. Its tasks differ from recovering on purpose: recovery asks what was lost and how to win it back; protection asks what is slipping and how to hold it while the position still exists to hold.Structure
The decision moved out of the middle of
computePulseMetricsintoclassifyVisibilityFall— a boundary worth naming and testing rather than a condition buried in a 500-line function. Ten tests cover it, including the case that had never fired, the noise floor, the ordering of the two grades, and silence during a platform outage.What I dropped from the plan
A country-gap detector. The plan named it, but exactly one brand in the database tracks two or more regions. It would have been a detector for nobody. Platform gaps are a different story — 24 brands track three or more platforms — so that one is still worth doing, in 3b.
Honest note on volume
visibility_slippingwill fire rarely for now: only two brands currently score above 20, and the fires depend on a brand having a strong position to lose. That is the detector working as intended rather than a miscalibration — the Protect family is for brands that have something to protect, and most of this customer base is still building one.Related issue
Phase 3a of #818.
Type of change
feat— New featurefix— Bug fixDatabase
None.
How to test
The classifier is pure, so its boundaries are directly checkable:
sharp_drop; before this it reported nothing.visibility_slipping, and a severe fall at the same baseline reportssharp_dropinstead — never both.visibility_slippingsignal consolidates into aprotect_visibilityaction in the Protect family, which was empty before.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/) — 0 errorsyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)🤖 Generated with Claude Code
https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj