: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): show who owns a custom scout (#88003)
posthog[bot]dadf6954bf80
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 05f227124c26..c15008827c47 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -6976,6 +6976,10 @@ snapshots:hash: v1.k794b7964.cb0a021303b103cdcd037db93be44c2c5eae3e59494ab8a726ac8e430f631dfd.n4BzfjRbtrkqXUS8HZwDAYrPQHYDeqCHuny9Z4Oz134scenes-app-inbox-scoutmcpserverspicker--scout-settings-variant--light:hash: v1.k794b7964.2f1013abc412adb4544bca6a00209d3051c46969db69d4242ab201ecf5d189f3.YVfbrzpaRzPwuCbeFXmaVOLla0fvhHmAm1CkuaKWCLI+ scenes-app-inbox-scoutowners--states--dark:+ hash: v1.k794b7964.2ee1d4942c7c04c494fc25af3d73031dd26190ecca1ecdf02f5b0c21751d3084.WJ8hfD7b6hZxiBmCQ_k4Wx9LrTXdLrk39-Kau-gMIJU+ scenes-app-inbox-scoutowners--states--light:+ hash: v1.k794b7964.62cb1889d60cf91cae1d0337da5a9209f4a759a1ccfed6a67dd6d2b238e75f13.qvVHYAWE8wGdD83VE5OOHw6uveEUae2uieDQ6sExrrsscenes-app-inbox-scoutsroster--large-fleet--dark:hash: v1.k794b7964.93eef32b387248bc4fb19e860267675bdb55ebd544cf31a4d462db8c27db4c42.LW5WPysIjDR4qLLNitsa4Ba5PORL-Z_psDYcc9pjK2Ascenes-app-inbox-scoutsroster--large-fleet--light:diff --git a/products/replay_vision/backend/api/scanner_scouts.py b/products/replay_vision/backend/api/scanner_scouts.pyindex a51c9d190636..e7b39f9b23f8 100644--- a/products/replay_vision/backend/api/scanner_scouts.py+++ b/products/replay_vision/backend/api/scanner_scouts.py@@ -13,7 +13,7 @@ from products.replay_vision.backend.scanner_access import scanner_for_recording_from products.replay_vision.backend.scout_source import SCOUT_SOURCE_PRODUCTfrom products.signals.backend.facade import api as signals_facadefrom products.signals.backend.scout_harness.serializers import SignalScoutConfigSerializer, SignalScoutCreateSerializer-from products.signals.backend.scout_harness.views import ScoutCanonicalTeamAccessPermission+from products.signals.backend.scout_harness.views import ScoutCanonicalTeamAccessPermission, scout_config_contextclass ScannerScoutCreateSerializer(SignalScoutCreateSerializer):@@ -108,6 +108,12 @@ class ScannerScoutViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):source_id=str(scanner.id),)return Response(- ScannerScoutCreateResponseSerializer({"created": result.created, "config": result.config}).data,+ ScannerScoutCreateResponseSerializer(+ {"created": result.created, "config": result.config},+ # The config serializer reads the scout's skill for its description, origin, and+ # owners; without this the response would describe the scout it just created as+ # nameless, custom, and unowned.+ context=scout_config_context(canonical_team, [result.config.skill_name], request),+ ).data,status=status.HTTP_201_CREATED if result.created else status.HTTP_200_OK,)diff --git a/products/replay_vision/frontend/generated/api.schemas.ts b/products/replay_vision/frontend/generated/api.schemas.tsindex ecb13ff63d8c..d1cc84b007fb 100644--- a/products/replay_vision/frontend/generated/api.schemas.ts+++ b/products/replay_vision/frontend/generated/api.schemas.ts@@ -2258,6 +2258,8 @@ export interface SignalScoutConfigApi {readonly description: string/** Where this scout came from: `canonical` for a scout PostHog ships and maintains (seeded from `products/signals/skills/`), or `custom` for one a team hand-authored on this project. Use it to badge built-in vs custom scouts instead of a hardcoded name list. Defaults to `custom` if the skill is not currently present on the team. */readonly scout_origin: ScoutOriginEnumApi+ /** Who answers for this scout, seed-creator first. Ownership is recorded on the scout's skill rather than on this config, so editing the skill or toggling the scout leaves it unchanged. Reports the scout files suggest these people as reviewers. Prefer this over `created_by`-style fields, which only say who last flipped a switch. Empty when nobody owns the scout, when the owners are no longer members with access to the project, or when the caller is a scout sandbox token: owners are member PII, and a scout reads them through the skill API instead. */+ readonly owners: readonly UserBasicApi[]/** Whether this scout runs on its schedule. Disabled scouts are skipped by the coordinator. Derived from `status`: true for `active` and `pending_pause`, false for the paused statuses. */readonly enabled: boolean/** Lifecycle status. `active`: runs on its schedule. `pending_pause`: still running, but flagged by the system to pause soon unless something changes (any config edit clears it). `paused_by_system`: paused automatically, see `pause_reason`; set `enabled=true` to resume. `paused_by_user`: switched off by a person and never resumed automatically.diff --git a/products/signals/backend/scout_harness/serializers.py b/products/signals/backend/scout_harness/serializers.pyindex 7e7c8bccafd3..18621a4b9a34 100644--- a/products/signals/backend/scout_harness/serializers.py+++ b/products/signals/backend/scout_harness/serializers.py@@ -23,6 +23,7 @@ from drf_spectacular.utils import extend_schema_fieldfrom rest_framework import serializersfrom rest_framework.exceptions import PermissionDenied+from posthog.api.shared import UserBasicSerializerfrom posthog.event_usage import groupsfrom posthog.models.integration import Integrationfrom posthog.models.team.team import Team@@ -2288,6 +2289,17 @@ class SignalScoutConfigSerializer(serializers.ModelSerializer):"name list. Defaults to `custom` if the skill is not currently present on the team."),)+ owners = serializers.SerializerMethodField(+ help_text=(+ "Who answers for this scout, seed-creator first. Ownership is recorded on the scout's "+ "skill rather than on this config, so editing the skill or toggling the scout leaves it "+ "unchanged. Reports the scout files suggest these people as reviewers. Prefer this over "+ "`created_by`-style fields, which only say who last flipped a switch. Empty when nobody "+ "owns the scout, when the owners are no longer members with access to the project, or "+ "when the caller is a scout sandbox token: owners are member PII, and a scout reads "+ "them through the skill API instead."+ ),+ )enabled = serializers.BooleanField(read_only=True,help_text=(@@ -2430,6 +2442,15 @@ class SignalScoutConfigSerializer(serializers.ModelSerializer):info = (self.context.get("skill_info") or {}).get(obj.skill_name)return info.origin if info else "custom"+ @extend_schema_field(UserBasicSerializer(many=True))+ def get_owners(self, obj: SignalScoutConfig) -> list[dict[str, Any]]:+ # A scout joins to its skill by name, which is also the key `LLMSkillOwner` uses, so the+ # view resolves the whole fleet's owners in one query and passes the map through context+ # (see `scout_config_context`). Empty when a caller builds the serializer without it —+ # owners are then unknown, not absent, and no caller renders them on that path.+ owners = (self.context.get("owners_by_skill_name") or {}).get(obj.skill_name, [])+ return list(UserBasicSerializer(owners, many=True).data)+class Meta:model = SignalScoutConfigfields = [@@ -2437,6 +2458,7 @@ class SignalScoutConfigSerializer(serializers.ModelSerializer):"skill_name","description","scout_origin",+ "owners","enabled","status","pause_reason",diff --git a/products/signals/backend/scout_harness/views.py b/products/signals/backend/scout_harness/views.pyindex e0dd33ecb9bb..256f2754a593 100644--- a/products/signals/backend/scout_harness/views.py+++ b/products/signals/backend/scout_harness/views.py@@ -171,7 +171,11 @@ from products.signals.backend.scout_harness.tools.structured_output import (record_structured_output_sync,)from products.signals.backend.scout_report import InvalidScoutReportError-from products.skills.backend.api.skill_services import LLMSkillDuplicateNameConflictError, create_skill+from products.skills.backend.api.skill_services import (+ LLMSkillDuplicateNameConflictError,+ create_skill,+ resolve_skill_owners_for_names,+)from products.skills.backend.models.skills import LLMSkill, LLMSkillFilefrom products.tasks.backend.facade import api as tasks_facade@@ -1918,6 +1922,39 @@ def _skill_info_for(team_id: int, skill_names: list[str]) -> dict[str, _ScoutSki}+def _canonical_team(view: TeamAndOrgViewSetMixin) -> Team:+ """The team scout rows belong to — see `_canonical_team_id` for why a child environment+ resolves to its parent. Costs a query only on a child-environment request."""+ team_id = _canonical_team_id(view)+ return view.team if view.team.id == team_id else Team.objects.get(id=team_id)+++def scout_config_context(team: Team, skill_names: list[str], request: Request) -> dict[str, Any]:+ """Serializer context for `SignalScoutConfigSerializer`: skill metadata plus skill owners.++ Both maps are keyed on `skill_name` and resolved for the whole set at once, so listing the+ fleet stays a fixed number of queries instead of one per scout. They are built together+ because the serializer reads both, and a caller that passed only one would quietly serialize+ every scout as unowned.+ """+ # Owner identities are member PII. The sandbox token carries `signal_scout:read`, so without+ # this gate a scout run could list the owners of every custom scout on the team through+ # `scout-config-list`. The skill API only hands a sandbox caller the owners of a skill that+ # opted into the report channel (`LLMSkillSerializer.get_owners`); a scout that needs owners+ # reads them there, and this field stays for the human UI.+ if _caller_carries_scout_internal_scope(request):+ owners_by_skill_name: dict[str, list[User]] = {}+ else:+ owners_by_skill_name = resolve_skill_owners_for_names(team, skill_names)+ return {+ "skill_info": _skill_info_for(team.id, skill_names),+ # Owners are recorded on the scout's skill (`LLMSkillOwner`, keyed on the same+ # `skill_name`), so they hold across edits to the skill body. `created_by` / `enabled_by`+ # on the config row say who last flipped a switch, which is a different question.+ "owners_by_skill_name": owners_by_skill_name,+ }++class SignalScoutViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):"""Create a runnable custom scout and its config through one atomic API call."""@@ -1985,7 +2022,7 @@ class SignalScoutViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):)response = SignalScoutCreateResponseSerializer({"created": outcome.created, "skill": outcome.skill, "config": outcome.config},- context={"skill_info": _skill_info_for(canonical_team.id, [validated["name"]])},+ context=scout_config_context(canonical_team, [validated["name"]], request),)return Response(response.data,@@ -2066,7 +2103,8 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):operation_id="signals_scout_config_list",)def list(self, request: Request, *args, **kwargs) -> Response:- team_id = _canonical_team_id(self)+ team = _canonical_team(self)+ team_id = team.id# Don't surface held-back scouts here either — keeps the config read surface consistent# with the sync response and the seeding gate, so a withheld scout stays invisible to a# held-back team across the whole config API. Storage is untouched; the row reappears if@@ -2080,8 +2118,8 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):if tags:queryset = queryset.filter(tags__overlap=tags)configs = list(queryset.order_by("skill_name"))- skill_info = _skill_info_for(team_id, [c.skill_name for c in configs])- serializer = SignalScoutConfigSerializer(configs, many=True, context={"skill_info": skill_info})+ context = scout_config_context(team, [c.skill_name for c in configs], request)+ serializer = SignalScoutConfigSerializer(configs, many=True, context=context)return Response(serializer.data)@extend_schema(@@ -2111,7 +2149,8 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):operation_id="signals_scout_config_create",)def create(self, request: Request, *args, **kwargs) -> Response:- team_id = _canonical_team_id(self)+ team = _canonical_team(self)+ team_id = team.idif self._sets_structured_output_schema(request):self._assert_can_author_structured_output_schema()serializer = SignalScoutConfigCreateSerializer(@@ -2135,9 +2174,9 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):request=request,serializer_context={**self.get_serializer_context(), "project_id": self.team.project_id},)- skill_info = _skill_info_for(team_id, [config.skill_name])+ context = scout_config_context(team, [config.skill_name], request)return Response(- SignalScoutConfigSerializer(config, context={"skill_info": skill_info}).data,+ SignalScoutConfigSerializer(config, context=context).data,status=status.HTTP_201_CREATED if created else status.HTTP_200_OK,)@@ -2161,7 +2200,8 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):operation_id="signals_scout_config_update",)def partial_update(self, request: Request, *args, **kwargs) -> Response:- team_id = _canonical_team_id(self)+ team = _canonical_team(self)+ team_id = team.idif self._sets_structured_output_schema(request):self._assert_can_author_structured_output_schema()config_id = _parse_run_id_or_404(kwargs)@@ -2183,8 +2223,8 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):if enabling:save_kwargs["enabled_by"] = request.userinstance = serializer.save(**save_kwargs)- skill_info = _skill_info_for(team_id, [instance.skill_name])- return Response(SignalScoutConfigSerializer(instance, context={"skill_info": skill_info}).data)+ context = scout_config_context(team, [instance.skill_name], request)+ return Response(SignalScoutConfigSerializer(instance, context=context).data)@extend_schema(request=None,@@ -2375,5 +2415,5 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):.exclude(skill_name__in=withheld).order_by("skill_name"))- skill_info = _skill_info_for(team.id, [c.skill_name for c in configs])- return Response(SignalScoutConfigSerializer(configs, many=True, context={"skill_info": skill_info}).data)+ context = scout_config_context(team, [c.skill_name for c in configs], request)+ return Response(SignalScoutConfigSerializer(configs, many=True, context=context).data)diff --git a/products/signals/backend/test/test_scout_harness_api.py b/products/signals/backend/test/test_scout_harness_api.pyindex 0d438e4c2d2c..70b61acea14c 100644--- a/products/signals/backend/test/test_scout_harness_api.py+++ b/products/signals/backend/test/test_scout_harness_api.py@@ -48,7 +48,7 @@ from products.signals.backend.scout_harness.team_limits import MAX_RUNS_PER_TEAMfrom products.signals.backend.scout_harness.tools import structured_output as structured_output_toolfrom products.signals.backend.scout_harness.tools.profile import compute_project_profilefrom products.signals.backend.temporal.signal_queries import fetch_report_ids_for_source_ids-from products.skills.backend.models.skills import LLMSkill+from products.skills.backend.models.skills import LLMSkill, LLMSkillOwnerif TYPE_CHECKING:from products.tasks.backend.models import TaskRun@@ -1893,6 +1893,64 @@ class TestScoutHarnessConfigAPI(APIBaseTest):assert response.status_code == status.HTTP_200_OKassert response.json()[0]["scout_origin"] == expected_origin+ @parameterized.expand(["list", "partial_update", "sync"])+ def test_config_responses_carry_the_skills_owners(self, action: str) -> None:+ # Every response path builds the serializer's context by hand, and one that forgets the+ # owners map reports the whole fleet as unowned instead of failing.+ config = SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-checkout", enabled=False)+ self._make_skill("signals-scout-checkout")+ owner = User.objects.create_and_join(self.organization, "[email protected]", None, first_name="Ada")+ LLMSkillOwner.objects.for_team(self.team.id).create(+ team=self.team, skill_name="signals-scout-checkout", user=owner+ )++ if action == "list":+ response = self.client.get(self._list_url())+ elif action == "sync":+ response = self.client.post(self._sync_url())+ else:+ response = self.client.patch(self._detail_url(str(config.id)), data={"enabled": True}, format="json")++ assert response.status_code == status.HTTP_200_OK+ body = response.json()+ rows = body if isinstance(body, list) else [body]+ serialized = next(row for row in rows if row["skill_name"] == "signals-scout-checkout")+ assert [o["email"] for o in serialized["owners"]] == ["[email protected]"]++ def test_list_reports_no_owners_when_an_owner_lost_project_access(self) -> None:+ # An owner row outlives the member losing access, and the scout page turns owners into+ # "who to talk to" — pointing at someone who can't even open the project is worse than+ # saying nobody owns it.+ SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-checkout")+ self._make_skill("signals-scout-checkout")+ outsider = User.objects.create_user("[email protected]", None, first_name="Bo")+ LLMSkillOwner.objects.for_team(self.team.id).create(+ team=self.team, skill_name="signals-scout-checkout", user=outsider+ )++ response = self.client.get(self._list_url())++ assert response.status_code == status.HTTP_200_OK+ assert response.json()[0]["owners"] == []++ def test_list_hides_owners_from_a_scout_sandbox_token(self) -> None:+ # The sandbox token carries `signal_scout:read`, so this is the one config path a scout run+ # can reach. Owners are member PII that the skill API withholds from a sandbox caller unless+ # the skill opted into the report channel, and a config list that ignored that would+ # hand every custom scout's owners to any run.+ SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-checkout")+ self._make_skill("signals-scout-checkout")+ owner = User.objects.create_and_join(self.organization, "[email protected]", None, first_name="Ada")+ LLMSkillOwner.objects.for_team(self.team.id).create(+ team=self.team, skill_name="signals-scout-checkout", user=owner+ )+ _authenticate_as_scout(self)++ response = self.client.get(self._list_url())++ assert response.status_code == status.HTTP_200_OK+ assert response.json()[0]["owners"] == []+def test_list_origin_defaults_to_custom_when_skill_absent(self) -> None:# A config with no live skill row isn't a canonical scout.SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-errors")diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.tsindex 70ec51c32a24..076382746f62 100644--- a/products/signals/frontend/generated/api.schemas.ts+++ b/products/signals/frontend/generated/api.schemas.ts@@ -1969,6 +1969,63 @@ export const ScoutOriginEnumApi = {Custom: 'custom',} as const+/**+ * * `engineering` - Engineering+ * * `data` - Data+ * * `product` - Product Management+ * * `founder` - Founder+ * * `leadership` - Leadership+ * * `marketing` - Marketing+ * * `sales` - Sales / Success+ * * `student` - Student+ * * `other` - Other+ */+export type RoleAtOrganizationEnumApi = (typeof RoleAtOrganizationEnumApi)[keyof typeof RoleAtOrganizationEnumApi]++export const RoleAtOrganizationEnumApi = {+ Engineering: 'engineering',+ Data: 'data',+ Product: 'product',+ Founder: 'founder',+ Leadership: 'leadership',+ Marketing: 'marketing',+ Sales: 'sales',+ Student: 'student',+ Other: 'other',+} as const++export type BlankEnumApi = (typeof BlankEnumApi)[keyof typeof BlankEnumApi]++export const BlankEnumApi = {+ '': '',+} as const++/**+ * @nullable+ */+export type UserBasicApiHedgehogConfig = { [key: string]: unknown } | null++export interface UserBasicApi {+ readonly id: number+ readonly uuid: string+ /**+ * @maxLength 200+ * @nullable+ */+ distinct_id?: string | null+ /** @maxLength 150 */+ first_name?: string+ /** @maxLength 150 */+ last_name?: string+ /** @maxLength 254 */+ email: string+ /** @nullable */+ is_email_verified?: boolean | null+ /** @nullable */+ readonly hedgehog_config: UserBasicApiHedgehogConfig+ role_at_organization?: RoleAtOrganizationEnumApi | BlankEnumApi | null+}+/*** * `active` - Active* * `pending_pause` - Pending pause@@ -2018,6 +2075,8 @@ export interface SignalScoutConfigApi {readonly description: string/** Where this scout came from: `canonical` for a scout PostHog ships and maintains (seeded from `products/signals/skills/`), or `custom` for one a team hand-authored on this project. Use it to badge built-in vs custom scouts instead of a hardcoded name list. Defaults to `custom` if the skill is not currently present on the team. */readonly scout_origin: ScoutOriginEnumApi+ /** Who answers for this scout, seed-creator first. Ownership is recorded on the scout's skill rather than on this config, so editing the skill or toggling the scout leaves it unchanged. Reports the scout files suggest these people as reviewers. Prefer this over `created_by`-style fields, which only say who last flipped a switch. Empty when nobody owns the scout, when the owners are no longer members with access to the project, or when the caller is a scout sandbox token: owners are member PII, and a scout reads them through the skill API instead. */+ readonly owners: readonly UserBasicApi[]/** Whether this scout runs on its schedule. Disabled scouts are skipped by the coordinator. Derived from `status`: true for `active` and `pending_pause`, false for the paused statuses. */readonly enabled: boolean/** Lifecycle status. `active`: runs on its schedule. `pending_pause`: still running, but flagged by the system to pause soon unless something changes (any config edit clears it). `paused_by_system`: paused automatically, see `pause_reason`; set `enabled=true` to resume. `paused_by_user`: switched off by a person and never resumed automatically.@@ -4005,12 +4064,6 @@ export interface PatchedSignalSourceConfigApi {readonly status?: string | null}-export type BlankEnumApi = (typeof BlankEnumApi)[keyof typeof BlankEnumApi]--export const BlankEnumApi = {- '': '',-} as const-export interface SignalUserAutonomyConfigApi {readonly id: stringreadonly user: _UserApidiff --git a/products/signals/frontend/inbox/__mocks__/scoutConfigs.ts b/products/signals/frontend/inbox/__mocks__/scoutConfigs.tsindex 095ba9202c82..17af5c27ed08 100644--- a/products/signals/frontend/inbox/__mocks__/scoutConfigs.ts+++ b/products/signals/frontend/inbox/__mocks__/scoutConfigs.ts@@ -1,11 +1,36 @@-import type { SignalScoutConfigApi, SignalScoutRunSummaryApi } from 'products/signals/frontend/generated/api.schemas'+import type {+ SignalScoutConfigApi,+ SignalScoutRunSummaryApi,+ UserBasicApi,+} from 'products/signals/frontend/generated/api.schemas'type MockScoutOverrides = Pick<SignalScoutConfigApi, 'id' | 'skill_name' | 'description'> &Partial<Omit<SignalScoutConfigApi, 'id' | 'skill_name' | 'description'>>+function makeMockOwner(id: number, firstName: string, lastName: string): UserBasicApi {+ return {+ id,+ uuid: `0000000${id}-0000-0000-0000-000000000000`,+ distinct_id: `owner-${id}`,+ first_name: firstName,+ last_name: lastName,+ email: `${firstName.toLowerCase()}@example.com`,+ is_email_verified: true,+ hedgehog_config: null,+ }+}++const MOCK_SCOUT_OWNERS = [+ makeMockOwner(1, 'Ada', 'Ellis'),+ makeMockOwner(2, 'Bo', 'Nakamura'),+ makeMockOwner(3, 'Cleo', 'Farah'),+ makeMockOwner(4, 'Devi', 'Osei'),+]+function makeMockScout(overrides: MockScoutOverrides): SignalScoutConfigApi {return {scout_origin: 'canonical',+ owners: [],enabled: true,status: 'active',pause_reason: null,@@ -92,6 +117,7 @@ export const mockLargeScoutFleet: SignalScoutConfigApi[] = [skill_name: 'signals-scout-checkout-health',description: 'checkout failures and unusual drops in completed purchases',scout_origin: 'custom',+ owners: [MOCK_SCOUT_OWNERS[0]],run_interval_minutes: 30,last_run_at: '2026-06-10T23:50:00Z',tags: ['checkout', 'revenue'],@@ -114,6 +140,7 @@ export const mockLargeScoutFleet: SignalScoutConfigApi[] = [skill_name: 'signals-scout-enterprise-adoption',description: 'changes in feature adoption across enterprise accounts',scout_origin: 'custom',+ owners: MOCK_SCOUT_OWNERS,run_cron_schedule: '30 8 * * 1',tags: ['adoption'],}),diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsxindex d0c57cae9816..79a8980e4524 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsx@@ -14,6 +14,7 @@ const config: SignalScoutConfigApi = {skill_name: 'signals-scout-general',description: 'General scout',scout_origin: 'canonical',+ owners: [],enabled: true,status: 'active',pause_reason: null,diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsxindex 7554c26373d2..ba83caca502d 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsx@@ -17,6 +17,7 @@ import { ScoutStatusTag } from './ScoutBadges'import { ScoutEnabledSwitch } from './ScoutConfigControls'import { ScoutNextRunLabel } from './ScoutNextRunLabel'import { LeaveScoutNoteButton } from './ScoutNotesPanel'+import { ScoutOwners } from './ScoutOwners'import { ScoutSettingsButton } from './ScoutSettingsModal'function Metric({ value, label }: { value: React.ReactNode; label: string }): JSX.Element {@@ -105,6 +106,7 @@ export function ScoutDetailHeader({{config.scout_origin === 'canonical' ? 'Canonical' : 'Custom'}</LemonTag><ScoutStatusTag config={config} />+ <ScoutOwners config={config} /><span className="flex-1" /><Tooltip title="Dispatch a run now, outside the schedule. Counts against the project's daily run budget."><LemonButtondiff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutOwners.stories.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutOwners.stories.tsxnew file mode 100644index 000000000000..598f6792a404--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutOwners.stories.tsx@@ -0,0 +1,44 @@+import type { Meta, StoryObj } from '@storybook/react'++import type { SignalScoutConfigApi } from 'products/signals/frontend/generated/api.schemas'++import { mockLargeScoutFleet } from '../../../__mocks__/scoutConfigs'+import { ScoutOwners } from './ScoutOwners'++// The four states the scout page's identity line can be in. A canonical scout renders nothing,+// which is the row that should stay blank.++function scout(id: string): SignalScoutConfigApi {+ const config = mockLargeScoutFleet.find((candidate) => candidate.id === id)+ if (!config) {+ throw new Error(`No mock scout with id ${id}`)+ }+ return config+}++const meta: Meta<typeof ScoutOwners> = {+ title: 'Scenes-App/Inbox/ScoutOwners',+ component: ScoutOwners,+ parameters: { layout: 'padded', viewMode: 'story', mockDate: '2026-06-11' },+}+export default meta++type Story = StoryObj<typeof ScoutOwners>++export const States: Story = {+ render: () => (+ <div className="flex flex-col gap-3">+ {[+ ['One owner', scout('scout-checkout-health')],+ ['Several owners', scout('scout-enterprise-adoption')],+ ['Unowned', scout('scout-api-latency')],+ ['Canonical scout', scout('scout-error-tracking')],+ ].map(([label, config]) => (+ <div key={label as string} className="flex items-center gap-3">+ <span className="w-36 text-xs text-muted">{label as string}</span>+ <ScoutOwners config={config as SignalScoutConfigApi} />+ </div>+ ))}+ </div>+ ),+}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutOwners.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutOwners.tsxnew file mode 100644index 000000000000..f167546adc20--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutOwners.tsx@@ -0,0 +1,42 @@+import { Tooltip } from '@posthog/lemon-ui'++import { ProfileBubbles } from 'lib/lemon-ui/ProfilePicture/ProfileBubbles'++import type { SignalScoutConfigApi as SignalScoutConfig } from 'products/signals/frontend/generated/api.schemas'++import { scoutOwnerBubbles, scoutOwnersLabel, showsScoutOwnership } from '../../../utils/scoutOwners'++const OWNERSHIP_EXPLAINER =+ "Owners are set on the scout's skill, so editing or pausing the scout does not change them. Reports this scout files suggest them as reviewers."++/**+ * Who to talk to when a custom scout turns noisy or wrong, on its page. A canonical scout is+ * PostHog's to maintain, so it says nothing.+ */+export function ScoutOwners({ config }: { config: SignalScoutConfig }): JSX.Element | null {+ if (!showsScoutOwnership(config)) {+ return null+ }++ // Empty rather than undefined while an older API pod, mid-rollout, still omits the field.+ const owners = config.owners ?? []+ if (owners.length === 0) {+ // Named rather than left blank: an unowned scout still files into a shared inbox, and the+ // gap is the thing a reader needs to see.+ return (+ <Tooltip title={`Nobody owns this scout. ${OWNERSHIP_EXPLAINER}`}>+ <span className="text-xs text-muted">No owner</span>+ </Tooltip>+ )+ }++ const people = scoutOwnerBubbles(owners)+ return (+ <Tooltip title={`${people.map((person) => person.title).join(', ')}. ${OWNERSHIP_EXPLAINER}`}>+ <span className="flex items-center gap-1.5">+ <ProfileBubbles limit={4} people={people} />+ <span className="text-xs text-secondary">{scoutOwnersLabel(owners)}</span>+ </span>+ </Tooltip>+ )+}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutOwnersCell.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutOwnersCell.tsxnew file mode 100644index 000000000000..d7598f1acb72--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutOwnersCell.tsx@@ -0,0 +1,24 @@+import { ProfileBubbles } from 'lib/lemon-ui/ProfilePicture/ProfileBubbles'++import type { SignalScoutConfigApi as SignalScoutConfig } from 'products/signals/frontend/generated/api.schemas'++import { scoutOwnerBubbles, showsScoutOwnership } from '../../../utils/scoutOwners'++/**+ * The roster's owner column: faces only, so a whole fleet can be scanned for unowned scouts in one+ * pass. Names are on hover, and the scout page spells the ownership rule out in full.+ */+export function ScoutOwnersCell({ config }: { config: SignalScoutConfig }): JSX.Element | null {+ if (!showsScoutOwnership(config)) {+ return null+ }++ // Empty rather than undefined while an older API pod, mid-rollout, still omits the field.+ const owners = config.owners ?? []+ if (owners.length === 0) {+ return <span className="text-xs text-muted">No owner</span>+ }++ const people = scoutOwnerBubbles(owners)+ return <ProfileBubbles limit={3} people={people} tooltip={people.map((person) => person.title).join(', ')} />+}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutTags.stories.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutTags.stories.tsxindex feae227cfecc..f3af72b7d199 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutTags.stories.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutTags.stories.tsx@@ -15,6 +15,7 @@ const config: SignalScoutConfigApi = {skill_name: 'signals-scout-revenue-watch',description: 'Watches revenue changes.',scout_origin: 'custom',+ owners: [],enabled: true,status: 'active',pause_reason: null,diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutsRoster.stories.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutsRoster.stories.tsxindex acf235b6906b..86390ee26831 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutsRoster.stories.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutsRoster.stories.tsx@@ -77,8 +77,9 @@ export const RosterLegacy: Story = {render: () => <ScoutsRosterLegacy />,}-// Phone width with the flag off. Cadence and Next run drop out, and the table stops overflowing-// sideways, so the name, the status, the run strip, and the on/off toggle all stay on screen.+// Phone width with the flag off. Owners, Cadence, and Next run drop out, and the table stops+// overflowing sideways, so the name, the status, the run strip, and the on/off toggle all stay on+// screen.export const Narrow: Story = {parameters: {featureFlags: LEGACY_FLAGS,diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterTable.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterTable.tsxindex 41a6f309f26a..08f2810f380a 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterTable.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterTable.tsx@@ -14,9 +14,11 @@ import {scoutCadenceLabel,ScoutRosterRow,} from '../../../utils/scoutGroups'+import { showsScoutOwnership } from '../../../utils/scoutOwners'import { ScoutEnabledSwitch } from './ScoutConfigControls'import { ScoutNameCell } from './ScoutNameCell'import { ScoutNextRunLabel } from './ScoutNextRunLabel'+import { ScoutOwnersCell } from './ScoutOwnersCell'import { ScoutRunBoxes } from './ScoutRunBoxes'import { ScoutStatusDot } from './ScoutStatusDot'@@ -25,9 +27,12 @@ import { ScoutStatusDot } from './ScoutStatusDot'* than a section heading, so finding one by name is a single scan instead of a guess at which bucket* the scheduler put it in.*- * `compact` is the phone-width roster: Cadence and Next run drop out and their space goes to the- * name and the run strip. Both are schedule detail rather than state, and the scout page states+ * `compact` is the phone-width roster: Owners, Cadence, and Next run drop out and their space goes+ * to the name and the run strip. All three are detail rather than state, and the scout page states* them in full — at 375px they were 45px columns holding a truncated word each.+ *+ * Owners drops out at full width too when the fleet holds no custom scout, since ownership has+ * nothing to say about a canonical one.*/export function ScoutsRosterTable({ compact }: { compact: boolean }): JSX.Element {const { rosterScouts, rollups, updatingScoutIds, scoutRunsLoadedOnce } = useValues(scoutFleetLogic)@@ -37,6 +42,15 @@ export function ScoutsRosterTable({ compact }: { compact: boolean }): JSX.Elemenreturn <span className="px-6 py-6 text-sm text-muted">No scouts match the current filters.</span>}+ // Only a custom scout can carry an owner, so a fleet of canonical scouts would get a header over+ // a column of blanks. It keeps the exact column set and widths it had before owners existed.+ const showOwners = !compact && rosterScouts.some((row) => showsScoutOwnership(row.config))+ const width = compact+ ? { scout: '40%', status: '26%', cadence: '12%', nextRun: '12%', runs: '20%', enabled: '14%' }+ : showOwners+ ? { scout: '28%', status: '14%', cadence: '11%', nextRun: '11%', runs: '28%', enabled: '8%' }+ : { scout: '34%', status: '14%', cadence: '12%', nextRun: '12%', runs: '28%', enabled: '8%' }+return (<LemonTableembedded@@ -63,7 +77,7 @@ export function ScoutsRosterTable({ compact }: { compact: boolean }): JSX.Elemen{title: 'Scout',key: 'scout',- width: compact ? '40%' : '34%',+ width: width.scout,sorter: (a: ScoutRosterRow, b: ScoutRosterRow) => compareScoutsByName(a.config, b.config),render: (_, row: ScoutRosterRow) => (<ScoutNameCell@@ -76,7 +90,7 @@ export function ScoutsRosterTable({ compact }: { compact: boolean }): JSX.Elemen{title: 'Status',key: 'status',- width: compact ? '26%' : '14%',+ width: width.status,sorter: (a: ScoutRosterRow, b: ScoutRosterRow) =>SCOUT_GROUP_ORDER.indexOf(a.group) - SCOUT_GROUP_ORDER.indexOf(b.group),render: (_, row: ScoutRosterRow) => (@@ -86,10 +100,19 @@ export function ScoutsRosterTable({ compact }: { compact: boolean }): JSX.Elemen</span>),},+ {+ // Custom scouts only, so canonical rows stay blank and read as they did before.+ // Narrow on purpose: faces here, and the scout page names the owner in full.+ title: 'Owners',+ key: 'owners',+ width: '10%',+ isHidden: !showOwners,+ render: (_, row: ScoutRosterRow) => <ScoutOwnersCell config={row.config} />,+ },{title: 'Cadence',key: 'cadence',- width: '12%',+ width: width.cadence,isHidden: compact,render: (_, row: ScoutRosterRow) => (<span className="text-xs text-secondary">{scoutCadenceLabel(row.config)}</span>@@ -98,7 +121,7 @@ export function ScoutsRosterTable({ compact }: { compact: boolean }): JSX.Elemen{title: 'Next run',key: 'nextRun',- width: '12%',+ width: width.nextRun,isHidden: compact,render: (_, row: ScoutRosterRow) => (<span className="text-xs text-secondary tabular-nums">@@ -111,7 +134,7 @@ export function ScoutsRosterTable({ compact }: { compact: boolean }): JSX.Elemen// from its left — it would read as "ent runs".title: compact ? 'Runs' : 'Recent runs',key: 'runs',- width: compact ? '20%' : '28%',+ width: width.runs,// The strip is a timeline ending at "now", anchored right so every row's// newest run shares one vertical line; the header follows its content.align: 'right',@@ -132,7 +155,7 @@ export function ScoutsRosterTable({ compact }: { compact: boolean }): JSX.Elemen{title: '',key: 'enabled',- width: compact ? '14%' : '8%',+ width: width.enabled,render: (_, row: ScoutRosterRow) => (// Stop the row's navigation: flipping a scout off is not a request to// open it, and landing on its page afterwards hides the row you just changed.diff --git a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.tsindex 941efd0b1978..cd09635bd5c2 100644--- a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts+++ b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts@@ -34,6 +34,7 @@ const CREATED_SCOUT: SignalScoutCreateResponseApi = {skill_name: 'signals-scout-checkout-failures',description: 'Investigates recurring checkout failures.',scout_origin: 'custom',+ owners: [],enabled: false,status: 'paused_by_user',pause_reason: null,diff --git a/products/signals/frontend/inbox/logics/scoutFleetLogic.test.ts b/products/signals/frontend/inbox/logics/scoutFleetLogic.test.tsindex deddf54fd207..e2a0cd4d5d87 100644--- a/products/signals/frontend/inbox/logics/scoutFleetLogic.test.ts+++ b/products/signals/frontend/inbox/logics/scoutFleetLogic.test.ts@@ -47,6 +47,7 @@ const BASE_CONFIG: SignalScoutConfigApi = {skill_name: 'signals-scout-errors',description: 'Finds error trends.',scout_origin: 'canonical',+ owners: [],enabled: true,status: 'active',pause_reason: null,diff --git a/products/signals/frontend/inbox/utils/scoutOwners.test.ts b/products/signals/frontend/inbox/utils/scoutOwners.test.tsnew file mode 100644index 000000000000..4c39ec0de824--- /dev/null+++ b/products/signals/frontend/inbox/utils/scoutOwners.test.ts@@ -0,0 +1,44 @@+import type { UserBasicApi } from 'products/signals/frontend/generated/api.schemas'++import { scoutOwnerBubbles, scoutOwnersLabel, showsScoutOwnership } from './scoutOwners'++function owner(overrides: Partial<UserBasicApi> & Pick<UserBasicApi, 'email'>): UserBasicApi {+ return {+ id: 1,+ uuid: '00000000-0000-0000-0000-000000000000',+ first_name: '',+ last_name: '',+ hedgehog_config: null,+ ...overrides,+ }+}++describe('scoutOwners', () => {+ it.each([+ ['custom', true],+ ['canonical', false],+ ] as const)('shows ownership for a %s scout: %s', (scout_origin, expected) => {+ expect(showsScoutOwnership({ scout_origin })).toBe(expected)+ })++ it('labels a single owner by name and several by count', () => {+ const ada = owner({ email: '[email protected]', first_name: 'Ada', last_name: 'Ellis' })+ expect(scoutOwnersLabel([ada])).toBe('Ada Ellis')+ expect(scoutOwnersLabel([ada, owner({ email: '[email protected]' })])).toBe('2 owners')+ })++ it('falls back to the email for an owner who never set a name', () => {+ // Invited-but-unnamed members are common, and an avatar with a blank label names nobody.+ const nameless = owner({ email: '[email protected]' })+ expect(scoutOwnersLabel([nameless])).toBe('[email protected]')+ expect(scoutOwnerBubbles([nameless])).toEqual([+ ])+ })++ it('puts the email in the hover title next to a name', () => {+ expect(scoutOwnerBubbles([owner({ email: '[email protected]', first_name: 'Ada', last_name: 'Ellis' })])).toEqual(+ [{ email: '[email protected]', name: 'Ada Ellis', title: 'Ada Ellis ([email protected])' }]+ )+ })+})diff --git a/products/signals/frontend/inbox/utils/scoutOwners.ts b/products/signals/frontend/inbox/utils/scoutOwners.tsnew file mode 100644index 000000000000..c29daa977ff5--- /dev/null+++ b/products/signals/frontend/inbox/utils/scoutOwners.ts@@ -0,0 +1,30 @@+import { fullName } from 'lib/utils/strings'++import type { SignalScoutConfigApi, UserBasicApi } from 'products/signals/frontend/generated/api.schemas'++/**+ * Who answers for a scout, and where saying so is useful.+ *+ * Ownership is recorded on the scout's skill rather than its config, so editing or pausing the+ * scout leaves it unchanged. Canonical scouts are PostHog's to maintain, so an owner is only worth+ * showing (or missing) on a scout a team wrote itself.+ */+export function showsScoutOwnership(config: Pick<SignalScoutConfigApi, 'scout_origin'>): boolean {+ return config.scout_origin === 'custom'+}++export function scoutOwnerName(owner: UserBasicApi): string {+ return fullName(owner) || owner.email+}++/** `ProfileBubbles` people. The email rides in the per-avatar title so a hover names the person. */+export function scoutOwnerBubbles(owners: readonly UserBasicApi[]): { email: string; name: string; title: string }[] {+ return owners.map((owner) => {+ const name = scoutOwnerName(owner)+ return { email: owner.email, name, title: name === owner.email ? name : `${name} (${owner.email})` }+ })+}++export function scoutOwnersLabel(owners: readonly UserBasicApi[]): string {+ return owners.length === 1 ? scoutOwnerName(owners[0]) : `${owners.length} owners`+}diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex b7d5da753e2d..abe9e4a88fc7 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -75121,6 +75121,8 @@ export namespace Schemas {readonly description: string;/** Where this scout came from: `canonical` for a scout PostHog ships and maintains (seeded from `products/signals/skills/`), or `custom` for one a team hand-authored on this project. Use it to badge built-in vs custom scouts instead of a hardcoded name list. Defaults to `custom` if the skill is not currently present on the team. */readonly scout_origin: ScoutOriginEnum;+ /** Who answers for this scout, seed-creator first. Ownership is recorded on the scout's skill rather than on this config, so editing the skill or toggling the scout leaves it unchanged. Reports the scout files suggest these people as reviewers. Prefer this over `created_by`-style fields, which only say who last flipped a switch. Empty when nobody owns the scout, when the owners are no longer members with access to the project, or when the caller is a scout sandbox token: owners are member PII, and a scout reads them through the skill API instead. */+ readonly owners: readonly UserBasic[];/** Whether this scout runs on its schedule. Disabled scouts are skipped by the coordinator. Derived from `status`: true for `active` and `pending_pause`, false for the paused statuses. */readonly enabled: boolean;/** Lifecycle status. `active`: runs on its schedule. `pending_pause`: still running, but flagged by the system to pause soon unless something changes (any config edit clears it). `paused_by_system`: paused automatically, see `pause_reason`; set `enabled=true` to resume. `paused_by_user`: switched off by a person and never resumed automatically.