Skip to content

feat(search): Add recommended_v2 sort using the Postgres-data sort framework#117227

Merged
roggenkemper merged 3 commits into
masterfrom
roggenkemper/feat/recommended-sort-v2
Jun 12, 2026
Merged

feat(search): Add recommended_v2 sort using the Postgres-data sort framework#117227
roggenkemper merged 3 commits into
masterfrom
roggenkemper/feat/recommended-sort-v2

Conversation

@roggenkemper

@roggenkemper roggenkemper commented Jun 9, 2026

Copy link
Copy Markdown
Member

Adds a recommended_v2 issue sort built on the Postgres-data sort framework (#116896). It keeps the Snuba recommended aggregation (recency / spike / severity / user impact / event volume) as the base score and layers on additive boosts for signals that live outside ClickHouse:

  • Assignment affinity: issues assigned directly to the viewer get a full boost, issues assigned to one of the viewer's teams get half. Resolved in bulk from GroupAssignee; anonymous/absent viewers get no boost.
  • Seer fixability: Group.seer_fixability_score ([0, 1], null scored as 0 — exclude_null_postgres=False so unscored groups aren't dropped).
  • Seer agent progress: the furthest issue.agent stage reached per group (root cause < plan < code changes < PR created), resolved from Activity records and normalized to [0, 1].

Each boost is weight * signal with weights registered as options (snuba.search.recommended.*) so they can be tuned without a deploy, matching how the existing recommended weights work.

These signals are an initial test of recommended_v2, more signals will be added and some of these might be taken away.

The sort key is also mapped to the recommended aggregation in sort_strategies, so when there are too many candidates to score in memory the framework's overflow fallback degrades to the existing chunked Snuba recommended path rather than date.

The sort only activates when explicitly requested via ?sort=recommended_v2, so it's inherently opt-in; this is to prevent anyone using the existed v1 implementation from being affected while we test it

…amework

Register a recommended_v2 sort built on the Postgres-data sort framework. It
keeps the Snuba recommended score (recency/spike/severity/user impact/event
volume) as the base and adds additive boosts for signals the Snuba path cannot
see: assignment affinity for the viewer (individual assignment outranks team
assignment), the group's Seer fixability score, and Seer agent progress (the
furthest issue.agent stage reached, root cause < plan < code changes < PR
created). Boost weights are tunable via options. On candidate overflow the
sort falls back to the chunked Snuba recommended path.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 9, 2026
…for v2 weights

Co-Authored-By: Claude <noreply@anthropic.com>
@roggenkemper

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 6471464. Configure here.

@roggenkemper roggenkemper marked this pull request as ready for review June 10, 2026 19:45
@roggenkemper roggenkemper requested review from a team as code owners June 10, 2026 19:45
@roggenkemper roggenkemper requested review from a team and removed request for a team June 10, 2026 19:45
Comment thread src/sentry/search/snuba/executors.py Outdated
Seer stages reached before the group's latest SET_REGRESSION activity no
longer count toward the recommended_v2 agent boost -- a regression means
that fix evidently didn't hold, so stale milestones shouldn't over-rank
the issue.

Co-Authored-By: Claude <noreply@anthropic.com>
@roggenkemper roggenkemper requested a review from scttcper June 11, 2026 15:11
@roggenkemper roggenkemper merged commit 8430c1b into master Jun 12, 2026
84 checks passed
@roggenkemper roggenkemper deleted the roggenkemper/feat/recommended-sort-v2 branch June 12, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants