Skip to content

feat(action-center): make the visibility drop detector fire, and give Protect a trigger - #823

Merged
gkhngyk merged 1 commit into
mainfrom
feature/protect-signals
Sep 17, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
feature/protect-signals

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Phase 3a of #818.

The finding

Before writing any new detector I checked which existing ones actually fire. Nine of eleven do. sharp_drop has never fired — not once, for any brand, since it was written. Neither has competitor_surge. Both are the ones gated on a 15-point threshold.

That matters more than it first looks: sharp_drop is the only signal feeding recover_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:

Average score 9.8
Highest score 48.4
Brands scoring ≥ 20 2 of 17
Average week-to-week movement 1.3 points

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_slipping fires 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:

low baseline, collapse     6.5 ->  2.3  =  sharp_drop      (65% loss, previously silent)
low baseline, under floor  3.6 ->  0.7  =  (silent)        (81% loss, but 2.9pts — under the noise floor)
low baseline, noise        1.9 ->  0.9  =  (silent)        (1 point is noise)
strong position, slipping 20.0 -> 17.0  =  visibility_slipping
strong position, steady   20.0 -> 19.5  =  (silent)

protect_visibility is 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 computePulseMetrics into classifyVisibilityFall — 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_slipping will 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 feature
  • fix — Bug fix

Database

None.

How to test

cd server && yarn test   # 455 passing, 10 of them new

The classifier is pure, so its boundaries are directly checkable:

  1. A brand at a low baseline losing most of its visibility now reports sharp_drop; before this it reported nothing.
  2. A movement under the noise floor stays silent whatever its relative size.
  3. A strong brand slipping reports visibility_slipping, and a severe fall at the same baseline reports sharp_drop instead — never both.
  4. On the next nightly run, a visibility_slipping signal consolidates into a protect_visibility action in the Protect family, which was empty before.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/) — 0 errors
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj

… 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
@gkhngyk
gkhngyk merged commit 5494f6a into main Sep 17, 2026
6 checks passed
@gkhngyk
gkhngyk deleted the feature/protect-signals branch September 17, 2026 17:58
@gkhngyk gkhngyk mentioned this pull request Sep 18, 2026
33 of 37 tasks
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