Skip to content

feat(metrics): visibility rate becomes the AI visibility score on every surface - #574

Merged
gkhngyk merged 3 commits into
mainfrom
feature/ai-visibility-score-rollout
Aug 1, 2026
Merged

gkhngyk merged 3 commits into
mainfrom
feature/ai-visibility-score-rollout

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

The Visibility Rate shown across the product is now the AI Visibility Score (0-100): 0.6 × mention rate + 0.25 × citation rate + 0.15 × position factor, computed over the filtered answer set through the shared compute layer from #573 — one formula, one weights module, every surface. Coverage (appeared in X of Y prompts) survives as a secondary line/tooltip everywhere it was useful.

Surfaces switched in this PR (all in one release, so no page can disagree with another):

  • Insights — headline KPI card (score + coverage sub-line), trend-card header (score + point delta vs previous window), per-day trend lines (day-level score per brand), leaderboard entries (score + score delta, components in the tooltip). Axis/tooltip % signs dropped — the score isn't a percentage.
  • Prompts — All Prompts Visibility column (per-prompt score, components in the hover), sorting, CSV (ai_visibility_score_30d added), prompt detail KPI.
  • Topics — overview table, Best/Weakest KPIs, sparkline-adjacent stats and CSV now carry the per-topic score; topic detail KPI + competitor list use score/scoreChange.
  • Competitors — cards show the score with component tooltips.
  • Reports — visibility-rate section, prompt/topic performance (ranked by score) for NEW reports; the render fallback chain is score → visibilityRate% → avgVisibility/100, so every stored snapshot keeps rendering exactly as generated. The LLM summary prompt now explains the score fields.
  • Daily Pulse — KPI strip, trend and all three detectors (drop/surge/crossing) run on the score; email copy updated.

Mechanics:

  • getCompetitorComparison gained score/scoreChange/mentionAnswers/citationAnswers/positionFactor per entry (three parallel ai_visibility_aggregates calls reusing its existing windows) — leaderboard, Competitors page and topic detail all feed from it.
  • getVisibilityRateTrend points/summary are score-based; getPromptVisibilitySummaries and getPromptDetail expose per-prompt scores; the Topics scan and both report scans accumulate components (and now select mention_position).
  • No migration — all compute uses feat(core): AI visibility score compute layer — weights module and component RPCs #573's RPCs.

Related issue

—

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Insights: the KPI card, trend-card header and leaderboard all show the same 0-100 number for the same window; hovering leaderboard values reveals the components.
  2. Prompts / Topics / Competitors: columns and cards show scores; tooltips carry mention/citation/position breakdowns; sorting follows the score.
  3. Reports: generate a new report — Visibility Rate KPI and prompt/topic tables show scores; open an old report — it renders unchanged.
  4. Trigger a pulse for a test brand — the email leads with the score and detectors still fire on score deltas.

Checklist

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

@gkhngyk
gkhngyk merged commit f376e95 into main Aug 1, 2026
4 checks passed
@gkhngyk
gkhngyk deleted the feature/ai-visibility-score-rollout branch August 1, 2026 00:58
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