:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(signals): replace the for_you endpoint with a for_you list view (#118527)
Shy Alter2099bfc9e6f8
diff --git a/frontend/src/scenes/project-homepage/today/Today.stories.tsx b/frontend/src/scenes/project-homepage/today/Today.stories.tsxindex 9e336729e101..ed2ead2a6d2f 100644--- a/frontend/src/scenes/project-homepage/today/Today.stories.tsx+++ b/frontend/src/scenes/project-homepage/today/Today.stories.tsx@@ -724,9 +724,11 @@ const meta: Meta = {clearTodayStorage,mswDecorator({get: {- '/api/projects/:team_id/signals/reports/': { results: REPORTS, count: 7 },- '/api/projects/:team_id/signals/reports/for_you/': ({ request }) => {+ '/api/projects/:team_id/signals/reports/': ({ request }) => {const params = new URL(request.url).searchParams+ if (params.get('view') !== 'for_you') {+ return [200, { results: REPORTS, count: 7 }]+ }const limit = Number(params.get('limit') ?? REPORTS.length)const offset = Number(params.get('offset') ?? 0)const excluded = new Set(params.get('exclude')?.split(',') ?? [])@@ -887,7 +889,7 @@ export const HomeWithReportsOnly: Story = {export const HomeWithNoReports: Story = {decorators: [mswDecorator({- get: { '/api/projects/:team_id/signals/reports/for_you/': { results: [], count: 0 } },+ get: { '/api/projects/:team_id/signals/reports/': { results: [], count: 0 } },}),],}@@ -896,7 +898,7 @@ export const HomeWithoutAiAndNothingNew: Story = {decorators: [mswDecorator({get: {- '/api/projects/:team_id/signals/reports/for_you/': { results: [], count: 0 },+ '/api/projects/:team_id/signals/reports/': { results: [], count: 0 },'/api/projects/:team_id/today/highlights/': { ...HIGHLIGHTS, items: [] },},}),@@ -906,7 +908,7 @@ export const HomeWithoutAiAndNothingNew: Story = {export const HomeWhenReportsFailToLoad: Story = {decorators: [mswDecorator({- get: { '/api/projects/:team_id/signals/reports/for_you/': () => [500, { detail: 'Server error' }] },+ get: { '/api/projects/:team_id/signals/reports/': () => [500, { detail: 'Server error' }] },}),],}@@ -915,7 +917,7 @@ export const HomeWithoutReportsWhenHighlightsFailToLoad: Story = {decorators: [mswDecorator({get: {- '/api/projects/:team_id/signals/reports/for_you/': { results: [], count: 0 },+ '/api/projects/:team_id/signals/reports/': { results: [], count: 0 },'/api/projects/:team_id/today/highlights/': () => [500, { detail: 'Server error' }],},}),diff --git a/frontend/src/scenes/project-homepage/today/TodayReportFeedback.test.tsx b/frontend/src/scenes/project-homepage/today/TodayReportFeedback.test.tsxindex 31ff9ebff526..1f7daa6c4f09 100644--- a/frontend/src/scenes/project-homepage/today/TodayReportFeedback.test.tsx+++ b/frontend/src/scenes/project-homepage/today/TodayReportFeedback.test.tsx@@ -28,7 +28,7 @@ describe('TodayReportFeedback', () => {'/api/projects/:team_id/signals/reports/:id/artefacts/': { results: [] },'/api/projects/:team_id/signals/reports/:id/signals/': { signals: [] },'/api/projects/:team_id/signals/reports/available_reviewers/': [],- '/api/projects/:team_id/signals/reports/for_you/': { results: [], count: 0 },+ '/api/projects/:team_id/signals/reports/': { results: [], count: 0 },'/api/projects/:team_id/today/reports/:id/page/': [404, {}],},post: {diff --git a/frontend/src/scenes/project-homepage/today/todayLogic.test.ts b/frontend/src/scenes/project-homepage/today/todayLogic.test.tsindex 6cef21c79877..79f08c05dc50 100644--- a/frontend/src/scenes/project-homepage/today/todayLogic.test.ts+++ b/frontend/src/scenes/project-homepage/today/todayLogic.test.ts@@ -32,7 +32,7 @@ describe('todayLogic', () => {reportResponse = nulluseMocks({get: {- '/api/projects/:team_id/signals/reports/for_you/': ({ request }) => {+ '/api/projects/:team_id/signals/reports/': ({ request }) => {listParams = new URL(request.url).searchParamsreturn listResponse},@@ -284,8 +284,9 @@ describe('todayLogic', () => {await expectLogic(logic).toFinishAllListeners().toMatchValues({ reports, moreReportCount: 7 })expect(Object.fromEntries(listParams!.entries())).toEqual({+ view: 'for_you',+ sort: 'priority',limit: String(TOP_REPORT_COUNT),- include_unowned: 'false',})})@@ -305,10 +306,11 @@ describe('todayLogic', () => {.toDispatchActions(['loadMoreReportsSuccess']).toMatchValues({ loadedMoreReports: first, canLoadMoreReports: true, moreReportsInInbox: 0 })expect(Object.fromEntries(listParams!.entries())).toEqual({+ view: 'for_you',+ sort: 'priority',limit: String(MORE_REPORTS_PAGE_SIZE),offset: '0',exclude: 'a',- include_unowned: 'false',})const second = page('q', 3)diff --git a/frontend/src/scenes/project-homepage/today/todayLogic.ts b/frontend/src/scenes/project-homepage/today/todayLogic.tsindex 407f1bbbbfb1..35ab413089b4 100644--- a/frontend/src/scenes/project-homepage/today/todayLogic.ts+++ b/frontend/src/scenes/project-homepage/today/todayLogic.ts@@ -17,7 +17,7 @@ import { recentItemsModel } from '~/models/recentItemsModel'import { FileSystemEntry } from '~/queries/schema/schema-general'import { TeamPublicType, TeamType, UserType } from '~/types'-import { signalsReportsForYouRetrieve, signalsReportsRetrieve } from 'products/signals/frontend/generated/api'+import { signalsReportsList, signalsReportsRetrieve } from 'products/signals/frontend/generated/api'import {TodayReportList,TodayReportSnapshot,@@ -48,6 +48,7 @@ import { todayVerdictLogic } from './todayVerdictLogic'export const TOP_REPORT_COUNT = 5export const MORE_REPORTS_PAGE_SIZE = 20+export const TODAY_REPORT_LIST_PARAMS = { view: 'for_you', sort: 'priority' } as constexport const RECENT_OBJECT_COUNT = 4const RECENT_OBJECT_MORE_COUNT = 8const CLOCK_MS = 30_000@@ -407,12 +408,11 @@ export const todayLogic = kea<todayLogicType>([return { results: [], count: 0 }}// The person's own reports, ranked and counted.- // A P0 nobody owns belongs to the project, so Today leaves it to the Inbox.let responsetry {- response = await signalsReportsForYouRetrieve(String(values.currentProjectId), {+ response = await signalsReportsList(String(values.currentProjectId), {+ ...TODAY_REPORT_LIST_PARAMS,limit: TOP_REPORT_COUNT,- include_unowned: false,})} catch (error) {if (error instanceof ApiError && error.status === 403) {@@ -436,11 +436,11 @@ export const todayLogic = kea<todayLogicType>([}const exclude = values.shownReportIdsconst loaded = values.loadedMoreReports- const response = await signalsReportsForYouRetrieve(String(values.currentProjectId), {+ const response = await signalsReportsList(String(values.currentProjectId), {+ ...TODAY_REPORT_LIST_PARAMS,limit: MORE_REPORTS_PAGE_SIZE,offset: loaded.length,exclude: exclude.length > 0 ? exclude : undefined,- include_unowned: false,})const results = [...loaded, ...(response.results as unknown as SignalReport[])]return {diff --git a/frontend/src/scenes/project-homepage/today/todayReportQueueLogic.test.ts b/frontend/src/scenes/project-homepage/today/todayReportQueueLogic.test.tsindex abc17e590dc4..2df1cb6097cb 100644--- a/frontend/src/scenes/project-homepage/today/todayReportQueueLogic.test.ts+++ b/frontend/src/scenes/project-homepage/today/todayReportQueueLogic.test.ts@@ -15,10 +15,7 @@ describe('todayReportQueueLogic', () => {let reports = [makeReport({ id: 'a' }), makeReport({ id: 'b' })]useMocks({get: {- '/api/projects/:team_id/signals/reports/for_you/': () => [- 200,- { results: reports, count: reports.length },- ],+ '/api/projects/:team_id/signals/reports/': () => [200, { results: reports, count: reports.length }],'/api/projects/:team_id/today/highlights/': makeHighlights(),},})diff --git a/products/signals/backend/briefing_reports.py b/products/signals/backend/briefing_reports.pyindex 0346a052304e..3bacb41238b7 100644--- a/products/signals/backend/briefing_reports.py+++ b/products/signals/backend/briefing_reports.py@@ -1,7 +1,7 @@"""Reports that matter to one person, for the Today briefing.-This module answers "which reports relate to this person, and how". The inbox `for_you` list-orders these reports with the inbox priority order.+This module answers "which reports relate to this person, and how". The inbox list returns these+reports for `view=for_you`."""import re@@ -9,19 +9,15 @@ from collections.abc import Sequencefrom datetime import datetimefrom enum import StrEnum-from django.db.models import Case, CharField, F, Func, JSONField, OuterRef, Q, QuerySet, Subquery, Value, When-from django.db.models.functions import Cast+from django.db.models import Case, CharField, Q, QuerySet, Value, Whenfrom posthog.dataclasses import frozenfrom posthog.models import Userfrom products.signals.backend.artefact_attribution import ArtefactAttributionfrom products.signals.backend.artefact_schemas import ActionabilityChoice-from products.signals.backend.implementation_pr import (- fetch_implementation_pr_state_for_reports,- implementation_pr_report_filter,-)-from products.signals.backend.models import SignalReport, SignalReportArtefact, SignalReportAssignment+from products.signals.backend.implementation_pr import fetch_implementation_pr_state_for_reports+from products.signals.backend.models import SignalReport, SignalReportAssignmentfrom products.signals.backend.report_charts import ReportChartSnapshot, saved_chartsfrom products.signals.backend.report_claims import reports_with_active_claimfrom products.signals.backend.report_content_gates import team_report_monitoring_enabled@@ -38,12 +34,11 @@ SUMMARY_LEAD_LIMIT = 450class BriefingReportRelation(StrEnum):"""How a report relates to the person, strongest first: what blocks on them, what they own,- what names them, then what nobody owns. A report keeps the first relation that matches."""+ then what names them. A report keeps the first relation that matches."""WAITING_FOR_YOU = "waiting_for_you"CLAIMED = "claimed"SUGGESTED_REVIEWER = "suggested_reviewer"- URGENT_UNOWNED = "urgent_unowned"# The implementation pull request states a briefing shows. `unknown` reads as no state.@@ -70,34 +65,6 @@ class BriefingReportDetails:charts: list[ReportChartSnapshot]-def _json_object_content() -> Q:- # Content is written from a pydantic schema. The guard only keeps a legacy or truncated row out- # of the jsonb cast, because a failed cast fails the whole query.- return Q(content__startswith="{", content__endswith="}")---def _latest_priority() -> Subquery:- """The priority of each report's latest priority judgment, as text. The latest row decides, so- a malformed latest row reads as no priority, as `priority_from_judgment` reads it."""- priority = Func(- Cast(F("content"), output_field=JSONField()),- Value("priority"),- function="jsonb_extract_path_text",- output_field=CharField(),- )- return Subquery(- SignalReportArtefact.objects.filter(- report_id=OuterRef("id"), type=SignalReportArtefact.ArtefactType.PRIORITY_JUDGMENT- )- .order_by("-created_at")- .annotate(- _priority=Case(When(_json_object_content(), then=priority), default=Value(None), output_field=CharField())- )- .values("_priority")[:1],- output_field=CharField(),- )--def _open_reports(team_id: int) -> QuerySet[SignalReport]:"""The reports the briefing may show and count: open, judged actionable, not already addressed."""return (@@ -138,15 +105,8 @@ def report_ids_naming_user(*, team_id: int, user: User, report_ids: Sequence[strreturn {str(row["report_id"]) for row in naming}-def _relation_to_person(team_id: int, user: User, *, include_unowned: bool) -> Case:- """A report's strongest `BriefingReportRelation` to the person, or NULL when it has none.-- Reads the `briefing_priority` annotation, so the queryset must carry `_latest_priority()` first.- `include_unowned` decides whether a P0 nobody owns counts as a relation. It belongs to the project- rather than to the person, so a surface that only pushes a person's own work leaves it out. Leaving- it out also drops the claim and implementation-PR subqueries from the expression, which Postgres- evaluates for every open report before the relation filter applies.- """+def _relation_to_person(team_id: int, user: User) -> Case:+ """A report's strongest `BriefingReportRelation` to the person, or NULL when it has none."""names_me = _names_person(team_id, user)claimed = reports_with_active_claim(team_id=team_id, actor=ArtefactAttribution.from_user(user.id))branches = [@@ -156,57 +116,18 @@ def _relation_to_person(team_id: int, user: User, *, include_unowned: bool) -> CWhen(claimed, then=Value(BriefingReportRelation.CLAIMED)),When(names_me & Q(status=SignalReport.Status.READY), then=Value(BriefingReportRelation.SUGGESTED_REVIEWER)),]- if include_unowned:- unowned = ~reports_with_active_claim(team_id=team_id) & ~implementation_pr_report_filter(- team_id=team_id, active_only=True- )- branches.append(- When(- unowned- & Q(- status=SignalReport.Status.READY,- latest_actionability=ActionabilityChoice.IMMEDIATELY_ACTIONABLE.value,- briefing_priority="P0",- ),- then=Value(BriefingReportRelation.URGENT_UNOWNED),- )- )return Case(*branches, default=Value(None), output_field=CharField())-def reports_for_person(team_id: int, user: User, *, include_unowned: bool) -> QuerySet[SignalReport]:- """The open reports that are for this person: the set the inbox `for_you` list ranks and counts."""+def reports_for_person(team_id: int, user: User) -> QuerySet[SignalReport]:+ """The open reports that are for this person: the set the inbox list returns for `view=for_you`."""return (_open_reports(team_id)- .annotate(briefing_priority=_latest_priority())- .annotate(briefing_relation=_relation_to_person(team_id, user, include_unowned=include_unowned))+ .annotate(briefing_relation=_relation_to_person(team_id, user)).filter(briefing_relation__isnull=False))-@frozen-class OpenReportCounts:- for_person: int- in_project: int---def open_report_counts(- *, team_id: int, user: User, exclude_report_ids: Sequence[str] = (), include_unowned: bool = True-) -> OpenReportCounts:- """How many open, actionable reports the project has, and how many of them are for this person.-- `for_person` counts the set `reports_for_person` returns, so a "more for you" number agrees- with the list it follows; pass the `include_unowned` the list was built with to keep that true.- `in_project` ignores the relation either way, so a P0 nobody owns is still counted there.- `exclude_report_ids` leaves out the reports already on screen; one that is resolved or not for the- person was never in the set, so it is not subtracted from it.- """- excluded = list(exclude_report_ids)- in_project = _open_reports(team_id).exclude(id__in=excluded).count()- for_person = reports_for_person(team_id, user, include_unowned=include_unowned).exclude(id__in=excluded).count()- return OpenReportCounts(for_person=for_person, in_project=in_project)--def _pull_request_state(state: str, merged: bool) -> str | None:if merged:return SignalReportAssignment.PrState.MERGEDdiff --git a/products/signals/backend/facade/api.py b/products/signals/backend/facade/api.pyindex 8a03f04d37a2..f7569ed83097 100644--- a/products/signals/backend/facade/api.py+++ b/products/signals/backend/facade/api.py@@ -38,8 +38,6 @@ from products.signals.backend.briefing_reports import (IMPLEMENTATION_PR_STATES as IMPLEMENTATION_PR_STATES,BriefingReportDetails as BriefingReportDetails,BriefingReportRelation as BriefingReportRelation,- OpenReportCounts as OpenReportCounts,- open_report_counts as open_report_counts,report_details as report_details,report_ids_naming_user as report_ids_naming_user,)diff --git a/products/signals/backend/serializers.py b/products/signals/backend/serializers.pyindex 46f58e5832d5..aa8ad7cdf595 100644--- a/products/signals/backend/serializers.py+++ b/products/signals/backend/serializers.py@@ -1926,63 +1926,14 @@ class SignalReportListQuerySerializer(serializers.Serializer):"Defaults to true."),)---MAX_FOR_YOU_REPORTS = 20---class SignalReportsForYouQuerySerializer(serializers.Serializer):- limit = serializers.IntegerField(- required=False,- default=5,- min_value=1,- max_value=MAX_FOR_YOU_REPORTS,- help_text=f"How many of the top reports to return, 1 to {MAX_FOR_YOU_REPORTS}. Defaults to 5.",- )- offset = serializers.IntegerField(- required=False,- default=0,- min_value=0,- help_text=(- "How many reports of the ranked list to skip, after `exclude` is applied. Pages of the same "- "query are slices of one ranked list. Defaults to 0."- ),- )exclude = RepeatedOrCommaSeparatedListField(child=serializers.UUIDField(),required=False,default=list,- max_length=MAX_FOR_YOU_REPORTS,- help_text=(- "Report ids to leave out of `results` and `count`, for example the reports a briefing already "- "shows, as repeated parameters or comma-separated. The other reports keep their order."- ),- )- include_unowned = serializers.BooleanField(- required=False,- default=True,- help_text=(- "Whether to include P0 reports that nobody owns. These belong to the project rather than to "- "one person, so a surface that only shows a person's own work passes false. Defaults to true."- ),- )---class SignalReportsForYouResponseSerializer(serializers.Serializer):- results = SignalReportListSerializer(- many=True,- help_text=(- "One page of the open, actionable reports that matter most to the current user, in the inbox "- "priority order: priority, then status, then most recently updated. They are reports waiting for their input, reports they claimed, "- "reports naming them as a reviewer, and P0 reports that nobody owns unless `include_unowned` "- "is false. The Today briefing ranks reports the same way."- ),- )- count = serializers.IntegerField(+ max_length=100,help_text=(- "How many open, actionable reports are for the current user, on every page together, "- "without the `exclude` ids. Counted over the same set as `results`, so it follows "- "`include_unowned` too."+ "Report ids to leave out of `results` and `count`, for example the reports a client already "+ "shows, as repeated parameters or comma-separated. The other reports keep their order. At most 100."),)diff --git a/products/signals/backend/test/test_briefing_reports.py b/products/signals/backend/test/test_briefing_reports.pyindex 14a1a433c2c8..f729a1e6c76b 100644--- a/products/signals/backend/test/test_briefing_reports.py+++ b/products/signals/backend/test/test_briefing_reports.py@@ -18,12 +18,7 @@ from rest_framework.request import Requestfrom posthog.models import Teamfrom products.signals.backend.artefact_schemas import ActionabilityChoice-from products.signals.backend.briefing_reports import (- open_report_counts,- report_details,- reports_for_person,- summary_lead,-)+from products.signals.backend.briefing_reports import report_details, summary_leadfrom products.signals.backend.models import SignalReport, SignalReportArtefactfrom products.signals.backend.report_metric_access import ReportMetricAccessPolicyfrom products.signals.backend.test.report_metric_test_fixtures import trends_metric_query@@ -48,24 +43,6 @@ class TestReportsForBriefing(BaseTest):)return report- def _named_report(self, title: str) -> SignalReport:- report = SignalReport.objects.create(- team=self.team,- status=SignalReport.Status.READY,- title=title,- summary="Summary",- signal_count=1,- total_weight=1.0,- latest_actionability=ActionabilityChoice.IMMEDIATELY_ACTIONABLE.value,- )- SignalReportArtefact.objects.create(- team=self.team,- report=report,- type=SignalReportArtefact.ArtefactType.SUGGESTED_REVIEWERS,- content=json.dumps([{"github_login": "reviewer", "user_uuid": str(self.user.uuid)}]),- )- return report-@parameterized.expand([("ready", SignalReport.Status.READY, False, "ready"),@@ -162,38 +139,6 @@ class TestReportsForBriefing(BaseTest):assert [(c.chart_id, c.query) for c in details.charts] == [("form-errors", query), ("page-leaves", query)]assert unreadable.metrics == []- def test_open_report_counts_do_not_subtract_a_report_that_was_never_open(self) -> None:- shown_open = self._urgent_report("Shown, still open")- self._urgent_report("Not shown")- resolved = self._urgent_report("Shown, resolved since")- SignalReport.objects.filter(pk=resolved.pk).update(status=SignalReport.Status.RESOLVED)-- counts = open_report_counts(- team_id=self.team.id, user=self.user, exclude_report_ids=[str(shown_open.id), str(resolved.id)]- )-- # By default an unowned P0 is for the person the same way the briefing ranks it, so both counts agree.- assert (counts.in_project, counts.for_person) == (1, 1)-- @parameterized.expand([("included", True, {"Mine", "Nobody's P0"}), ("excluded", False, {"Mine"})])- def test_include_unowned_decides_whether_a_p0_nobody_owns_is_a_candidate(- self, _name: str, include_unowned: bool, expected: set[str]- ) -> None:- self._named_report("Mine")- self._urgent_report("Nobody's P0")-- reports = reports_for_person(self.team.id, self.user, include_unowned=include_unowned)-- assert {report.title for report in reports} == expected-- def test_excluding_unowned_reports_leaves_them_in_the_project_count_only(self) -> None:- self._named_report("Mine")- self._urgent_report("Nobody's P0")-- counts = open_report_counts(team_id=self.team.id, user=self.user, include_unowned=False)-- assert (counts.in_project, counts.for_person) == (2, 1)-class TestSummaryLead(SimpleTestCase):@parameterized.expand(diff --git a/products/signals/backend/test/test_signal_report_api.py b/products/signals/backend/test/test_signal_report_api.pyindex 81258b5dc41b..a829f911fc97 100644--- a/products/signals/backend/test/test_signal_report_api.py+++ b/products/signals/backend/test/test_signal_report_api.py@@ -1647,110 +1647,40 @@ class TestSignalReportListAPI(APIBaseTest):row = next(r for r in response.json()["results"] if r["id"] == str(report.id))assert row["is_suggested_reviewer"] is True- def test_for_you_ranks_the_reports_naming_the_user_and_counts_only_theirs(self):- def report_naming_me(title: str, report_status: str) -> SignalReport:- report = self._create_report(title=title, status=report_status)+ def test_for_you_view_lists_only_the_open_actionable_reports_for_the_user(self):+ def report_naming_me(title: str, priority: str, **fields) -> SignalReport:+ report = self._create_report(title=title, **fields)SignalReportArtefact.objects.create(team=self.team,report=report,type=SignalReportArtefact.ArtefactType.SUGGESTED_REVIEWERS,content=json.dumps([{"user_uuid": str(self.user.uuid)}]),)+ self._priority_artefact(report, priority=priority)return report- report_naming_me("Waits for my input", SignalReport.Status.PENDING_INPUT)- reviewing = report_naming_me("Names me as reviewer", SignalReport.Status.READY)- self._create_report(title="Someone else's report")+ waiting = report_naming_me("Waits for my input", "P2", status=SignalReport.Status.PENDING_INPUT)+ reviewing = report_naming_me("Names me as reviewer", "P1")+ report_naming_me("Not actionable", "P0", latest_actionability="not_actionable")+ report_naming_me("Resolved", "P0", status=SignalReport.Status.RESOLVED)+ unowned = self._create_report(title="Nobody owns it", latest_actionability="immediately_actionable")+ self._priority_artefact(unowned, priority="P0")- response = self.client.get(f"{self._list_url()}for_you/?limit=1")+ response = self.client.get(self._list_url(view="for_you", sort="priority", limit=1))assert response.status_code == status.HTTP_200_OKbody = response.json()assert [row["id"] for row in body["results"]] == [str(reviewing.id)]assert body["count"] == 2-- def test_for_you_excludes_unowned_p0_reports_when_asked(self):- mine = self._create_report(title="Names me as reviewer")- SignalReportArtefact.objects.create(- team=self.team,- report=mine,- type=SignalReportArtefact.ArtefactType.SUGGESTED_REVIEWERS,- content=json.dumps([{"user_uuid": str(self.user.uuid)}]),- )- unowned = self._create_report(title="Nobody owns it", latest_actionability="immediately_actionable")- self._priority_artefact(unowned, priority="P0")-- with_unowned = self.client.get(f"{self._list_url()}for_you/")- without_unowned = self.client.get(f"{self._list_url()}for_you/?include_unowned=false")-- assert with_unowned.status_code == status.HTTP_200_OK- assert without_unowned.status_code == status.HTTP_200_OK- # The P0 leads by default, because priority is the first ranking key.- assert [row["id"] for row in with_unowned.json()["results"]] == [str(unowned.id), str(mine.id)]- assert with_unowned.json()["count"] == 2- assert [row["id"] for row in without_unowned.json()["results"]] == [str(mine.id)]- assert without_unowned.json()["count"] == 1-- def test_for_you_pages_the_ranked_list_without_the_excluded_reports(self):- by_priority: dict[str | None, str] = {}- for priority in ["P3", None, "P1", "P2"]:- report = self._create_report(title=f"Priority {priority}")- SignalReportArtefact.objects.create(- team=self.team,- report=report,- type=SignalReportArtefact.ArtefactType.SUGGESTED_REVIEWERS,- content=json.dumps([{"user_uuid": str(self.user.uuid)}]),- )- self._priority_artefact(report, priority=priority)- by_priority[priority] = str(report.id)-- def for_you(**query: object) -> dict:- response = self.client.get(f"{self._list_url()}for_you/?{urlencode(query)}")- assert response.status_code == status.HTTP_200_OK- return response.json()-- everything = for_you(limit=20)- page = for_you(limit=1, offset=1, exclude=f"{by_priority['P1']},{by_priority['P2']}")-- assert [row["id"] for row in everything["results"]] == [by_priority[p] for p in ["P1", "P2", "P3", None]]- assert everything["count"] == 4- assert [row["id"] for row in page["results"]] == [by_priority[None]]- assert page["count"] == 2-- def test_for_you_uses_the_inbox_control_order_without_joining_the_sort_experiment(self):- titles: dict[str, str] = {}- for title, priority, open_score in [- ("P0 low score", "P0", 0.15),- ("P2 high score", "P2", 0.85),- ("P1 unscored", "P1", None),- ]:- report = self._create_report(title=title)- SignalReportArtefact.objects.create(- team=self.team,- report=report,- type=SignalReportArtefact.ArtefactType.SUGGESTED_REVIEWERS,- content=json.dumps([{"user_uuid": str(self.user.uuid)}]),- )- self._priority_artefact(report, priority=priority)- if open_score is not None:- self._ranking_score_artefact(report, scores={"open": open_score})- titles[str(report.id)] = title- flag = "products.signals.backend.ranking.inbox_sort.posthoganalytics.get_feature_flag"-- with patch(flag, return_value="control"):- inbox = self.client.get(self._list_url(sort="recommended", suggested_reviewers=str(self.user.uuid)))- with patch(flag, return_value="open") as get_flag:- for_you = self.client.get(f"{self._list_url()}for_you/?limit=20")-- assert inbox.status_code == status.HTTP_200_OK- assert for_you.status_code == status.HTTP_200_OK- get_flag.assert_not_called()- assert [titles[row["id"]] for row in for_you.json()["results"]] == [- "P0 low score",- "P1 unscored",- "P2 high score",- ]- assert for_you.json()["results"] == inbox.json()["results"]+ assert body["next"] is not None+ next_page = self.client.get(body["next"]).json()+ assert [row["id"] for row in next_page["results"]] == [str(waiting.id)]++ without_shown = self.client.get(+ self._list_url(view="for_you", sort="priority", exclude=str(reviewing.id), offset=0)+ ).json()+ assert [row["id"] for row in without_shown["results"]] == [str(waiting.id)]+ assert without_shown["count"] == 1def test_is_suggested_reviewer_uses_latest_reviewers_row(self):# suggested_reviewers is append-only: an older row listing the user must not keep themdiff --git a/products/signals/backend/views.py b/products/signals/backend/views.pyindex 9dea4ccfeee5..2a26a1299004 100644--- a/products/signals/backend/views.py+++ b/products/signals/backend/views.py@@ -118,7 +118,7 @@ from products.signals.backend.billing import (refund_ineligibility_reason,report_pr_is_merged,)-from products.signals.backend.briefing_reports import open_report_counts, reports_for_person+from products.signals.backend.briefing_reports import reports_for_personfrom products.signals.backend.dismissal_notes import forward_dismissal_notefrom products.signals.backend.enums import ReportPriority, ReportTaskActionKindfrom products.signals.backend.facade.api import emit_signal@@ -247,8 +247,6 @@ from products.signals.backend.serializers import (SignalReportPriorityUpdateSerializer,SignalReportRefundSerializer,SignalReportSerializer,- SignalReportsForYouQuerySerializer,- SignalReportsForYouResponseSerializer,SignalReportSourceMetadataRequestSerializer,SignalReportSourceMetadataResponseSerializer,SignalReportSuggestedReviewersArtefactSerializer,@@ -1229,6 +1227,7 @@ class SignalReportViewSet(_INBOX_VIEWS = frozenset({"actionable",+ "for_you","needs_input","needs_decision","monitoring",@@ -1292,7 +1291,7 @@ class SignalReportViewSet(return Response(ReportReadStateResponseSerializer({"states": states}).data)def get_serializer_class(self) -> type[serializers.BaseSerializer]:- if self.action in {"list", "for_you"}:+ if self.action == "list":return SignalReportListSerializerreturn SignalReportSerializer@@ -1422,7 +1421,7 @@ class SignalReportViewSet(}# Actions that work on many reports at once, so per-row annotations are wasted work there.- _MULTI_REPORT_ACTIONS = frozenset({"list", "bulk_state", "for_you"})+ _MULTI_REPORT_ACTIONS = frozenset({"list", "bulk_state"})# Actions allowed to resolve a suppressed report by ID even without an explicit# `status` filter. These are the read/reopen paths the inbox's Dismissed tab needs:@@ -1818,6 +1817,9 @@ class SignalReportViewSet(latest_actionability=ActionabilityChoice.IMMEDIATELY_ACTIONABLE.value,latest_already_addressed=False,).exclude(self._implementation_pr_report_filter())+ if inbox_view == "for_you":+ for_person = reports_for_person(self.team_id, cast(User, self.request.user))+ return queryset.filter(id__in=for_person.values("id"))if inbox_view == "needs_input":return queryset.filter(status=SignalReport.Status.PENDING_INPUT,@@ -2080,7 +2082,7 @@ class SignalReportViewSet(def filter_queryset(self, queryset):queryset = super().filter_queryset(queryset)- if self.action not in {"list", "for_you"}:+ if self.action != "list":# A by-ID lookup has nothing to order. More importantly, keeping list ordering here# forces every detail request to compute status/priority/reviewer annotations that# cannot affect which primary-key row is returned.@@ -2109,9 +2111,6 @@ class SignalReportViewSet(@cached_propertydef _inbox_ranker(self) -> InboxRanker | None:- if self.action == "for_you":- # The recommended sort experiment covers the web inbox only, so `for_you` uses its control order.- return "priority"params = self.request.query_paramsif params.get("ordering") is not None or params.get("sort") != "recommended":return None@@ -2480,9 +2479,11 @@ class SignalReportViewSet(location=OpenApiParameter.QUERY,required=False,description=(- "Apply an inbox view: actionable, needs_input, needs_decision, monitoring, resolved, dismissed, "- "held_back, not_actionable, or all. Each view applies the corresponding status, actionability, and "- "implementation-PR filters. needs_decision also includes failed reports without a judgment. "+ "Apply an inbox view: actionable, for_you, needs_input, needs_decision, monitoring, resolved, "+ "dismissed, held_back, not_actionable, or all. Each view applies the corresponding status, "+ "actionability, and implementation-PR filters. for_you holds the open, actionable reports that "+ "wait for the requesting user's input, that they claimed, or that name them as a suggested "+ "reviewer. needs_decision also includes failed reports without a judgment. ""dismissed and held_back split the suppressed reports: dismissed holds the ones a person or agent ""dismissed, merged, or whose pull request closed without merging; held_back holds the ones the ""safety or actionability judge suppressed before anyone saw them. Each row's suppression_source "@@ -2599,6 +2600,7 @@ class SignalReportViewSet(def list(self, request: ValidatedRequest, *args, **kwargs):count_only: bool = request.validated_query_data["count_only"]include_source_metadata: bool = request.validated_query_data["include_source_metadata"]+ excluded = request.validated_query_data["exclude"]if count_only:# A count orders nothing, so it must not record a flag exposure for the ranker.self._inbox_ranker = None@@ -2622,6 +2624,8 @@ class SignalReportViewSet(with tracer.start_as_current_span("signals.reports.list.queryset"):queryset = self.filter_queryset(self.get_queryset())+ if excluded:+ queryset = queryset.exclude(id__in=excluded)if count_only:total_count = queryset.count()else:@@ -2715,35 +2719,6 @@ class SignalReportViewSet(with tracer.start_as_current_span("signals.reports.list.serialize"):return serializer.data- @validated_request(- query_serializer=SignalReportsForYouQuerySerializer,- responses={200: OpenApiResponse(response=SignalReportsForYouResponseSerializer)},- summary="List the reports that matter most to the current user",- description=(- "One page of the open, actionable reports for the current user, and how many there are in "- "total, in the inbox priority order: priority, then status, then most recently updated. Uses the "- "same ranking and count as the Today briefing, so this is the short list to show someone who asks what needs them. Pass `exclude` to leave out reports already "- "on screen and `offset` to get the next page. Pass `include_unowned=false` to leave out the "- "P0 reports nobody owns, which belong to the project rather than to this person."- ),- )- @action(detail=False, methods=["get"], url_path="for_you", required_scopes=["task:read"])- def for_you(self, request: ValidatedRequest, *args, **kwargs) -> Response:- user = cast(User, request.user)- query = request.validated_query_data- excluded = [str(report_id) for report_id in query["exclude"]]- for_person = reports_for_person(self.team_id, user, include_unowned=query["include_unowned"])- queryset = (- self.filter_queryset(self.get_queryset()).filter(id__in=for_person.values("id")).exclude(id__in=excluded)- )- offset = query["offset"]- reports = list(queryset[offset : offset + query["limit"]])- counts = open_report_counts(- team_id=self.team_id, user=user, exclude_report_ids=excluded, include_unowned=query["include_unowned"]- )- rows = self._render_report_rows(reports, include_source_metadata=True)- return Response({"results": rows, "count": counts.for_person})-@extend_schema(summary="List the org members who can be suggested as reviewers",parameters=[diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.tsindex 2ad7f66448c6..1bffa67f4e26 100644--- a/products/signals/frontend/generated/api.schemas.ts+++ b/products/signals/frontend/generated/api.schemas.ts@@ -3807,13 +3807,6 @@ export interface SignalReportBulkStateResponseApi {not_found_count: number}-export interface SignalReportsForYouResponseApi {- /** One page of the open, actionable reports that matter most to the current user, in the inbox priority order: priority, then status, then most recently updated. They are reports waiting for their input, reports they claimed, reports naming them as a reviewer, and P0 reports that nobody owns unless `include_unowned` is false. The Today briefing ranks reports the same way. */- results: SignalReportListApi[]- /** How many open, actionable reports are for the current user, on every page together, without the `exclude` ids. Counted over the same set as `results`, so it follows `include_unowned` too. */- count: number-}-/*** * `passing` - Passing* * `failing` - Failing@@ -8157,6 +8150,11 @@ export type SignalsReportsListParams = {* ISO 8601 datetime. Keeps reports created at or after this time.*/created_after?: string+ /**+ * Report ids to leave out of `results` and `count`, for example the reports a client already shows, as repeated parameters or comma-separated. The other reports keep their order. At most 100.+ * @maxItems 100+ */+ exclude?: string[]/*** Filter reports by whether an implementation pull request is attached. 'true' keeps only reports with a PR; 'false' keeps only those without. Pair with count_only=true to return only the filtered total.*/@@ -8242,7 +8240,7 @@ export type SignalsReportsListParams = {*/use_priority_preference?: boolean/**- * Apply an inbox view: actionable, needs_input, needs_decision, monitoring, resolved, dismissed, held_back, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters. needs_decision also includes failed reports without a judgment. dismissed and held_back split the suppressed reports: dismissed holds the ones a person or agent dismissed, merged, or whose pull request closed without merging; held_back holds the ones the safety or actionability judge suppressed before anyone saw them. Each row's suppression_source says which.+ * Apply an inbox view: actionable, for_you, needs_input, needs_decision, monitoring, resolved, dismissed, held_back, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters. for_you holds the open, actionable reports that wait for the requesting user's input, that they claimed, or that name them as a suggested reviewer. needs_decision also includes failed reports without a judgment. dismissed and held_back split the suppressed reports: dismissed holds the ones a person or agent dismissed, merged, or whose pull request closed without merging; held_back holds the ones the safety or actionability judge suppressed before anyone saw them. Each row's suppression_source says which.*/view?: string}@@ -8340,29 +8338,6 @@ export type SignalsReportsAvailableReviewersRetrieve200 = {}}-export type SignalsReportsForYouRetrieveParams = {- /**- * Report ids to leave out of `results` and `count`, for example the reports a briefing already shows, as repeated parameters or comma-separated. The other reports keep their order.- * @maxItems 20- */- exclude?: string[]- /**- * Whether to include P0 reports that nobody owns. These belong to the project rather than to one person, so a surface that only shows a person's own work passes false. Defaults to true.- */- include_unowned?: boolean- /**- * How many of the top reports to return, 1 to 20. Defaults to 5.- * @minimum 1- * @maximum 20- */- limit?: number- /**- * How many reports of the ranked list to skip, after `exclude` is applied. Pages of the same query are slices of one ranked list. Defaults to 0.- * @minimum 0- */- offset?: number-}-export type SignalsReportsPrCiStatusesParams = {/*** Comma-separated report UUIDs to resolve CI state for, at most 100 per request.diff --git a/products/signals/frontend/generated/api.ts b/products/signals/frontend/generated/api.tsindex 61b71ac91121..a81f8c92765a 100644--- a/products/signals/frontend/generated/api.ts+++ b/products/signals/frontend/generated/api.ts@@ -116,7 +116,6 @@ import type {SignalReportTaskActionListResponseApi,SignalReportTaskActionRunRequestApi,SignalReportTaskActionRunResponseApi,- SignalReportsForYouResponseApi,SignalScoutConfigApi,SignalScoutConfigCreateApi,SignalScoutCreateApi,@@ -144,7 +143,6 @@ import type {SignalsReportPrReviewCommentsCreateParams,SignalsReportsAvailableReviewersRetrieve200,SignalsReportsAvailableReviewersRetrieveParams,- SignalsReportsForYouRetrieveParams,SignalsReportsListParams,SignalsReportsPrCiStatusesParams,SignalsScoutConfigListParams,@@ -1385,37 +1383,6 @@ export const signalsReportsBulkStateCreate = async (})}-export const getSignalsReportsForYouRetrieveUrl = (projectId: string, params?: SignalsReportsForYouRetrieveParams) => {- const normalizedParams = new URLSearchParams()-- Object.entries(params || {}).forEach(([key, value]) => {- if (value !== undefined) {- normalizedParams.append(key, value === null ? 'null' : String(value))- }- })-- const stringifiedParams = normalizedParams.toString()-- return stringifiedParams.length > 0- ? `/api/projects/${projectId}/signals/reports/for_you/?${stringifiedParams}`- : `/api/projects/${projectId}/signals/reports/for_you/`-}--/**- * One page of the open, actionable reports for the current user, and how many there are in total, in the inbox priority order: priority, then status, then most recently updated. Uses the same ranking and count as the Today briefing, so this is the short list to show someone who asks what needs them. Pass `exclude` to leave out reports already on screen and `offset` to get the next page. Pass `include_unowned=false` to leave out the P0 reports nobody owns, which belong to the project rather than to this person.- * @summary List the reports that matter most to the current user- */-export const signalsReportsForYouRetrieve = async (- projectId: string,- params?: SignalsReportsForYouRetrieveParams,- options?: RequestInit-): Promise<SignalReportsForYouResponseApi> => {- return apiMutator<SignalReportsForYouResponseApi>(getSignalsReportsForYouRetrieveUrl(projectId, params), {- ...options,- method: 'GET',- })-}-export const getSignalsReportsPrCiStatusesUrl = (projectId: string, params: SignalsReportsPrCiStatusesParams) => {const normalizedParams = new URLSearchParams()diff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yamlindex 62bf8136b107..82e82cdff164 100644--- a/products/signals/mcp/tools.yaml+++ b/products/signals/mcp/tools.yaml@@ -358,19 +358,21 @@ tools:have no implementation PR yet, at or above the requesting user's personal PR-generation threshold, fallingback to the project threshold. `use_priority_preference` selects which priorities to include, and does notorder them, so pass `sort=priority` to put P0 first; the default ordering can put a recently updated P4- above an older P0. Without `limit` a page holds up to 100 reports, each with its summary. The other views- are `needs_input` (waiting on a human), `needs_decision` (failed reports, plus actionable ready or- pending-input reports without an implementation PR), `monitoring` (an implementation PR is open),- `resolved`, `dismissed` (suppressed by a person, an agent, a merge, or a closed PR), `held_back` (suppressed- by a judge, with nobody's review yet), `not_actionable`, and `all`. Narrow by reviewer with `scope=for_me`,- or `scope=teammate` plus `teammate_uuid`; the default `scope=entire_project` searches every report.- `priority`, `source_product`, and `scout` each take a comma-separated list. To find the self-driving reports- for one source record — e.g. what the inbox already investigated for a specific support ticket — pass that- record's id as `source_id` together with exactly one `source_product` (for a support ticket:- `source_product=conversations` and the ticket's UUID as `source_id`); add `include_all_statuses=true` to- include dismissed ones. Each row includes typed impact metric metadata and any accessible cached snapshot,- but omits live query definitions and comparisons. Queryless legacy or malformed metrics are always redacted.- Listing reports does not execute metric queries.+ above an older P0. Without `limit` a page holds up to 100 reports, each with its summary. To answer "what+ needs me", pass `view=for_you` with `sort=priority`: that returns the open, actionable reports that wait for+ the requesting user's input, that they claimed, or that name them as a suggested reviewer, and `count` gives+ how many there are in total. The other views are `needs_input` (waiting on a human), `needs_decision`+ (failed reports, plus actionable ready or pending-input reports without an implementation PR), `monitoring`+ (an implementation PR is open), `resolved`, `dismissed` (suppressed by a person, an agent, a merge, or a+ closed PR), `held_back` (suppressed by a judge, with nobody's review yet), `not_actionable`, and `all`.+ Narrow by reviewer with `scope=for_me`, or `scope=teammate` plus `teammate_uuid`; the default+ `scope=entire_project` searches every report. `priority`, `source_product`, and `scout` each take a+ comma-separated list. To find the self-driving reports for one source record — e.g. what the inbox already+ investigated for a specific support ticket — pass that record's id as `source_id` together with exactly one+ `source_product` (for a support ticket: `source_product=conversations` and the ticket's UUID as+ `source_id`); add `include_all_statuses=true` to include dismissed ones. Each row includes typed impact+ metric metadata and any accessible cached snapshot, but omits live query definitions and comparisons.+ Queryless legacy or malformed metrics are always redacted. Listing reports does not execute metric queries.agent_note: >You may inspect reports without claiming them. A claim indicates active work that should not be duplicated.Before claiming a report, read the report and its work log. If you decide to begin working to fix the issuesdiff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 35aaf63cec99..211fcde8732d 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -7180,7 +7180,7 @@}},"inbox-reports-list": {- "description": "List signal reports for the current project. A signal report is a cluster of related observations (signals) that PostHog has aggregated into a single issue or trend. Reports surface in the Inbox. Supports filtering by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-text search across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers, `unclaimed`, and `assignee=me`. Claimed reports remain actionable and visible; use `unclaimed=true` to pick work that has no owner and no draft, open, or unknown PR. Some statuses are hidden by default (currently suppressed); pass `include_all_statuses=true` to list reports in every status. Do this when deduplicating against the full inbox state, and read each row's `status` (plus `suppression_source`, `dismissal_reason`, and `dismissal_note` on suppressed rows) before acting. A suppressed row's `suppression_source` says whether someone dismissed it (`dismissed`) or a judge held it back before anyone saw it (`safety_judge`, `not_actionable`, `system`). For picking up work, filter to `ready` — earlier statuses are still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report's full work log, including signal findings, judgments, and log entries, is readable via inbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered by '-is_suggested_reviewer,status,-updated_at' by default. To answer \"what should I look at next\", pass `view=actionable` with `use_priority_preference=true`, `sort=priority`, and `limit=10`: that returns ready, actionable reports that have no implementation PR yet, at or above the requesting user's personal PR-generation threshold, falling back to the project threshold. `use_priority_preference` selects which priorities to include, and does not order them, so pass `sort=priority` to put P0 first; the default ordering can put a recently updated P4 above an older P0. Without `limit` a page holds up to 100 reports, each with its summary. The other views are `needs_input` (waiting on a human), `needs_decision` (failed reports, plus actionable ready or pending-input reports without an implementation PR), `monitoring` (an implementation PR is open), `resolved`, `dismissed` (suppressed by a person, an agent, a merge, or a closed PR), `held_back` (suppressed by a judge, with nobody's review yet), `not_actionable`, and `all`. Narrow by reviewer with `scope=for_me`, or `scope=teammate` plus `teammate_uuid`; the default `scope=entire_project` searches every report. `priority`, `source_product`, and `scout` each take a comma-separated list. To find the self-driving reports for one source record — e.g. what the inbox already investigated for a specific support ticket — pass that record's id as `source_id` together with exactly one `source_product` (for a support ticket: `source_product=conversations` and the ticket's UUID as `source_id`); add `include_all_statuses=true` to include dismissed ones. Each row includes typed impact metric metadata and any accessible cached snapshot, but omits live query definitions and comparisons. Queryless legacy or malformed metrics are always redacted. Listing reports does not execute metric queries.",+ "description": "List signal reports for the current project. A signal report is a cluster of related observations (signals) that PostHog has aggregated into a single issue or trend. Reports surface in the Inbox. Supports filtering by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-text search across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers, `unclaimed`, and `assignee=me`. Claimed reports remain actionable and visible; use `unclaimed=true` to pick work that has no owner and no draft, open, or unknown PR. Some statuses are hidden by default (currently suppressed); pass `include_all_statuses=true` to list reports in every status. Do this when deduplicating against the full inbox state, and read each row's `status` (plus `suppression_source`, `dismissal_reason`, and `dismissal_note` on suppressed rows) before acting. A suppressed row's `suppression_source` says whether someone dismissed it (`dismissed`) or a judge held it back before anyone saw it (`safety_judge`, `not_actionable`, `system`). For picking up work, filter to `ready` — earlier statuses are still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report's full work log, including signal findings, judgments, and log entries, is readable via inbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered by '-is_suggested_reviewer,status,-updated_at' by default. To answer \"what should I look at next\", pass `view=actionable` with `use_priority_preference=true`, `sort=priority`, and `limit=10`: that returns ready, actionable reports that have no implementation PR yet, at or above the requesting user's personal PR-generation threshold, falling back to the project threshold. `use_priority_preference` selects which priorities to include, and does not order them, so pass `sort=priority` to put P0 first; the default ordering can put a recently updated P4 above an older P0. Without `limit` a page holds up to 100 reports, each with its summary. To answer \"what needs me\", pass `view=for_you` with `sort=priority`: that returns the open, actionable reports that wait for the requesting user's input, that they claimed, or that name them as a suggested reviewer, and `count` gives how many there are in total. The other views are `needs_input` (waiting on a human), `needs_decision` (failed reports, plus actionable ready or pending-input reports without an implementation PR), `monitoring` (an implementation PR is open), `resolved`, `dismissed` (suppressed by a person, an agent, a merge, or a closed PR), `held_back` (suppressed by a judge, with nobody's review yet), `not_actionable`, and `all`. Narrow by reviewer with `scope=for_me`, or `scope=teammate` plus `teammate_uuid`; the default `scope=entire_project` searches every report. `priority`, `source_product`, and `scout` each take a comma-separated list. To find the self-driving reports for one source record — e.g. what the inbox already investigated for a specific support ticket — pass that record's id as `source_id` together with exactly one `source_product` (for a support ticket: `source_product=conversations` and the ticket's UUID as `source_id`); add `include_all_statuses=true` to include dismissed ones. Each row includes typed impact metric metadata and any accessible cached snapshot, but omits live query definitions and comparisons. Queryless legacy or malformed metrics are always redacted. Listing reports does not execute metric queries.","category": "Signals","feature": "signals","summary": "List signal reports",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 93219c889d24..bf7caae5dfa4 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -7377,7 +7377,7 @@}},"inbox-reports-list": {- "description": "List signal reports for the current project. A signal report is a cluster of related observations (signals) that PostHog has aggregated into a single issue or trend. Reports surface in the Inbox. Supports filtering by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-text search across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers, `unclaimed`, and `assignee=me`. Claimed reports remain actionable and visible; use `unclaimed=true` to pick work that has no owner and no draft, open, or unknown PR. Some statuses are hidden by default (currently suppressed); pass `include_all_statuses=true` to list reports in every status. Do this when deduplicating against the full inbox state, and read each row's `status` (plus `suppression_source`, `dismissal_reason`, and `dismissal_note` on suppressed rows) before acting. A suppressed row's `suppression_source` says whether someone dismissed it (`dismissed`) or a judge held it back before anyone saw it (`safety_judge`, `not_actionable`, `system`). For picking up work, filter to `ready` — earlier statuses are still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report's full work log, including signal findings, judgments, and log entries, is readable via inbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered by '-is_suggested_reviewer,status,-updated_at' by default. To answer \"what should I look at next\", pass `view=actionable` with `use_priority_preference=true`, `sort=priority`, and `limit=10`: that returns ready, actionable reports that have no implementation PR yet, at or above the requesting user's personal PR-generation threshold, falling back to the project threshold. `use_priority_preference` selects which priorities to include, and does not order them, so pass `sort=priority` to put P0 first; the default ordering can put a recently updated P4 above an older P0. Without `limit` a page holds up to 100 reports, each with its summary. The other views are `needs_input` (waiting on a human), `needs_decision` (failed reports, plus actionable ready or pending-input reports without an implementation PR), `monitoring` (an implementation PR is open), `resolved`, `dismissed` (suppressed by a person, an agent, a merge, or a closed PR), `held_back` (suppressed by a judge, with nobody's review yet), `not_actionable`, and `all`. Narrow by reviewer with `scope=for_me`, or `scope=teammate` plus `teammate_uuid`; the default `scope=entire_project` searches every report. `priority`, `source_product`, and `scout` each take a comma-separated list. To find the self-driving reports for one source record — e.g. what the inbox already investigated for a specific support ticket — pass that record's id as `source_id` together with exactly one `source_product` (for a support ticket: `source_product=conversations` and the ticket's UUID as `source_id`); add `include_all_statuses=true` to include dismissed ones. Each row includes typed impact metric metadata and any accessible cached snapshot, but omits live query definitions and comparisons. Queryless legacy or malformed metrics are always redacted. Listing reports does not execute metric queries.",+ "description": "List signal reports for the current project. A signal report is a cluster of related observations (signals) that PostHog has aggregated into a single issue or trend. Reports surface in the Inbox. Supports filtering by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-text search across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers, `unclaimed`, and `assignee=me`. Claimed reports remain actionable and visible; use `unclaimed=true` to pick work that has no owner and no draft, open, or unknown PR. Some statuses are hidden by default (currently suppressed); pass `include_all_statuses=true` to list reports in every status. Do this when deduplicating against the full inbox state, and read each row's `status` (plus `suppression_source`, `dismissal_reason`, and `dismissal_note` on suppressed rows) before acting. A suppressed row's `suppression_source` says whether someone dismissed it (`dismissed`) or a judge held it back before anyone saw it (`safety_judge`, `not_actionable`, `system`). For picking up work, filter to `ready` — earlier statuses are still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report's full work log, including signal findings, judgments, and log entries, is readable via inbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered by '-is_suggested_reviewer,status,-updated_at' by default. To answer \"what should I look at next\", pass `view=actionable` with `use_priority_preference=true`, `sort=priority`, and `limit=10`: that returns ready, actionable reports that have no implementation PR yet, at or above the requesting user's personal PR-generation threshold, falling back to the project threshold. `use_priority_preference` selects which priorities to include, and does not order them, so pass `sort=priority` to put P0 first; the default ordering can put a recently updated P4 above an older P0. Without `limit` a page holds up to 100 reports, each with its summary. To answer \"what needs me\", pass `view=for_you` with `sort=priority`: that returns the open, actionable reports that wait for the requesting user's input, that they claimed, or that name them as a suggested reviewer, and `count` gives how many there are in total. The other views are `needs_input` (waiting on a human), `needs_decision` (failed reports, plus actionable ready or pending-input reports without an implementation PR), `monitoring` (an implementation PR is open), `resolved`, `dismissed` (suppressed by a person, an agent, a merge, or a closed PR), `held_back` (suppressed by a judge, with nobody's review yet), `not_actionable`, and `all`. Narrow by reviewer with `scope=for_me`, or `scope=teammate` plus `teammate_uuid`; the default `scope=entire_project` searches every report. `priority`, `source_product`, and `scout` each take a comma-separated list. To find the self-driving reports for one source record — e.g. what the inbox already investigated for a specific support ticket — pass that record's id as `source_id` together with exactly one `source_product` (for a support ticket: `source_product=conversations` and the ticket's UUID as `source_id`); add `include_all_statuses=true` to include dismissed ones. Each row includes typed impact metric metadata and any accessible cached snapshot, but omits live query definitions and comparisons. Queryless legacy or malformed metrics are always redacted. Listing reports does not execute metric queries.","category": "Signals","feature": "signals","summary": "List signal reports",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 78006c9ce1a1..ad53ec6cf637 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -103863,13 +103863,6 @@ export namespace Schemas {run_error: string | null;}- export interface SignalReportsForYouResponse {- /** One page of the open, actionable reports that matter most to the current user, in the inbox priority order: priority, then status, then most recently updated. They are reports waiting for their input, reports they claimed, reports naming them as a reviewer, and P0 reports that nobody owns unless `include_unowned` is false. The Today briefing ranks reports the same way. */- results: SignalReportList[];- /** How many open, actionable reports are for the current user, on every page together, without the `exclude` ids. Counted over the same set as `results`, so it follows `include_unowned` too. */- count: number;- }-/*** Optional JSON Schema (draft 2020-12) describing ONE structured record this scout produces via `scout-record-output` — e.g. a per-report quality judgment (`{"type": "object", "properties": {"verdict": {"enum": ["good", "bad", "unsure"]}, "reason": {"type": "string"}}, "required": ["verdict", "reason"]}`). The root must be `"type": "object"`. Setting a schema turns the structured-output channel on: the run prompt renders the schema and every submitted record is validated against it and recorded in the project as a `$scout_structured_output` event, queryable like any event. The channel also requires emit — a dry-run scout has nowhere to record to. Cardinality is the scout's call (one record per run, one per judged entity, ...). Null = channel off. Setting a schema requires skill-authoring authorization (the `llm_skill:write` scope and skill editor access) since the scout reads it verbatim in its prompt; clearing it needs only the config write. Records validate against the schema in force when the run was dispatched.* @nullable@@ -131711,6 +131704,11 @@ export namespace Schemas {* ISO 8601 datetime. Keeps reports created at or after this time.*/created_after?: string;+ /**+ * Report ids to leave out of `results` and `count`, for example the reports a client already shows, as repeated parameters or comma-separated. The other reports keep their order. At most 100.+ * @maxItems 100+ */+ exclude?: string[];/*** Filter reports by whether an implementation pull request is attached. 'true' keeps only reports with a PR; 'false' keeps only those without. Pair with count_only=true to return only the filtered total.*/@@ -131796,7 +131794,7 @@ export namespace Schemas {*/use_priority_preference?: boolean;/**- * Apply an inbox view: actionable, needs_input, needs_decision, monitoring, resolved, dismissed, held_back, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters. needs_decision also includes failed reports without a judgment. dismissed and held_back split the suppressed reports: dismissed holds the ones a person or agent dismissed, merged, or whose pull request closed without merging; held_back holds the ones the safety or actionability judge suppressed before anyone saw them. Each row's suppression_source says which.+ * Apply an inbox view: actionable, for_you, needs_input, needs_decision, monitoring, resolved, dismissed, held_back, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters. for_you holds the open, actionable reports that wait for the requesting user's input, that they claimed, or that name them as a suggested reviewer. needs_decision also includes failed reports without a judgment. dismissed and held_back split the suppressed reports: dismissed holds the ones a person or agent dismissed, merged, or whose pull request closed without merging; held_back holds the ones the safety or actionability judge suppressed before anyone saw them. Each row's suppression_source says which.*/view?: string;};@@ -131893,29 +131891,6 @@ export namespace Schemas {email: string;}};- export type SignalsReportsForYouRetrieveParams = {- /**- * Report ids to leave out of `results` and `count`, for example the reports a briefing already shows, as repeated parameters or comma-separated. The other reports keep their order.- * @maxItems 20- */- exclude?: string[];- /**- * Whether to include P0 reports that nobody owns. These belong to the project rather than to one person, so a surface that only shows a person's own work passes false. Defaults to true.- */- include_unowned?: boolean;- /**- * How many of the top reports to return, 1 to 20. Defaults to 5.- * @minimum 1- * @maximum 20- */- limit?: number;- /**- * How many reports of the ranked list to skip, after `exclude` is applied. Pages of the same query are slices of one ranked list. Defaults to 0.- * @minimum 0- */- offset?: number;- };-export type SignalsReportsPrCiStatusesParams = {/*** Comma-separated report UUIDs to resolve CI state for, at most 100 per request.diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.tsindex 17aa958e7dce..90e574e75342 100644--- a/services/mcp/src/generated/signals/api.ts+++ b/services/mcp/src/generated/signals/api.ts@@ -152,6 +152,8 @@ export const SignalsReportsListParams = () => zod.object({})export const signalsReportsListQueryCountOnlyDefault = false+export const signalsReportsListQueryExcludeMax = 100+export const signalsReportsListQueryIncludeSourceMetadataDefault = trueexport const SignalsReportsListQueryParams = () => zod.object({@@ -187,6 +189,13 @@ export const SignalsReportsListQueryParams = () => zod.object({.datetime({ offset: true }).optional().describe('ISO 8601 datetime. Keeps reports created at or after this time.'),+ exclude: zod+ .array(zod.string())+ .max(signalsReportsListQueryExcludeMax)+ .optional()+ .describe(+ 'Report ids to leave out of `results` and `count`, for example the reports a client already shows, as repeated parameters or comma-separated. The other reports keep their order. At most 100.'+ ),has_implementation_pr: zod.boolean().optional()@@ -288,7 +297,7 @@ export const SignalsReportsListQueryParams = () => zod.object({.string().optional().describe(- "Apply an inbox view: actionable, needs_input, needs_decision, monitoring, resolved, dismissed, held_back, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters. needs_decision also includes failed reports without a judgment. dismissed and held_back split the suppressed reports: dismissed holds the ones a person or agent dismissed, merged, or whose pull request closed without merging; held_back holds the ones the safety or actionability judge suppressed before anyone saw them. Each row's suppression_source says which."+ "Apply an inbox view: actionable, for_you, needs_input, needs_decision, monitoring, resolved, dismissed, held_back, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters. for_you holds the open, actionable reports that wait for the requesting user's input, that they claimed, or that name them as a suggested reviewer. needs_decision also includes failed reports without a judgment. dismissed and held_back split the suppressed reports: dismissed holds the ones a person or agent dismissed, merged, or whose pull request closed without merging; held_back holds the ones the safety or actionability judge suppressed before anyone saw them. Each row's suppression_source says which."),})diff --git a/services/mcp/src/tools/generated/signals.ts b/services/mcp/src/tools/generated/signals.tsindex a303584380f8..36ea5ad20a2a 100644--- a/services/mcp/src/tools/generated/signals.ts+++ b/services/mcp/src/tools/generated/signals.ts@@ -502,6 +502,7 @@ const inboxReportsList = (): ToolBase<channel_id: params.channel_id,count_only: params.count_only,created_after: params.created_after,+ exclude: params.exclude,has_implementation_pr: params.has_implementation_pr,include_all_statuses: params.include_all_statuses,include_source_metadata: params.include_source_metadata,diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.jsonindex 589d4af6a069..23b3eb5f8051 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.json@@ -29,6 +29,14 @@"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","type": "string"},+ "exclude": {+ "description": "Report ids to leave out of `results` and `count`, for example the reports a client already shows, as repeated parameters or comma-separated. The other reports keep their order. At most 100.",+ "items": {+ "type": "string"+ },+ "maxItems": 100,+ "type": "array"+ },"has_implementation_pr": {"description": "Filter reports by whether an implementation pull request is attached. 'true' keeps only reports with a PR; 'false' keeps only those without. Pair with count_only=true to return only the filtered total.","type": "boolean"@@ -115,7 +123,7 @@"type": "boolean"},"view": {- "description": "Apply an inbox view: actionable, needs_input, needs_decision, monitoring, resolved, dismissed, held_back, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters. needs_decision also includes failed reports without a judgment. dismissed and held_back split the suppressed reports: dismissed holds the ones a person or agent dismissed, merged, or whose pull request closed without merging; held_back holds the ones the safety or actionability judge suppressed before anyone saw them. Each row's suppression_source says which.",+ "description": "Apply an inbox view: actionable, for_you, needs_input, needs_decision, monitoring, resolved, dismissed, held_back, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters. for_you holds the open, actionable reports that wait for the requesting user's input, that they claimed, or that name them as a suggested reviewer. needs_decision also includes failed reports without a judgment. dismissed and held_back split the suppressed reports: dismissed holds the ones a person or agent dismissed, merged, or whose pull request closed without merging; held_back holds the ones the safety or actionability judge suppressed before anyone saw them. Each row's suppression_source says which.","type": "string"}},