: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): add resumable onboarding api (#117776)
Georgiy Tarasov0f12146bc62d
diff --git a/docs/internal/activity-logging.md b/docs/internal/activity-logging.mdindex 3cc51a83093e..ab403aafdc25 100644--- a/docs/internal/activity-logging.md+++ b/docs/internal/activity-logging.md@@ -135,6 +135,7 @@ Never put a credential field in that branch.Destination activity logs record changes to `mappings` without their values.For `inputs` they keep each key and record only whether its value changed, so the history can name the changed input.Rows written before a field joined `field_with_masked_contents` still store its values.+Inbox onboarding records that setup changed while masking the saved draft, including scout instructions and project evidence.Code that returns a row's `detail` to a user must read `ActivityLog.safe_detail`, which masks those fields in old rows too.The activity log API, the advanced activity logs API and its exports, the notifications feed, and the PostHog AI context all do.The `system.activity_logs` SQL table and the search filter read the stored `detail`, so old rows need rewriting to stay masked there.diff --git a/posthog/egress/github/README.md b/posthog/egress/github/README.mdindex a7314e366063..584fe1944ea6 100644--- a/posthog/egress/github/README.md+++ b/posthog/egress/github/README.md@@ -31,6 +31,7 @@ Deferrable background callers construct their client on the `BATCH` lane (`GitHuA shed sweep stops for the cycle and resumes on the next scheduled run.A caller that walks pages, such as the warehouse source, paces with `github_installation_pace_seconds` instead of getting denied.The warehouse source's page fetches run on `BATCH`, while its repository validation and webhook management run on `NORMAL`, because a person waits on them. Customer Analytics feature-request link and resume lookups also run on `NORMAL` because an editor waits for the current issue state. Signals refreshes the stored pull request review decision from GitHub webhooks on `BATCH`; the inbox can keep the last known value when the lane is shed and update it after a retry.+Self-Driving onboarding probes one repository per installation on `NORMAL` during activation and on `BATCH` during background completion checks. Failed probes back off without exhausting the completion polling window.The ownership file reader (`posthog/ownership/`, source `ownership_github_api`) runs on `NORMAL` where a person waits for a board or a snapshot list, and on `BATCH` for the scheduled digests and report generation. Its GraphQL reads charge `core`, as every GraphQL call does, and so does the one compare call per new head commit that lets it reuse cached files.The repository cache behind repository selection (`posthog/models/integration_repository_cache.py`) runs on `BATCH` for Signals reports and on `NORMAL` when a person waits in Slack. It reads each repository's `pushed_at` from the installation's repository listing, refreshed when older than ten minutes, and calls GitHub only for repositories pushed since their last sync. A shed call waits for the limiter's pace and tries again.The branch picker serves its cached branch list at once. When the list is older than ten minutes, a background task lists the branches again on `BATCH`, waiting for the limiter's pace before each page. Only a repository with no cached list is listed inside the request.diff --git a/posthog/models/activity_logging/activity_log.py b/posthog/models/activity_logging/activity_log.pyindex cd162cbbd860..1d1047ef5cec 100644--- a/posthog/models/activity_logging/activity_log.py+++ b/posthog/models/activity_logging/activity_log.py@@ -367,6 +367,7 @@ common_field_exclusions = [field_with_masked_contents: dict[AuditableScope, list[str]] = {+ "SignalTeamConfig": ["onboarding"],"AccountView": ["name", "content", "text_content"],"WarehouseSuggestion": ["dismissal_note"],"HogFunction": [diff --git a/posthog/test/repo_invariants/test_pagination_contract.py b/posthog/test/repo_invariants/test_pagination_contract.pyindex 8e3afd5c0c95..71c14f087d39 100644--- a/posthog/test/repo_invariants/test_pagination_contract.py+++ b/posthog/test/repo_invariants/test_pagination_contract.py@@ -222,6 +222,8 @@ EXISTING_CUSTOM_LIST_VIEWSETS = {"products.review_hog.backend.presentation.views.validators.ReviewValidatorConfigViewSet",# Counts and hover details must use the same complete seven-day window."products.signals.backend.presentation.inbox_summary.InboxSummaryViewSet",+ # Returns one team's onboarding state as a single document, so there is nothing to paginate.+ "products.signals.backend.presentation.onboarding.InboxOnboardingViewSet","products.signals.backend.scout_harness.views.SignalScoutConfigViewSet","products.signals.backend.scout_harness.views.SignalScoutMembersViewSet","products.signals.backend.scout_harness.views.SignalScoutNoteViewSet",diff --git a/products/replay_vision/backend/facade/api.py b/products/replay_vision/backend/facade/api.pyindex 91e887b6d3f0..5270b42d4489 100644--- a/products/replay_vision/backend/facade/api.py+++ b/products/replay_vision/backend/facade/api.py@@ -343,3 +343,12 @@ def _workflow_owner(team: TeamModel, owner_id: int | None) -> User:):raise ObservationRequestRejected("The workflow has no owner who can run scans.", "forbidden")return owner+++def signal_emitting_scanner_ids(team_id: int, scanner_ids: list[str]) -> set[str]:+ return {+ str(scanner_id)+ for scanner_id in ReplayScanner.objects.filter(+ team_id=team_id, id__in=scanner_ids, enabled=True, emits_signals=True+ ).values_list("id", flat=True)+ }diff --git a/products/signals/backend/facade/onboarding.py b/products/signals/backend/facade/onboarding.pynew file mode 100644index 000000000000..39cc086a683e--- /dev/null+++ b/products/signals/backend/facade/onboarding.py@@ -0,0 +1,200 @@+from __future__ import annotations++from collections.abc import Callable, Sequence+from typing import TYPE_CHECKING, Any++from django.db import transaction+from django.utils import timezone++import posthoganalytics++from posthog.event_usage import groups+from posthog.models.team.extensions import get_or_create_team_extension+from posthog.models.team.team import Team+from posthog.models.user import User++from products.replay_vision.backend.facade.api import signal_emitting_scanner_ids+from products.signals.backend.models import (+ AutonomyPriority,+ SignalScoutConfig,+ SignalSourceConfig,+ SignalTeamConfig,+ signal_source_product_choices,+)+from products.signals.backend.onboarding_completion import InboxOnboardingReconciler+from products.signals.backend.onboarding_scouts import InboxOnboardingScouts+from products.signals.backend.scout_harness.create_access import can_create_scout+from products.signals.backend.scout_harness.team_limits import withheld_skills_for_team++if TYPE_CHECKING:+ from django.utils.functional import Promise+++class InboxOnboardingValidationError(ValueError):+ pass+++def onboarding_source_products() -> Sequence[tuple[str, str | Promise]]:+ return signal_source_product_choices()+++def onboarding_source_types() -> Sequence[tuple[str, str | Promise]]:+ return SignalSourceConfig.SourceType.choices+++def onboarding_priorities() -> Sequence[tuple[str, str | Promise]]:+ return AutonomyPriority.choices+++def can_create_onboarding_scout(user: User, team: Team) -> bool:+ return can_create_scout(user, team)+++class InboxOnboarding:+ def __init__(self, team: Team, user: User, authorize_scouts: Callable[[bool], None]) -> None:+ self.team = team+ self.team_id = team.id+ self.user = user+ self.authorize_scouts = authorize_scouts++ def _state(self, config: SignalTeamConfig) -> dict[str, Any]:+ state = config.onboarding or {}+ if any((state.get("draft") or {}).get(key) for key in ("suggestions", "activation_scouts")):+ self.authorize_scouts(False)+ return {"draft": state.get("draft"), "completed_at": state.get("completed_at"), "variant": state.get("variant")}++ def state(self) -> dict[str, Any]:+ return self._state(get_or_create_team_extension(self.team, SignalTeamConfig))++ def reconcile(self) -> dict[str, Any]:+ InboxOnboardingReconciler(self.team_id).run()+ return self.state()++ def expose(self, variant: str) -> dict[str, Any]:+ config = get_or_create_team_extension(self.team, SignalTeamConfig)+ with transaction.atomic():+ config = SignalTeamConfig.objects.select_for_update().get(pk=config.pk, team_id=self.team_id)+ state = config.onboarding or {}+ if not state.get("exposed_at"):+ config.onboarding = {+ **state,+ "variant": variant,+ "exposed_at": timezone.now().isoformat(),+ "exposed_by": self.user.pk,+ }+ config.save(update_fields=["onboarding", "updated_at"])+ transaction.on_commit(lambda: self._report_exposure(self.user, variant), robust=True)+ return self._state(config)++ def save_draft(self, draft: dict[str, Any]) -> dict[str, Any]:+ config = get_or_create_team_extension(self.team, SignalTeamConfig)+ with transaction.atomic():+ config = SignalTeamConfig.objects.select_for_update().get(team_id=self.team_id, pk=config.pk)+ state = config.onboarding or {}+ if any(+ draft.get(key) or (state.get("draft") or {}).get(key) for key in ("suggestions", "activation_scouts")+ ):+ self.authorize_scouts(True)+ if not state.get("completed_at"):+ config.onboarding = {**state, "draft": draft}+ config.save(update_fields=["onboarding", "updated_at"])+ return self._state(config)++ def complete(self, draft: dict[str, Any]) -> dict[str, Any]:+ config = get_or_create_team_extension(self.team, SignalTeamConfig)+ if (config.onboarding or {}).get("completed_at"):+ return self._state(config)++ if any(+ draft.get(key) or ((config.onboarding or {}).get("draft") or {}).get(key)+ for key in ("suggestions", "activation_scouts")+ ):+ self.authorize_scouts(True)+ if draft["suggestions"]:+ if not InboxOnboardingReconciler.scouts_can_emit(self.team.parent_team_id or self.team_id):+ raise InboxOnboardingValidationError(+ "Scout findings are disabled. Enable the scout source before activating."+ )++ if not InboxOnboardingReconciler(self.team_id).has_repository():+ raise InboxOnboardingValidationError("Connect GitHub with access to at least one repository.")++ selected_source = False+ for source in draft["sources"]:+ source_team_id = (+ self.team.parent_team_id or self.team_id+ if source["source_product"] == "signals_scout"+ else self.team_id+ )+ persisted = SignalSourceConfig.objects.filter(+ team_id=source_team_id,+ source_product=source["source_product"],+ source_type=source["source_type"],+ ).first()+ if (persisted is None and source["enabled"]) or (+ persisted is not None and persisted.enabled != source["enabled"]+ ):+ raise InboxOnboardingValidationError(+ "Some signal source choices have not been saved. Retry activation."+ )+ selected_source = selected_source or source["enabled"]+ scanner_ids = [str(scanner_id) for scanner_id in draft["scanner_ids"]]+ if set(scanner_ids) != signal_emitting_scanner_ids(self.team_id, scanner_ids):+ raise InboxOnboardingValidationError("Replay vision has not been enabled. Retry activation.")+ for suggestion in draft["suggestions"]:+ if (+ not SignalScoutConfig.objects.for_team(self.team.parent_team_id or self.team_id)+ .filter(skill_name=suggestion["skill_name"], enabled=True, emit=True)+ .exists()+ ):+ raise InboxOnboardingValidationError("Some selected scouts have not been enabled. Retry activation.")+ if not (selected_source or draft["scanner_ids"] or draft["suggestions"]):+ raise InboxOnboardingValidationError("Select at least one usable signal source or scout.")++ scout_team_id = self.team.parent_team_id or self.team_id+ resume_operational_scouts = (+ scout_team_id == self.team_id+ or bool(draft["suggestions"])+ or any(source["source_product"] == "signals_scout" for source in draft["sources"])+ )+ withheld = withheld_skills_for_team(scout_team_id) if resume_operational_scouts else set()+ user = self.user+ with transaction.atomic():+ config = SignalTeamConfig.objects.select_for_update().get(team_id=self.team_id, pk=config.pk)+ state = config.onboarding or {}+ if not state.get("completed_at"):+ config.autostart_enabled = draft["automatic_implementation"]+ config.default_autostart_priority = draft["implementation_priority"]+ config.onboarding = {+ **state,+ "draft": draft,+ "completed_at": timezone.now().isoformat(),+ "activated_by": user.pk,+ }+ config.save(+ update_fields=["onboarding", "autostart_enabled", "default_autostart_priority", "updated_at"]+ )+ if resume_operational_scouts:+ InboxOnboardingScouts.resume(scout_team_id, withheld, lambda: self.authorize_scouts(True))+ transaction.on_commit(lambda: self._report_completion(user, state.get("variant")), robust=True)+ return self._state(config)++ def _capture(self, user: User, event: str, variant: str | None) -> None:+ posthoganalytics.capture(+ distinct_id=str(user.distinct_id),+ event=event,+ groups=groups(team=self.team),+ properties={"project_id": self.team_id, "variant": variant, "flow_version": "ui-first-v1"},+ )++ def _report_completion(self, user: User, variant: str | None) -> None:+ self._capture(user, "self-driving onboarding completed", variant)++ def _report_exposure(self, user: User, variant: str) -> None:+ self._capture(user, "self-driving onboarding exposed", variant)+ if variant == "control":+ from products.signals.backend.tasks import (+ reconcile_inbox_onboarding, # noqa: PLC0415 - avoid task imports during API initialization+ )++ reconcile_inbox_onboarding.delay(self.team_id)diff --git a/products/signals/backend/migrations/0186_signalteamconfig_onboarding.py b/products/signals/backend/migrations/0186_signalteamconfig_onboarding.pynew file mode 100644index 000000000000..9329f636b702--- /dev/null+++ b/products/signals/backend/migrations/0186_signalteamconfig_onboarding.py@@ -0,0 +1,13 @@+from django.db import migrations, models+++class Migration(migrations.Migration):+ dependencies = [("signals", "0185_signalscoutconfig_last_precheck")]++ operations = [+ migrations.AddField(+ model_name="signalteamconfig",+ name="onboarding",+ field=models.JSONField(blank=True, null=True),+ ),+ ]diff --git a/products/signals/backend/migrations/max_migration.txt b/products/signals/backend/migrations/max_migration.txtindex e87f544ce1af..3cae2362d06e 100644--- a/products/signals/backend/migrations/max_migration.txt+++ b/products/signals/backend/migrations/max_migration.txt@@ -1 +1 @@-0185_signalscoutconfig_last_precheck+0186_signalteamconfig_onboardingdiff --git a/products/signals/backend/models.py b/products/signals/backend/models.pyindex b4f389286ddf..5e98ae513687 100644--- a/products/signals/backend/models.py+++ b/products/signals/backend/models.py@@ -197,6 +197,7 @@ class SignalTeamConfig(ModelActivityMixin, UUIDModel):# by default); only an explicit False disables it, leaving reports to still generate and notify# while the team reviews and opens PRs manually.autostart_enabled = models.BooleanField(null=True, blank=True)+ onboarding = models.JSONField(null=True, blank=True)default_autostart_priority = models.CharField(max_length=2, choices=AutonomyPriority, default=AutonomyPriority.P4)default_slack_notification_channel = models.CharField(max_length=255, null=True, blank=True)autostart_base_branches = models.JSONField(default=dict, blank=True)diff --git a/products/signals/backend/onboarding_completion.py b/products/signals/backend/onboarding_completion.pynew file mode 100644index 000000000000..063fff0ee1f3--- /dev/null+++ b/products/signals/backend/onboarding_completion.py@@ -0,0 +1,117 @@+from __future__ import annotations++from datetime import timedelta++from django.db import transaction+from django.utils import timezone+from django.utils.dateparse import parse_datetime++from requests import RequestException+from rest_framework.exceptions import APIException++from posthog.egress.github.transport import GitHubRateLimitError+from posthog.egress.limiter.policies import Priority+from posthog.egress.transport.transport import EgressBudgetExhausted+from posthog.event_usage import groups+from posthog.models.github_integration_base import GitHubIntegrationError+from posthog.models.integration import GitHubIntegration, Integration+from posthog.models.user import User+from posthog.ph_client import ph_scoped_capture++from products.replay_vision.backend.facade.api import has_signal_emitting_scanner+from products.signals.backend.models import SignalScoutConfig, SignalSourceConfig, SignalTeamConfig+++class RepositoryCheckUnavailable(APIException):+ status_code = 503+ default_detail = "Could not verify GitHub access. Please retry activation shortly."+ default_code = "repository_check_unavailable"++ def __init__(self, retry_after: int = 0) -> None:+ super().__init__()+ self.retry_after = retry_after+++class InboxOnboardingReconciler:+ def __init__(self, team_id: int, *, priority: Priority = Priority.NORMAL) -> None:+ self.team_id = team_id+ self.priority = priority++ @staticmethod+ def scouts_can_emit(team_id: int) -> bool:+ return SignalSourceConfig.is_source_enabled(+ team_id, SignalSourceConfig.SourceProduct.SIGNALS_SCOUT, SignalSourceConfig.SourceType.CROSS_SOURCE_ISSUE+ )++ def run(self) -> bool:+ """Verify control completion; return whether another check is needed."""+ config = (+ SignalTeamConfig.objects.select_related("team", "team__organization").filter(team_id=self.team_id).first()+ )+ if config is None:+ return False+ state = config.onboarding or {}+ exposed_at = parse_datetime(state.get("exposed_at", ""))+ if (+ state.get("variant") != "control"+ or state.get("completed_at")+ or state.get("draft") is not None+ or exposed_at is None+ or timezone.now() - exposed_at > timedelta(days=7)+ ):+ return False+ sources_enabled = (+ SignalSourceConfig.objects.filter(team_id=self.team_id, enabled=True)+ .exclude(source_product__in=["signals_scout", "session_replay"])+ .exists()+ )+ scout_team_id = config.team.parent_team_id or self.team_id+ scouts_enabled = self.scouts_can_emit(scout_team_id) and (+ SignalScoutConfig.objects.for_team(config.team.parent_team_id or self.team_id)+ .filter(enabled=True, emit=True)+ .exclude(managed_by="background")+ .exclude(auto_pause_exempt_by_role=True)+ .exists()+ )+ if not (sources_enabled or scouts_enabled or has_signal_emitting_scanner(self.team_id)):+ return True+ if not self.has_repository():+ return True+ with transaction.atomic():+ locked = SignalTeamConfig.objects.select_for_update().get(pk=config.pk, team_id=self.team_id)+ state = locked.onboarding or {}+ if state.get("draft") is not None:+ return False+ if not state.get("completed_at"):+ locked.onboarding = {**state, "completed_at": timezone.now().isoformat()}+ locked.save(update_fields=["onboarding", "updated_at"])+ transaction.on_commit(lambda: self._capture(config), robust=True)+ return False++ def has_repository(self) -> bool:+ failure: Exception | None = None+ retry_after = 0+ for integration in Integration.objects.filter(team_id=self.team_id, kind="github").order_by("id"):+ github = GitHubIntegration(integration, source="signals_onboarding", priority=self.priority)+ try:+ repositories, _ = github.list_repositories(per_page=1)+ except (GitHubIntegrationError, GitHubRateLimitError, EgressBudgetExhausted, RequestException) as error:+ failure = failure or error+ if isinstance(error, GitHubRateLimitError):+ retry_after = max(retry_after, error.retry_after or 0)+ continue+ if repositories:+ return True+ if failure is not None:+ raise RepositoryCheckUnavailable(retry_after=retry_after) from failure+ return False++ def _capture(self, config: SignalTeamConfig) -> None:+ user = User.objects.filter(pk=(config.onboarding or {}).get("exposed_by")).first()+ with ph_scoped_capture() as capture:+ capture(+ distinct_id=str(user.distinct_id if user else config.team.uuid),+ event="self-driving onboarding completed",+ groups=groups(team=config.team),+ properties={"project_id": self.team_id, "variant": "control", "flow_version": "ui-first-v1"},+ )diff --git a/products/signals/backend/onboarding_scouts.py b/products/signals/backend/onboarding_scouts.pynew file mode 100644index 000000000000..b926a0ff38b6--- /dev/null+++ b/products/signals/backend/onboarding_scouts.py@@ -0,0 +1,57 @@+from __future__ import annotations++from collections.abc import Callable++from django.db import transaction++from products.signals.backend.models import SignalScoutConfig, SignalTeamConfig+++class InboxOnboardingScouts:+ @staticmethod+ def record_pause(scout: SignalScoutConfig) -> None:+ assert scout.status_changed_at is not None+ with transaction.atomic():+ config, _ = SignalTeamConfig.objects.get_or_create(team_id=scout.team_id)+ config = SignalTeamConfig.objects.select_for_update().get(pk=config.pk, team_id=scout.team_id)+ state = config.onboarding or {}+ config.onboarding = {+ **state,+ "paused_operational_scouts": {+ **state.get("paused_operational_scouts", {}),+ str(scout.id): scout.status_changed_at.isoformat(),+ },+ }+ config.save(update_fields=["onboarding", "updated_at"])++ @staticmethod+ def resume(team_id: int, withheld_skill_names: set[str], authorize: Callable[[], None]) -> None:+ with transaction.atomic():+ config = SignalTeamConfig.objects.select_for_update().filter(team_id=team_id).first()+ if config is None:+ return+ state = config.onboarding or {}+ pauses = state.get("paused_operational_scouts", {})+ if not pauses:+ return+ candidates = (+ SignalScoutConfig.objects.for_team(team_id)+ .select_for_update()+ .filter(id__in=pauses, auto_pause_exempt_by_role=True, enabled=False)+ )+ scouts = [+ scout+ for scout in candidates+ if scout.status_changed_at and scout.status_changed_at.isoformat() == pauses[str(scout.id)]+ ]+ if scouts:+ authorize()+ for scout in scouts:+ if scout.skill_name in withheld_skill_names:+ scout.status_changed_at = None+ scout.save(update_fields=["status_changed_at", "updated_at"])+ else:+ scout.enabled = True+ scout.save(update_fields=["enabled", "updated_at"])+ config.onboarding = {key: value for key, value in state.items() if key != "paused_operational_scouts"}+ config.save(update_fields=["onboarding", "updated_at"])diff --git a/products/signals/backend/presentation/onboarding.py b/products/signals/backend/presentation/onboarding.pynew file mode 100644index 000000000000..ad61ff01da94--- /dev/null+++ b/products/signals/backend/presentation/onboarding.py@@ -0,0 +1,186 @@+from __future__ import annotations++from typing import Any, cast++from django.db import models++from drf_spectacular.utils import extend_schema, extend_schema_serializer+from rest_framework import serializers, viewsets+from rest_framework.decorators import action+from rest_framework.exceptions import PermissionDenied+from rest_framework.permissions import SAFE_METHODS, BasePermission, IsAuthenticated+from rest_framework.request import Request+from rest_framework.response import Response+from rest_framework.views import APIView++from posthog.api.routing import TeamAndOrgViewSetMixin+from posthog.auth import OAuthAccessTokenAuthentication, PersonalAPIKeyAuthentication, SessionAuthentication+from posthog.models.user import User+from posthog.oauth_provenance import is_sandbox_oauth_request+from posthog.permissions import APIScopePermission, get_authenticator_scopes++from products.access_control.backend.facade.user_access_control import UserAccessControl+from products.signals.backend.facade.onboarding import (+ InboxOnboarding,+ InboxOnboardingValidationError,+ can_create_onboarding_scout,+ onboarding_priorities,+ onboarding_source_products,+ onboarding_source_types,+)+from products.signals.backend.presentation.scout_permissions import ScoutCanonicalTeamAccessPermission+from products.signals.backend.presentation.scout_suggestion_serializers import ScoutSuggestionItemSerializer+++class InboxOnboardingStep(models.TextChoices):+ SIGNALS = "signals", "Signals"+ SCOUTS = "scouts", "Scouts"+ GITHUB = "github", "GitHub"+++class InboxOnboardingVariant(models.TextChoices):+ CONTROL = "control", "Control"+ TEST = "test", "Focused steps"+++class InboxOnboardingExposureSerializer(serializers.Serializer):+ variant = serializers.ChoiceField(+ choices=InboxOnboardingVariant.choices,+ help_text="Assigned experiment variant at the eligible Inbox impression.",+ )+++class InboxOnboardingSourceSerializer(serializers.Serializer):+ source_product = serializers.ChoiceField(+ choices=onboarding_source_products(), help_text="Source product selected during setup."+ )+ source_type = serializers.ChoiceField(+ choices=onboarding_source_types(), help_text="Signal type selected during setup."+ )+ enabled = serializers.BooleanField(help_text="Whether this source should be enabled at activation.")+++class InboxOnboardingDraftSerializer(serializers.Serializer):+ step = serializers.ChoiceField(choices=InboxOnboardingStep.choices, help_text="Step to resume after returning.")+ sources: serializers.ListSerializer[dict[str, object]] = serializers.ListSerializer(+ child=InboxOnboardingSourceSerializer(), max_length=50, help_text="Staged signal source choices."+ )+ scanner_ids = serializers.ListField(+ child=serializers.UUIDField(), max_length=100, help_text="Existing enabled scanners selected to emit signals."+ )+ suggestions: serializers.ListSerializer[dict[str, object]] = serializers.ListSerializer(+ child=ScoutSuggestionItemSerializer(), max_length=5, help_text="Selected scout suggestion drafts."+ )+ activation_scouts = serializers.ListField(+ child=serializers.CharField(max_length=200),+ max_length=50,+ required=False,+ help_text="Scouts enabled by an unfinished activation, retained to undo later deselections.",+ )+ automatic_implementation = serializers.BooleanField(help_text="Opt in to automatically creating pull requests.")+ implementation_priority = serializers.ChoiceField(+ choices=onboarding_priorities(),+ help_text="Lowest priority to implement automatically; P1 includes P0 and P1.",+ )++ def validate_suggestions(self, suggestions: list[dict[str, Any]]) -> list[dict[str, Any]]:+ if any(len(item["draft_body"]) > 100_000 for item in suggestions):+ raise serializers.ValidationError("A scout draft is too long.")+ return suggestions+++@extend_schema_serializer(many=False)+class InboxOnboardingStateSerializer(serializers.Serializer):+ draft = InboxOnboardingDraftSerializer(allow_null=True, help_text="Saved setup choices, without activating them.")+ completed_at = serializers.DateTimeField(allow_null=True, help_text="When verified setup completed.")+ variant = serializers.ChoiceField(+ choices=InboxOnboardingVariant.choices,+ allow_null=True,+ help_text="Variant recorded at the first eligible impression.",+ )+++class InboxOnboardingPermission(BasePermission):+ message = "Task agents cannot change onboarding settings."++ def has_permission(self, request: Request, view: APIView) -> bool:+ return request.method in SAFE_METHODS or not is_sandbox_oauth_request(request)+++class InboxOnboardingViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):+ authentication_classes = [SessionAuthentication, PersonalAPIKeyAuthentication, OAuthAccessTokenAuthentication]+ permission_classes = [IsAuthenticated, APIScopePermission, InboxOnboardingPermission]+ scope_object = "task"+ requires_resource_level_access = True+ serializer_class = InboxOnboardingStateSerializer+ pagination_class = None++ def dangerously_get_required_scopes(self, request: Request, view: object) -> list[str]:+ return ["task:read"] if request.method in ("GET", "HEAD", "OPTIONS") else ["task:write"]++ def _check_scout_access(self, request: Request) -> None:+ permission = ScoutCanonicalTeamAccessPermission()+ if not permission.has_permission(request, self):+ raise PermissionDenied(permission.message)++ def _check_suggestion_access(self, request: Request, *, write: bool = False) -> None:+ self._check_scout_access(request)+ scopes = get_authenticator_scopes(request.successful_authenticator)+ required = {"signal_scout:write", "llm_skill:write"} if write else {"signal_scout:read"}+ if scopes is not None and "*" not in scopes:+ allowed = set(scopes)+ if "signal_scout:write" in allowed:+ allowed.add("signal_scout:read")+ if not required.issubset(allowed):+ raise PermissionDenied("Your API key does not have permission to access these scout choices.")+ canonical_team = self.team.parent_team or self.team+ user = cast(User, request.user)+ access = UserAccessControl(user=user, team=canonical_team)+ if not access.check_access_level_for_resource("signal_scout", "editor" if write else "viewer"):+ raise PermissionDenied("You do not have access to these scout choices.")+ if write and not can_create_onboarding_scout(user, canonical_team):+ raise PermissionDenied("Saving scout choices requires editor access to skills.")++ def _service(self) -> InboxOnboarding:+ return InboxOnboarding(+ self.team,+ cast(User, self.request.user),+ lambda write: self._check_suggestion_access(self.request, write=write),+ )++ @extend_schema(request=InboxOnboardingExposureSerializer, responses=InboxOnboardingStateSerializer)+ @action(detail=False, methods=["POST"])+ def expose(self, request: Request, *args: object, **kwargs: object) -> Response:+ serializer = InboxOnboardingExposureSerializer(data=request.data)+ serializer.is_valid(raise_exception=True)+ if serializer.validated_data["variant"] == InboxOnboardingVariant.CONTROL:+ self._check_scout_access(request)+ return Response(self._service().expose(serializer.validated_data["variant"]))++ @extend_schema(request=None, responses=InboxOnboardingStateSerializer)+ @action(detail=False, methods=["POST"])+ def reconcile(self, request: Request, *args: object, **kwargs: object) -> Response:+ self._check_scout_access(request)+ return Response(self._service().reconcile())++ @extend_schema(responses=InboxOnboardingStateSerializer)+ def list(self, request: Request, *args: object, **kwargs: object) -> Response:+ return Response(self._service().state())++ @extend_schema(request=InboxOnboardingDraftSerializer, responses=InboxOnboardingStateSerializer)+ def create(self, request: Request, *args: object, **kwargs: object) -> Response:+ serializer = InboxOnboardingDraftSerializer(data=request.data)+ serializer.is_valid(raise_exception=True)+ return Response(self._service().save_draft(dict(serializer.data)))++ @extend_schema(request=InboxOnboardingDraftSerializer, responses=InboxOnboardingStateSerializer)+ @action(detail=False, methods=["POST"])+ def complete(self, request: Request, *args: object, **kwargs: object) -> Response:+ serializer = InboxOnboardingDraftSerializer(data=request.data)+ serializer.is_valid(raise_exception=True)+ if any(source["source_product"] == "signals_scout" for source in serializer.validated_data["sources"]):+ self._check_scout_access(request)+ try:+ return Response(self._service().complete(dict(serializer.data)))+ except InboxOnboardingValidationError as error:+ raise serializers.ValidationError(str(error)) from errordiff --git a/products/signals/backend/presentation/scout_permissions.py b/products/signals/backend/presentation/scout_permissions.pynew file mode 100644index 000000000000..a6375ad2c4db--- /dev/null+++ b/products/signals/backend/presentation/scout_permissions.py@@ -0,0 +1,34 @@+from typing import cast++from rest_framework.permissions import BasePermission+from rest_framework.request import Request+from rest_framework.views import APIView++from posthog.api.routing import TeamAndOrgViewSetMixin+from posthog.auth import OAuthAccessTokenAuthentication, PersonalAPIKeyAuthentication+++class ScoutCanonicalTeamAccessPermission(BasePermission):+ """Authorize requests against the project that owns the scout data."""++ message = "You don't have access to the project that owns this data."++ def has_permission(self, request: Request, view: APIView) -> bool:+ team_view = cast(TeamAndOrgViewSetMixin, view)+ if not request.user.is_authenticated:+ # Unreachable while `IsAuthenticated` runs ahead of this class, but deny rather than+ # allow, so this class can never be the reason an anonymous request gets through.+ return False+ team = team_view.team+ if team.parent_team_id is None or team.parent_team_id == team.id or team.parent_team is None:+ return True+ authenticator = request.successful_authenticator+ scoped_teams = None+ if isinstance(authenticator, OAuthAccessTokenAuthentication):+ scoped_teams = authenticator.access_token.scoped_teams+ elif isinstance(authenticator, PersonalAPIKeyAuthentication):+ scoped_teams = authenticator.personal_api_key.scoped_teams+ if scoped_teams and team.parent_team_id not in scoped_teams:+ return False+ level = team_view.user_permissions.team(team.parent_team).effective_membership_level+ return level is not Nonediff --git a/products/signals/backend/presentation/scout_suggestion_serializers.py b/products/signals/backend/presentation/scout_suggestion_serializers.pynew file mode 100644index 000000000000..a60ff6b52f41--- /dev/null+++ b/products/signals/backend/presentation/scout_suggestion_serializers.py@@ -0,0 +1,54 @@+from django.db import models++from rest_framework import serializers+++class ScoutOrigin(models.TextChoices):+ CANONICAL = "canonical", "canonical"+ CUSTOM = "custom", "custom"+++class ScoutSuggestionConfidence(models.TextChoices):+ LOW = "low", "low"+ MEDIUM = "medium", "medium"+ HIGH = "high", "high"+++class ScoutSuggestionProposedConfigSerializer(serializers.Serializer):+ run_cron_schedule = serializers.CharField(+ allow_null=True,+ required=False,+ help_text="Suggested five-field cron schedule in the project timezone, or null for an interval.",+ )+ run_interval_minutes = serializers.IntegerField(+ allow_null=True,+ required=False,+ help_text="Suggested minutes between runs when no cron is given; null means the daily default.",+ )+ emit = serializers.BooleanField(+ help_text="Whether the suggested scout should write to the inbox (false = dry run)."+ )+++class ScoutSuggestionItemSerializer(serializers.Serializer):+ id = serializers.CharField(help_text="Stable id of this suggestion within the batch; use it to dismiss.")+ kind = serializers.ChoiceField(+ choices=ScoutOrigin.choices,+ help_text="`canonical`: enable a PostHog-authored scout that exists but is off. `custom`: create a drafted scout.",+ )+ skill_name = serializers.CharField(+ help_text="The scout's `signals-scout-*` skill name (existing for canonical, proposed for custom)."+ )+ title = serializers.CharField(help_text="Short sentence-case title: what the scout watches.")+ why_here = serializers.CharField(help_text="Project-specific evidence for this suggestion, in prose.")+ description = serializers.CharField(+ allow_blank=True, help_text="Custom only: the one-line description the scout would be created with."+ )+ draft_body = serializers.CharField(+ allow_blank=True, help_text="Custom only: the complete skill body the scout would be created with."+ )+ proposed_config = ScoutSuggestionProposedConfigSerializer(help_text="Suggested schedule and emit posture.")+ gap = serializers.BooleanField(help_text="True when nothing in the current fleet covers this.")+ confidence = serializers.ChoiceField(+ choices=ScoutSuggestionConfidence.choices, help_text="The producer's confidence."+ )diff --git a/products/signals/backend/routes.py b/products/signals/backend/routes.pyindex cfbb0c87a8e9..910b2dfb7a2f 100644--- a/products/signals/backend/routes.py+++ b/products/signals/backend/routes.py@@ -2,6 +2,7 @@ from posthog.api.routing import RouterRegistryimport products.signals.backend.views as signalsfrom products.signals.backend.presentation.inbox_summary import InboxSummaryViewSet+from products.signals.backend.presentation.onboarding import InboxOnboardingViewSetfrom products.signals.backend.presentation.scout_rubrics import SignalScoutRubricViewSetfrom products.signals.backend.scout_chat import SignalScoutChatTaskViewSetfrom products.signals.backend.scout_harness.views import (@@ -19,6 +20,7 @@ from products.signals.backend.views import SignalViewSetdef register_routes(routers: RouterRegistry) -> None:+ routers.projects.register(r"signals/onboarding", InboxOnboardingViewSet, "project_signals_onboarding", ["team_id"])routers.projects.register(r"signals/inbox_summary", InboxSummaryViewSet, "project_signals_inbox_summary", ["team_id"])diff --git a/products/signals/backend/scout_chat.py b/products/signals/backend/scout_chat.pyindex 22b4f7174691..f7bcfcccebd8 100644--- a/products/signals/backend/scout_chat.py+++ b/products/signals/backend/scout_chat.py@@ -28,9 +28,9 @@ from posthog.permissions import APIScopePermissionfrom products.access_control.backend.facade.user_access_control import UserAccessControlfrom products.signals.backend.models import SignalScoutConfig+from products.signals.backend.presentation.scout_permissions import ScoutCanonicalTeamAccessPermissionfrom products.signals.backend.scout_harness.prompt import SCOUT_PROJECT_SCAN_GUIDANCEfrom products.signals.backend.scout_harness.suggestions import find_suggestion-from products.signals.backend.scout_harness.views import ScoutCanonicalTeamAccessPermissionfrom products.tasks.backend.facade import api as tasks_facadefrom products.tasks.backend.facade.access import usage_limit_responsediff --git a/products/signals/backend/scout_harness/config_registry.py b/products/signals/backend/scout_harness/config_registry.pyindex dc6c3b6b10dc..cc4c2b7b95e6 100644--- a/products/signals/backend/scout_harness/config_registry.py+++ b/products/signals/backend/scout_harness/config_registry.py@@ -31,6 +31,7 @@ from posthog.models.activity_logging.model_activity import ActivityTriggerContexfrom posthog.models.activity_logging.utils import SCOUT_CLIENT_PREFIXfrom products.signals.backend.models import SignalScoutConfig+from products.signals.backend.onboarding_scouts import InboxOnboardingScoutsfrom products.signals.backend.scout_harness.lazy_seed import (HARNESS_SEEDED_BY,SCOUT_SKILL_CATEGORY,@@ -207,12 +208,17 @@ def register_missing_configs(team_id: int,seed_config_layers: list[dict] | None = None,withheld_skill_names: frozenset[str] | set[str] | None = None,+ *,+ enable_new_configs: bool = True,) -> set[str]:"""Auto-create a config for each scout skill lacking a row, honouring an optional seed posture.Idempotent — `get_or_create` keyed on the `(team, skill_name)` unique constraint, soconcurrent callers (coordinator tick racing an API call) converge on one row.+ Onboarding passes `enable_new_configs=False` so browsing the catalog cannot start scouts.+ That also skips operational lifecycle reconciliation; existing choices remain unchanged.+Returns the union of the live `signals-scout-*` skills scanned here and every live skill thatalready holds a config, so the caller can dispatch a bare-named scout and still skip a configwhose skill is gone. The prefix scan drives auto-registration only; a bare-named scout is@@ -311,9 +317,12 @@ def register_missing_configs(in_allowlist = (not gated) or (enabled_skills is not None and name in enabled_skills)# The cap bounds what a team spends watching its own product, so an operational scout# seeds enabled past it. It still counts toward the cap, so its slot stays visible.- seed_enabled = in_allowlist and (operational or not at_cap)+ seed_enabled = enable_new_configs and in_allowlist and (operational or not at_cap)defaults: dict = {} if seed_enabled else {"enabled": False}+ if not enable_new_configs:+ # Reconciliation must distinguish onboarding opt-out from a resumable seed pause.+ defaults["status_changed_at"] = timezone.now()if operational:# The sweep reads the column, not the role, and writing memory hourly while filing a# report rarely is exactly the `no_output` shape it warns on.@@ -345,12 +354,15 @@ def register_missing_configs(# `team_id` must be passed as a kwarg: `get_or_create` builds the created row from# kwargs/defaults only — the queryset's team filter does not propagate into `create`.- _, created = configs.get_or_create(team_id=team_id, skill_name=name, defaults=defaults)+ with transaction.atomic():+ scout, created = configs.get_or_create(team_id=team_id, skill_name=name, defaults=defaults)+ if created and operational and not enable_new_configs:+ InboxOnboardingScouts.record_pause(scout)if not created:continueif seed_enabled:enabled += 1- elif in_allowlist and at_cap:+ elif enable_new_configs and in_allowlist and at_cap:logger.info("signals_scout: enabled-scout cap reached, auto-registered config disabled",team_id=team_id,@@ -361,9 +373,10 @@ def register_missing_configs(reconcile_canonical_display_names(team_id, canonical_names & skill_names)reconcile_canonical_structured_output_schemas(team_id, canonical_names & skill_names)- reconcile_operational_configs(- team_id, operational_names & skill_names, withheld_skill_names, max_enabled_scouts=max_enabled_scouts- )+ if enable_new_configs:+ reconcile_operational_configs(+ team_id, operational_names & skill_names, withheld_skill_names, max_enabled_scouts=max_enabled_scouts+ )# Keep the skills UI's Scouts tab in sync: stamp `category="scout"` on any scout skill rows# not yet categorized (custom scouts authored via the skills API). Runs every reconcile tick,diff --git a/products/signals/backend/scout_harness/fleet_sync.py b/products/signals/backend/scout_harness/fleet_sync.pyindex 9a99b533d417..7171c3ece3dc 100644--- a/products/signals/backend/scout_harness/fleet_sync.py+++ b/products/signals/backend/scout_harness/fleet_sync.py@@ -36,7 +36,7 @@ FLEET_SYNCED_EVENT = "signals_scout_fleet_synced"# Which surface asked for the materialization. The whole point of the `surface` dimension is to# separate a fleet the coordinator was going to deliver anyway from one a person's tab-open# rescued, so an unlabelled caller is recorded as unknown rather than folded into a real surface.-SYNC_SURFACES = ("roster", "desktop", "wizard")+SYNC_SURFACES = ("roster", "desktop", "wizard", "onboarding")UNKNOWN_SURFACE = "unknown"# A prune reaping more than half the canonical fleet, and at least this many scouts, is not a@@ -79,7 +79,9 @@ def materialize_scout_fleet(team: Team, *, surface: str | None = None) -> set[stseed_config_layers, withheld = resolve_sync_seed_inputs(team.id)configs_before = _config_skill_names(team.id)result = sync_canonical_skills(team, prune=True, withheld_skill_names=withheld)- register_missing_configs(team.id, seed_config_layers, withheld_skill_names=withheld)+ register_missing_configs(+ team.id, seed_config_layers, withheld_skill_names=withheld, enable_new_configs=surface != "onboarding"+ )configs_after = _config_skill_names(team.id)_capture_fleet_synced(team=team,diff --git a/products/signals/backend/scout_harness/serializers.py b/products/signals/backend/scout_harness/serializers.pyindex 279fb879e35e..302dcf19ac5a 100644--- a/products/signals/backend/scout_harness/serializers.py+++ b/products/signals/backend/scout_harness/serializers.py@@ -43,6 +43,7 @@ from products.signals.backend.artefact_schemas import (from products.signals.backend.background_pilot import OPT_OUT_DISABLED, capture_background_scout_opted_outfrom products.signals.backend.enums import ReportLinkKind, ToolPresetfrom products.signals.backend.models import SignalReportCheck, SignalScoutConfig, SignalScoutEmission+from products.signals.backend.presentation.scout_suggestion_serializers import ScoutOriginfrom products.signals.backend.report_charts import MAX_REPORT_CHARTSfrom products.signals.backend.report_metrics import MAX_REPORT_METRICSfrom products.signals.backend.report_prompts import MAX_SUGGESTED_PROMPT_LENGTH, MAX_SUGGESTED_PROMPTS@@ -922,6 +923,7 @@ class ScoutFleetSyncQuerySerializer(serializers.Serializer):"Which surface asked for the materialization, recorded on the ""`signals_scout_fleet_synced` analytics event so a fleet a person's tab-open ""delivered is separable from one the coordinator was going to deliver anyway. "+ "The onboarding surface creates new configs disabled until the user activates them. ""Omitted means unknown."),)@@ -3400,11 +3402,6 @@ def validate_allowed_mcp_tools(value: list[str] | None) -> list[str] | None:return sorted(set(value))-class ScoutOrigin(models.TextChoices):- CANONICAL = "canonical", "canonical"- CUSTOM = "custom", "custom"--class ScoutRole(models.TextChoices):SPECIALIST = "specialist", "specialist"OPERATIONAL = "operational", "operational"diff --git a/products/signals/backend/scout_harness/views.py b/products/signals/backend/scout_harness/views.pyindex e50e60e65185..3ee7c87849a3 100644--- a/products/signals/backend/scout_harness/views.py+++ b/products/signals/backend/scout_harness/views.py@@ -39,7 +39,7 @@ from drf_spectacular.types import OpenApiTypesfrom drf_spectacular.utils import OpenApiParameter, OpenApiResponse, extend_schemafrom rest_framework import exceptions, status, viewsetsfrom rest_framework.decorators import action-from rest_framework.permissions import BasePermission, IsAuthenticated+from rest_framework.permissions import IsAuthenticatedfrom rest_framework.request import Requestfrom rest_framework.response import Responsefrom temporalio.exceptions import WorkflowAlreadyStartedError@@ -80,6 +80,7 @@ from products.signals.backend.models import (SignalScoutRun,)from products.signals.backend.pipeline_identity import pipeline_writer_identity+from products.signals.backend.presentation.scout_permissions import ScoutCanonicalTeamAccessPermissionfrom products.signals.backend.report_access import may_read_reportsfrom products.signals.backend.report_charts import ChartSizefrom products.signals.backend.report_generation.resolve_reviewers import MAX_PROJECT_MEMBERS, list_project_members@@ -605,31 +606,6 @@ def _resolve_emission_report_links(return links-class ScoutCanonicalTeamAccessPermission(BasePermission):- """Authorize requests against the project that owns the scout data."""-- message = "You don't have access to the project that owns this data."-- def has_permission(self, request: Request, view) -> bool:- if not request.user.is_authenticated:- # Unreachable while `IsAuthenticated` runs ahead of this class, but deny rather than- # allow, so this class can never be the reason an anonymous request gets through.- return False- team = view.team- if team.parent_team_id is None or team.parent_team_id == team.id or team.parent_team is None:- return True- authenticator = request.successful_authenticator- scoped_teams = None- if isinstance(authenticator, OAuthAccessTokenAuthentication):- scoped_teams = authenticator.access_token.scoped_teams- elif isinstance(authenticator, PersonalAPIKeyAuthentication):- scoped_teams = authenticator.personal_api_key.scoped_teams- if scoped_teams and team.parent_team_id not in scoped_teams:- return False- level = view.user_permissions.team(team.parent_team).effective_membership_level- return level is not None--class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):"""Run history + finding emission for the headless agent."""@@ -3955,7 +3931,8 @@ class SignalScoutConfigViewSet(ScoutTrialConfigMixin, TeamAndOrgViewSetMixin, vi"lacking one, retire the skills whose canonical scout no longer ships, and return all ""scout configs. Normally the Temporal coordinator does this on its next tick; this ""action exists so the scout UIs and setup flows (e.g. the wizard's self-driving "- "program) can hand the user a tunable fleet immediately."+ "program) can hand the user a tunable fleet immediately. With surface=onboarding, "+ "new configs stay disabled until explicitly activated."),operation_id="signals_scout_config_sync",)@@ -3965,7 +3942,7 @@ class SignalScoutConfigViewSet(ScoutTrialConfigMixin, TeamAndOrgViewSetMixin, viurl_path="sync",# Custom actions need explicit scopes — see the `current` action's note on the# "no scopes declared" rejection branch in `posthog/permissions.py`. Write scope:- # the sync materializes configs, and fresh configs are enabled (they drive spend).+ # the sync materializes configs and can enable fresh ones outside onboarding.required_scopes=["signal_scout:write"],pagination_class=None,)diff --git a/products/signals/backend/scout_suggestions_api.py b/products/signals/backend/scout_suggestions_api.pyindex e06fc8293aed..801645a7b66d 100644--- a/products/signals/backend/scout_suggestions_api.py+++ b/products/signals/backend/scout_suggestions_api.py@@ -28,6 +28,8 @@ from posthog.temporal.common.client import sync_connectfrom products.access_control.backend.facade.user_access_control import UserAccessControlfrom products.signals.backend.models import SignalScoutSuggestionSet+from products.signals.backend.presentation.scout_permissions import ScoutCanonicalTeamAccessPermission+from products.signals.backend.presentation.scout_suggestion_serializers import ScoutSuggestionItemSerializerfrom products.signals.backend.scout_chat import consume_daily_attempt, refund_daily_attemptfrom products.signals.backend.scout_harness.suggestions import (dismiss_suggestion,@@ -38,7 +40,7 @@ from products.signals.backend.scout_harness.suggestions import (suggestions_allowed_for_team,visible_items,)-from products.signals.backend.scout_harness.views import ScoutCanonicalTeamAccessPermission, _canonical_team_id+from products.signals.backend.scout_harness.views import _canonical_team_idlogger = structlog.get_logger(__name__)@@ -48,44 +50,6 @@ logger = structlog.get_logger(__name__)SUGGESTIONS_REFRESH_DAILY_CAP = 3-class ScoutSuggestionProposedConfigSerializer(serializers.Serializer):- run_cron_schedule = serializers.CharField(- allow_null=True,- required=False,- help_text="Suggested five-field cron schedule in the project timezone, or null for an interval.",- )- run_interval_minutes = serializers.IntegerField(- allow_null=True,- required=False,- help_text="Suggested minutes between runs when no cron is given; null means the daily default.",- )- emit = serializers.BooleanField(- help_text="Whether the suggested scout should write to the inbox (false = dry run)."- )---class ScoutSuggestionItemSerializer(serializers.Serializer):- id = serializers.CharField(help_text="Stable id of this suggestion within the batch; use it to dismiss.")- kind = serializers.ChoiceField(- choices=["canonical", "custom"],- help_text="`canonical`: enable a PostHog-authored scout that exists but is off. `custom`: create a drafted scout.",- )- skill_name = serializers.CharField(- help_text="The scout's `signals-scout-*` skill name (existing for canonical, proposed for custom)."- )- title = serializers.CharField(help_text="Short sentence-case title: what the scout watches.")- why_here = serializers.CharField(help_text="Project-specific evidence for this suggestion, in prose.")- description = serializers.CharField(- allow_blank=True, help_text="Custom only: the one-line description the scout would be created with."- )- draft_body = serializers.CharField(- allow_blank=True, help_text="Custom only: the complete skill body the scout would be created with."- )- proposed_config = ScoutSuggestionProposedConfigSerializer(help_text="Suggested schedule and emit posture.")- gap = serializers.BooleanField(help_text="True when nothing in the current fleet covers this.")- confidence = serializers.ChoiceField(choices=["low", "medium", "high"], help_text="The producer's confidence.")--# The read is the viewset's `list` action but returns one object; without this drf-spectacular# infers a list response and the generated client types it as an array.@extend_schema_serializer(many=False)diff --git a/products/signals/backend/tasks.py b/products/signals/backend/tasks.pyindex c27c5ca7862e..161109608341 100644--- a/products/signals/backend/tasks.py+++ b/products/signals/backend/tasks.py@@ -80,6 +80,27 @@ from products.tasks.backend.facade.repo_activity import RepositoryCommitActivitylogger = structlog.get_logger(__name__)+@shared_task(ignore_result=True, autoretry_for=(Exception,), retry_backoff=True, max_retries=5)+@with_team_scope()+def reconcile_inbox_onboarding(team_id: int, failed_checks: int = 0) -> None:+ from products.signals.backend.onboarding_completion import (+ InboxOnboardingReconciler, # noqa: PLC0415 - keep onboarding dependencies off task discovery+ RepositoryCheckUnavailable,+ )++ try:+ pending = InboxOnboardingReconciler(team_id, priority=Priority.BATCH).run()+ except RepositoryCheckUnavailable as error:+ reconcile_inbox_onboarding.apply_async(+ args=[team_id],+ kwargs={"failed_checks": failed_checks + 1},+ countdown=max(min(60 * 2 ** min(failed_checks, 4), 900), error.retry_after),+ )+ return+ if pending:+ reconcile_inbox_onboarding.apply_async(args=[team_id], countdown=60)++@shared_task(name="products.signals.backend.tasks.refresh_pull_request_participants",ignore_result=True,diff --git a/products/signals/backend/test/test_inbox_onboarding.py b/products/signals/backend/test/test_inbox_onboarding.pynew file mode 100644index 000000000000..5e8e0aaced1e--- /dev/null+++ b/products/signals/backend/test/test_inbox_onboarding.py@@ -0,0 +1,485 @@+from datetime import timedelta++from posthog.test.base import APIBaseTest+from unittest.mock import patch++from django.utils import timezone++from parameterized import parameterized+from requests import Timeout++from posthog.egress.github.transport import GitHubRateLimitError+from posthog.egress.transport.transport import EgressBudgetExhausted+from posthog.models import OAuthApplication+from posthog.models.activity_logging.activity_log import ActivityLog+from posthog.models.github_integration_base import GitHubIntegrationError+from posthog.models.integration import GitHubIntegration, Integration+from posthog.models.oauth import OAuthAccessToken+from posthog.models.personal_api_key import PersonalAPIKey+from posthog.models.team.team import Team+from posthog.models.utils import generate_random_token_personal, hash_key_value+from posthog.oauth_provenance import SANDBOX_OAUTH_APP_CLIENT_IDS++from products.signals.backend.models import SignalScoutConfig, SignalSourceConfig, SignalTeamConfig+from products.signals.backend.onboarding_completion import InboxOnboardingReconciler+from products.signals.backend.scout_harness.config_registry import register_missing_configs+from products.signals.backend.scout_harness.lazy_seed import seed_canonical_skills+from products.signals.backend.tasks import reconcile_inbox_onboarding+++class TestInboxOnboarding(APIBaseTest):+ def setUp(self) -> None:+ super().setUp()+ self.url = f"/api/projects/{self.team.id}/signals/onboarding/"+ SignalTeamConfig.objects.get_or_create(team=self.team)+ self.source = SignalSourceConfig.objects.create(+ team=self.team, source_product="error_tracking", source_type="issue_created", enabled=True+ )+ self.scout_skill_name = "signals-scout-general"+ self.suggestion = {+ "id": "general",+ "kind": "canonical",+ "skill_name": self.scout_skill_name,+ "title": "General scout",+ "why_here": "Watch the product",+ "description": "",+ "draft_body": "",+ "proposed_config": {"run_interval_minutes": 1440, "emit": True},+ "gap": True,+ "confidence": "high",+ }+ self.draft = {+ "step": "github",+ "sources": [{"source_product": "error_tracking", "source_type": "issue_created", "enabled": True}],+ "scanner_ids": [],+ "suggestions": [],+ "automatic_implementation": False,+ "implementation_priority": "P1",+ }++ def test_draft_survives_reload_without_enabling_work(self) -> None:+ self.source.enabled = False+ self.source.save()+ response = self.client.post(self.url, self.draft, format="json")+ assert response.status_code == 200, response.json()+ assert self.client.get(self.url).json()["draft"] == self.draft+ self.source.refresh_from_db()+ assert self.source.enabled is False+ assert SignalTeamConfig.objects.get(team=self.team).autostart_enabled is None++ def test_exposure_is_sticky_and_queued_once(self) -> None:+ with (+ patch("products.signals.backend.facade.onboarding.posthoganalytics.capture") as capture,+ patch("products.signals.backend.tasks.reconcile_inbox_onboarding.delay") as reconcile,+ self.captureOnCommitCallbacks(execute=True),+ ):+ first = self.client.post(f"{self.url}expose/", {"variant": "control"}, format="json")+ second = self.client.post(f"{self.url}expose/", {"variant": "test"}, format="json")+ assert first.status_code == 200+ assert second.json()["variant"] == "control"+ assert capture.call_count == 1+ reconcile.assert_called_once_with(self.team.id)++ def test_control_completion_is_verified_without_a_browser_and_only_once(self) -> None:+ config = SignalTeamConfig.objects.get(team=self.team)+ config.onboarding = {"variant": "control", "exposed_at": timezone.now().isoformat(), "exposed_by": self.user.pk}+ config.save()+ with (+ patch.object(InboxOnboardingReconciler, "has_repository", return_value=False) as repository,+ patch("products.signals.backend.onboarding_completion.ph_scoped_capture") as capture,+ self.captureOnCommitCallbacks(execute=True),+ ):+ assert InboxOnboardingReconciler(self.team.id).run() is True+ config.refresh_from_db()+ assert not config.onboarding.get("completed_at")+ repository.return_value = True+ assert InboxOnboardingReconciler(self.team.id).run() is False+ assert InboxOnboardingReconciler(self.team.id).run() is False+ config.refresh_from_db()+ assert config.onboarding["completed_at"]+ capture.assert_called_once()+ assert capture.return_value.__enter__.return_value.call_args.kwargs["properties"]["variant"] == "control"++ @parameterized.expand([(False,), (True,)])+ def test_control_reconciliation_waits_for_manual_activation(self, draft_saved_during_check: bool) -> None:+ config = SignalTeamConfig.objects.get(team=self.team)+ config.onboarding = {"variant": "control", "exposed_at": timezone.now().isoformat()}+ if not draft_saved_during_check:+ config.onboarding["draft"] = self.draft+ config.save()++ def save_draft_and_return_repository() -> bool:+ config.onboarding = {**(config.onboarding or {}), "draft": self.draft}+ config.save()+ return True++ with (+ patch.object(InboxOnboardingReconciler, "has_repository", side_effect=save_draft_and_return_repository),+ patch("products.signals.backend.onboarding_completion.ph_scoped_capture") as capture,+ self.captureOnCommitCallbacks(execute=True),+ ):+ assert InboxOnboardingReconciler(self.team.id).run() is False+ config.refresh_from_db()+ assert not config.onboarding.get("completed_at")+ capture.assert_not_called()++ def test_control_without_a_source_never_converts(self) -> None:+ config = SignalTeamConfig.objects.get(team=self.team)+ config.onboarding = {"variant": "control", "exposed_at": timezone.now().isoformat()}+ config.save()+ self.source.enabled = False+ self.source.save()+ with patch.object(InboxOnboardingReconciler, "has_repository", return_value=True):+ assert InboxOnboardingReconciler(self.team.id).run() is True+ config.refresh_from_db()+ assert not config.onboarding.get("completed_at")++ @parameterized.expand([("github",), ("source",), ("disabled_source",), ("scanner",), ("empty",)])+ def test_incomplete_setup_never_converts(self, missing: str) -> None:+ if missing == "source":+ self.source.enabled = False+ self.source.save()+ if missing == "disabled_source":+ self.draft["sources"] = [+ {"source_product": "error_tracking", "source_type": "issue_created", "enabled": False}+ ]+ if missing == "scanner":+ self.draft["scanner_ids"] = ["11111111-1111-4111-8111-111111111111"]+ if missing == "empty":+ self.draft["sources"] = []+ with patch(+ "products.signals.backend.onboarding_completion.InboxOnboardingReconciler.has_repository",+ return_value=None if missing == "github" else object(),+ ):+ response = self.client.post(f"{self.url}complete/", self.draft, format="json")+ assert response.status_code == 400, response.json()+ assert not (SignalTeamConfig.objects.get(team=self.team).onboarding or {}).get("completed_at")++ @parameterized.expand([(None,), ("control",), ("test",)])+ def test_completion_is_durable_and_retry_safe(self, variant: str | None) -> None:+ config = SignalTeamConfig.objects.get(team=self.team)+ config.onboarding = {"variant": variant}+ config.save()+ with (+ patch(+ "products.signals.backend.onboarding_completion.InboxOnboardingReconciler.has_repository",+ return_value=object(),+ ),+ patch("products.signals.backend.facade.onboarding.posthoganalytics.capture") as capture,+ self.captureOnCommitCallbacks(execute=True),+ ):+ first = self.client.post(f"{self.url}complete/", self.draft, format="json")+ second = self.client.post(f"{self.url}complete/", self.draft, format="json")+ assert first.status_code == 200, first.json()+ assert first.json() == second.json()+ config = SignalTeamConfig.objects.get(team=self.team)+ assert config.autostart_enabled is False+ assert config.default_autostart_priority == "P1"+ assert config.onboarding is not None+ assert config.onboarding["activated_by"] == self.user.id+ assert capture.call_args.kwargs["properties"]["variant"] == variant+ assert (+ len(+ [+ call+ for call in capture.call_args_list+ if call.kwargs.get("event") == "self-driving onboarding completed"+ ]+ )+ == 1+ )++ @parameterized.expand([(None, False), (True, False), (False, False), (None, True), (False, True)])+ def test_scout_only_completion_respects_source_gate(self, enabled: bool | None, control: bool) -> None:+ self.source.enabled = False+ self.source.save()+ self.draft["sources"] = []+ self.draft["suggestions"] = [self.suggestion]+ SignalScoutConfig.objects.create(team=self.team, skill_name=self.scout_skill_name, enabled=True, emit=True)+ if enabled is not None:+ SignalSourceConfig.objects.create(+ team=self.team, source_product="signals_scout", source_type="cross_source_issue", enabled=enabled+ )+ config = SignalTeamConfig.objects.get(team=self.team)+ if control:+ config.onboarding = {"variant": "control", "exposed_at": timezone.now().isoformat()}+ config.save()+ Integration.objects.create(team=self.team, kind="github")+ with patch.object(+ GitHubIntegration, "list_repositories", return_value=([{"full_name": "example/product"}], False)+ ):+ if control:+ assert InboxOnboardingReconciler(self.team.id).run() is (enabled is False)+ else:+ response = self.client.post(f"{self.url}complete/", self.draft, format="json")+ assert response.status_code == (400 if enabled is False else 200), response.json()+ config.refresh_from_db()+ assert bool((config.onboarding or {}).get("completed_at")) is (enabled is not False)++ @parameterized.expand(+ [+ (False, "scout", 403),+ (True, "scout", 200),+ (False, "source", 403),+ (True, "source", 200),+ (False, "none", 200),+ ]+ )+ def test_child_completion_checks_parent_scout_access(+ self, parent_access: bool, selection: str, expected_status: int+ ) -> None:+ child = Team.objects.create(organization=self.organization, parent_team=self.team, name="Child")+ SignalSourceConfig.objects.create(+ team=child, source_product="error_tracking", source_type="issue_created", enabled=True+ )+ SignalScoutConfig.objects.create(team=self.team, skill_name=self.scout_skill_name)+ Integration.objects.create(team=child, kind="github")+ if selection == "scout":+ self.draft["suggestions"] = [self.suggestion]+ elif selection == "source":+ SignalSourceConfig.objects.create(+ team=self.team, source_product="signals_scout", source_type="cross_source_issue", enabled=True+ )+ self.draft["sources"] = [+ {"source_product": "signals_scout", "source_type": "cross_source_issue", "enabled": True}+ ]+ raw = generate_random_token_personal()+ PersonalAPIKey.objects.create(+ label="onboarding",+ user=self.user,+ secure_value=hash_key_value(raw),+ scopes=["task:write", "signal_scout:write", "llm_skill:write"],+ scoped_teams=[child.id, self.team.id] if parent_access else [child.id],+ )+ self.client.logout()+ with patch.object(+ GitHubIntegration, "list_repositories", return_value=([{"full_name": "example/product"}], False)+ ):+ response = self.client.post(+ f"/api/projects/{child.id}/signals/onboarding/complete/",+ self.draft,+ format="json",+ HTTP_AUTHORIZATION=f"Bearer {raw}",+ )+ assert response.status_code == expected_status, response.content++ @parameterized.expand([("",), ("complete/",), ("expose/",), ("reconcile/",)])+ def test_onboarding_writes_require_a_non_sandbox_credential(self, action: str) -> None:+ application = OAuthApplication.objects.create(+ client_id=sorted(SANDBOX_OAUTH_APP_CLIENT_IDS)[0],+ name="Onboarding test",+ client_type=OAuthApplication.CLIENT_PUBLIC,+ authorization_grant_type=OAuthApplication.GRANT_AUTHORIZATION_CODE,+ redirect_uris="https://example.com/callback",+ algorithm=OAuthApplication.RS256_ALGORITHM,+ )+ token = OAuthAccessToken.objects.create(+ user=self.user,+ application=application,+ token="pha_onboarding_test_token",+ scope="task:read task:write internal_run:read",+ expires=timezone.now() + timedelta(hours=1),+ scoped_teams=[self.team.id],+ )+ self.client.logout()+ self.client.credentials(HTTP_AUTHORIZATION=f"Bearer {token.token}")+ response = self.client.post(f"{self.url}{action}", self.draft, format="json")+ assert response.status_code == 403, response.content+ assert self.client.get(self.url).status_code == 200+ assert SignalTeamConfig.objects.get(team=self.team).onboarding is None++ def test_onboarding_activity_masks_scout_drafts(self) -> None:+ self.draft["suggestions"] = [{**self.suggestion, "draft_body": "Investigate example checkout errors."}]+ with self.captureOnCommitCallbacks(execute=True):+ response = self.client.post(self.url, self.draft, format="json")+ assert response.status_code == 200, response.content+ log = ActivityLog.objects.filter(team_id=self.team.id, scope="SignalTeamConfig").latest("created_at")+ assert log.detail is not None+ change = next(change for change in log.detail["changes"] if change["field"] == "onboarding")+ assert change["after"] == "masked"+ change["after"] = {"draft": self.draft}+ safe_detail = log.safe_detail+ assert safe_detail is not None+ assert next(change for change in safe_detail["changes"] if change["field"] == "onboarding")["after"] == "masked"++ @parameterized.expand([("unchanged", True), ("user_paused", False), ("withheld", False), ("task_only", False)])+ def test_activation_resumes_only_onboarding_operational_pauses(self, state: str, enabled: bool) -> None:+ seed_canonical_skills(self.team)+ register_missing_configs(self.team.id, enable_new_configs=False)+ scout = SignalScoutConfig.objects.for_team(self.team.id).get(skill_name="signals-scout-inbox-validation")+ register_missing_configs(self.team.id)+ scout.refresh_from_db()+ assert not scout.enabled+ if state == "user_paused":+ scout.status_changed_at = timezone.now() + timedelta(seconds=1)+ scout.save(update_fields=["status_changed_at"])+ withheld = [scout.skill_name] if state == "withheld" else []+ if state == "task_only":+ raw = self.create_personal_api_key_with_scopes(["task:write"])+ self.client.logout()+ self.client.credentials(HTTP_AUTHORIZATION=f"Bearer {raw}")+ with (+ patch.object(+ GitHubIntegration, "list_repositories", return_value=([{"full_name": "example/product"}], False)+ ),+ patch(+ "products.signals.backend.scout_harness.team_limits.posthoganalytics.get_feature_flag_payload",+ return_value={"default_team_config": {"withheld_skills": withheld}},+ ),+ ):+ Integration.objects.create(team=self.team, kind="github")+ response = self.client.post(f"{self.url}complete/", self.draft, format="json")+ assert response.status_code == (403 if state == "task_only" else 200), response.content+ scout.refresh_from_db()+ assert scout.enabled is enabled+ assert not SignalScoutConfig.objects.for_team(self.team.id).get(skill_name="signals-scout-general").enabled+ if state == "task_only":+ onboarding = SignalTeamConfig.objects.get(team=self.team).onboarding+ assert onboarding is not None+ assert not onboarding.get("completed_at")+ elif state == "withheld":+ register_missing_configs(self.team.id, withheld_skill_names=set(withheld))+ scout.refresh_from_db()+ assert not scout.enabled+ register_missing_configs(self.team.id, withheld_skill_names=set())+ scout.refresh_from_db()+ assert scout.enabled++ @parameterized.expand([("expose",), ("reconcile",)])+ def test_child_scoped_credential_cannot_start_parent_reconciliation(self, action: str) -> None:+ child = Team.objects.create(organization=self.organization, parent_team=self.team, name="Child")+ raw = generate_random_token_personal()+ PersonalAPIKey.objects.create(+ label="onboarding",+ user=self.user,+ secure_value=hash_key_value(raw),+ scopes=["task:write"],+ scoped_teams=[child.id],+ )+ self.client.logout()+ response = self.client.post(+ f"/api/projects/{child.id}/signals/onboarding/{action}/",+ {"variant": "control"},+ format="json",+ HTTP_AUTHORIZATION=f"Bearer {raw}",+ )+ assert response.status_code == 403, response.content++ @parameterized.expand(+ [+ (GitHubIntegrationError, True),+ (GitHubRateLimitError, True),+ (EgressBudgetExhausted, True),+ (Timeout, True),+ (GitHubRateLimitError, False),+ ]+ )+ def test_repository_discovery_continues_after_failure(self, error: type[Exception], healthy: bool) -> None:+ Integration.objects.create(team=self.team, kind="github")+ Integration.objects.create(team=self.team, kind="github")+ result = ([{"full_name": "example/product"}], True) if healthy else ([], False)+ with patch.object(+ GitHubIntegration, "list_repositories", side_effect=[error("unavailable"), result]+ ) as listing:+ response = self.client.post(f"{self.url}complete/", self.draft, format="json")+ assert response.status_code == (200 if healthy else 503), response.content+ assert listing.call_count == 2+ assert all(call.kwargs == {"per_page": 1} for call in listing.call_args_list)++ @parameterized.expand([("recovered",), ("expired",), ("manual",), ("completed",)])+ def test_background_polling_survives_outage_and_stops(self, terminal_state: str) -> None:+ config = SignalTeamConfig.objects.get(team=self.team)+ config.onboarding = {"variant": "control", "exposed_at": timezone.now().isoformat()}+ config.save()+ Integration.objects.create(team=self.team, kind="github")+ with (+ patch.object(+ GitHubIntegration, "list_repositories", side_effect=GitHubRateLimitError("limited")+ ) as listing,+ patch.object(reconcile_inbox_onboarding, "apply_async") as schedule,+ ):+ failed_checks = 0+ for _ in range(7):+ schedule.reset_mock()+ reconcile_inbox_onboarding.run(self.team.id, failed_checks=failed_checks)+ schedule.assert_called_once()+ assert 60 <= schedule.call_args.kwargs["countdown"] <= 900+ failed_checks = schedule.call_args.kwargs["kwargs"]["failed_checks"]+ config.refresh_from_db()+ assert not config.onboarding.get("completed_at")+ if terminal_state == "expired":+ config.onboarding["exposed_at"] = (timezone.now() - timedelta(days=8)).isoformat()+ elif terminal_state == "manual":+ config.onboarding["draft"] = self.draft+ elif terminal_state == "completed":+ config.onboarding["completed_at"] = timezone.now().isoformat()+ config.save()+ schedule.reset_mock()+ listing.reset_mock()+ listing.side_effect = None+ listing.return_value = ([{"full_name": "example/product"}], False)+ reconcile_inbox_onboarding.run(self.team.id, failed_checks=failed_checks)+ schedule.assert_not_called()+ if terminal_state == "recovered":+ config.refresh_from_db()+ assert config.onboarding["completed_at"]+ else:+ listing.assert_not_called()++ @parameterized.expand(+ [+ ("get", ["task:read"], True, 403),+ ("get", ["task:read"], False, 200),+ ("get", ["task:read", "signal_scout:read"], True, 200),+ ("post", ["task:write"], True, 403),+ ("post", ["task:write", "signal_scout:write"], True, 403),+ ("post", ["task:write", "signal_scout:write", "llm_skill:write"], True, 200),+ ("post", ["task:write"], False, 200),+ ]+ )+ def test_draft_scout_permissions(+ self, method: str, scopes: list[str], with_scout: bool, expected_status: int+ ) -> None:+ if with_scout:+ self.draft["suggestions"] = [{**self.suggestion, "kind": "custom", "draft_body": "Watch failed upgrades."}]+ config = SignalTeamConfig.objects.get(team=self.team)+ if method == "get":+ config.onboarding = {"draft": self.draft}+ config.save()+ raw = self.create_personal_api_key_with_scopes(scopes)+ self.client.logout()+ self.client.credentials(HTTP_AUTHORIZATION=f"Bearer {raw}")+ response = (+ self.client.get(self.url) if method == "get" else self.client.post(self.url, self.draft, format="json")+ )+ assert response.status_code == expected_status, response.content+ if method == "post" and expected_status == 403:+ config.refresh_from_db()+ assert config.onboarding is None++ @parameterized.expand([("suggestions",), ("activation_scouts",)])+ def test_task_only_writer_cannot_clear_existing_scout_choices(self, field: str) -> None:+ config = SignalTeamConfig.objects.get(team=self.team)+ original = [self.suggestion] if field == "suggestions" else [self.scout_skill_name]+ config.onboarding = {"draft": {**self.draft, field: original}}+ config.save()+ raw = self.create_personal_api_key_with_scopes(["task:write"])+ self.client.logout()+ response = self.client.post(self.url, self.draft, format="json", HTTP_AUTHORIZATION=f"Bearer {raw}")+ assert response.status_code == 403, response.content+ config.refresh_from_db()+ assert config.onboarding["draft"][field] == original++ def test_background_polling_honors_github_retry_hint(self) -> None:+ config = SignalTeamConfig.objects.get(team=self.team)+ config.onboarding = {"variant": "control", "exposed_at": timezone.now().isoformat()}+ config.save()+ Integration.objects.create(team=self.team, kind="github")+ with (+ patch.object(+ GitHubIntegration, "list_repositories", side_effect=GitHubRateLimitError("limited", retry_after=3600)+ ),+ patch.object(reconcile_inbox_onboarding, "apply_async") as schedule,+ ):+ reconcile_inbox_onboarding.run(self.team.id, failed_checks=6)+ assert schedule.call_args.kwargs["countdown"] == 3600diff --git a/products/signals/backend/test/test_scout_harness_api.py b/products/signals/backend/test/test_scout_harness_api.pyindex 0d254d06a9d6..5b7dd8d7f082 100644--- a/products/signals/backend/test/test_scout_harness_api.py+++ b/products/signals/backend/test/test_scout_harness_api.py@@ -54,6 +54,7 @@ from products.signals.backend.models import ()from products.signals.backend.pipeline_identity import AI_STAGE_RESEARCHfrom products.signals.backend.quota import SelfDrivingQuotaGate+from products.signals.backend.scout_harness.config_registry import register_missing_configsfrom products.signals.backend.scout_harness.derived_metadata import DERIVED_METADATA_KEY, stamp_derived_metadatafrom products.signals.backend.scout_harness.lazy_seed import (HARNESS_SEEDED_BY,@@ -4299,7 +4300,8 @@ class TestScoutHarnessConfigAPI(APIBaseTest):def _sync_url(self) -> str:return f"/api/projects/{self.team.id}/signals/scout/configs/sync/"- def test_sync_materializes_fleet_for_fresh_team(self) -> None:+ @parameterized.expand([(None, True), ("onboarding", False)])+ def test_sync_materializes_fleet_for_fresh_team(self, surface: str | None, enabled: bool) -> None:canonical_names = {c.name for c in discover_canonical_skills()}scout_names = {n for n in canonical_names if n.startswith("signals-scout-")}companion_names = canonical_names - scout_names@@ -4307,7 +4309,7 @@ class TestScoutHarnessConfigAPI(APIBaseTest):assert "authoring-scouts" in companion_namesassert SignalScoutConfig.objects.filter(team=self.team).count() == 0- response = self.client.post(self._sync_url())+ response = self.client.post(self._sync_url() + (f"?surface={surface}" if surface else ""))assert response.status_code == status.HTTP_200_OKbody = response.json()@@ -4315,10 +4317,12 @@ class TestScoutHarnessConfigAPI(APIBaseTest):# into the team's LLMSkill namespace below but never materialize a scout config.assert {c["skill_name"] for c in body} == scout_namesassert [c["skill_name"] for c in body] == sorted(scout_names)- assert all(c["enabled"] is True for c in body)+ assert all(c["enabled"] is enabled for c in body)assert all(c["emit"] is True for c in body)assert all(c["run_interval_minutes"] == 1440 for c in body)assert SignalScoutConfig.objects.filter(team=self.team).count() == len(scout_names)+ register_missing_configs(self.team.id)+ assert not SignalScoutConfig.objects.filter(team=self.team).exclude(enabled=enabled).exists()# Every canonical skill — fleet and companions — was seeded into the team's# LLMSkill namespace.assert (@@ -4477,7 +4481,8 @@ class TestScoutHarnessConfigAPI(APIBaseTest):assert response.status_code == status.HTTP_403_FORBIDDENassert SignalScoutConfig.objects.filter(team=self.team).count() == 0- def test_sync_is_idempotent_and_preserves_tuned_configs(self) -> None:+ @parameterized.expand([(None,), ("onboarding",)])+ def test_sync_is_idempotent_and_preserves_tuned_configs(self, surface: str | None) -> None:first = self.client.post(self._sync_url())assert first.status_code == status.HTTP_200_OKfleet_size = len(first.json())@@ -4488,13 +4493,14 @@ class TestScoutHarnessConfigAPI(APIBaseTest):tuned.enabled = Falsetuned.save(update_fields=["enabled"])- second = self.client.post(self._sync_url())+ second = self.client.post(self._sync_url() + (f"?surface={surface}" if surface else ""))assert second.status_code == status.HTTP_200_OKassert len(second.json()) == fleet_sizeassert SignalScoutConfig.objects.filter(team=self.team).count() == fleet_sizetuned.refresh_from_db()assert tuned.enabled is False, "sync must not reset existing configs"+ assert sum(config["enabled"] for config in second.json()) == fleet_size - 1def test_list_is_side_effect_free_for_unregistered_scout_skills(self) -> None:# The list MCP tool is annotated readOnly — a scout skill without a config must notdiff --git a/products/signals/backend/views.py b/products/signals/backend/views.pyindex a5b1141e202c..9dea4ccfeee5 100644--- a/products/signals/backend/views.py+++ b/products/signals/backend/views.py@@ -148,6 +148,7 @@ from products.signals.backend.models import (SignalTeamConfig,SignalUserAutonomyConfig,)+from products.signals.backend.presentation.scout_permissions import ScoutCanonicalTeamAccessPermissionfrom products.signals.backend.pull_requests import import_report_pull_requestsfrom products.signals.backend.quota import self_driving_quota_enforcement_enabled, self_driving_quota_gatefrom products.signals.backend.ranking.access import can_view_inbox_ranking@@ -218,7 +219,6 @@ from products.signals.backend.report_task_actions import (from products.signals.backend.reviewer_correction_notes import ReviewerCorrection, forward_reviewer_correction_notefrom products.signals.backend.reviewer_pr_assignment import schedule_reviewer_pr_assignmentfrom products.signals.backend.scout_harness.trial_access import trial_state_errors, trial_store_for_request-from products.signals.backend.scout_harness.views import ScoutCanonicalTeamAccessPermissionfrom products.signals.backend.scout_report.trial_inbox import TrialInboxReads, private_report_artefactsfrom products.signals.backend.serializers import (CommitDiffResponseSerializer,diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.tsindex 1be3316470b8..a10d69874995 100644--- a/products/signals/frontend/generated/api.schemas.ts+++ b/products/signals/frontend/generated/api.schemas.ts@@ -141,6 +141,393 @@ export interface InboxSummaryApi {people: InboxSummaryPersonApi[] | null}+/**+ * * `signals` - Signals+ * * `scouts` - Scouts+ * * `github` - GitHub+ */+export type InboxOnboardingStepEnumApi = (typeof InboxOnboardingStepEnumApi)[keyof typeof InboxOnboardingStepEnumApi]++export const InboxOnboardingStepEnumApi = {+ Signals: 'signals',+ Scouts: 'scouts',+ Github: 'github',+} as const++/**+ * * `session_replay` - Session replay+ * * `llm_analytics` - LLM analytics+ * * `github` - GitHub+ * * `linear` - Linear+ * * `jira` - Jira+ * * `zendesk` - Zendesk+ * * `conversations` - Conversations+ * * `error_tracking` - Error tracking+ * * `pganalyze` - pganalyze+ * * `signals_scout` - Signals scout+ * * `signals_check` - Report check+ * * `logs` - Logs+ * * `health_checks` - Health checks+ * * `endpoints` - Endpoints+ * * `replay_vision` - Replay Vision+ * * `analytics` - Product analytics+ * * `freshdesk` - Freshdesk+ * * `freshservice` - Freshservice+ * * `front` - Front+ * * `gorgias` - Gorgias+ * * `kustomer` - Kustomer+ * * `dixa` - Dixa+ * * `plain` - Plain+ * * `gitlab` - GitLab+ * * `gitea` - Gitea+ * * `shortcut` - Shortcut+ * * `sentry` - Sentry+ * * `rollbar` - Rollbar+ * * `bugsnag` - Bugsnag+ * * `honeybadger` - Honeybadger+ * * `raygun` - Raygun+ * * `snyk` - Snyk+ * * `sonarqube` - SonarQube+ * * `semgrep` - Semgrep+ * * `rapid7_insightvm` - Rapid7 InsightVM+ * * `featurebase` - Featurebase+ * * `frill` - Frill+ * * `aha` - Aha+ * * `uservoice` - UserVoice+ * * `productboard` - Productboard+ * * `canny` - Canny+ * * `asknicely` - AskNicely+ * * `retently` - Retently+ * * `appfigures` - Appfigures+ * * `appfollow` - AppFollow+ * * `judgeme_reviews` - Judge.me+ * * `intercom` - Intercom+ * * `hubspot` - HubSpot+ * * `engineering_analytics` - Engineering analytics+ * * `google_search_console` - Google Search Console+ */+export type SignalSourceProductEnumApi = (typeof SignalSourceProductEnumApi)[keyof typeof SignalSourceProductEnumApi]++export const SignalSourceProductEnumApi = {+ SessionReplay: 'session_replay',+ LlmAnalytics: 'llm_analytics',+ Github: 'github',+ Linear: 'linear',+ Jira: 'jira',+ Zendesk: 'zendesk',+ Conversations: 'conversations',+ ErrorTracking: 'error_tracking',+ Pganalyze: 'pganalyze',+ SignalsScout: 'signals_scout',+ SignalsCheck: 'signals_check',+ Logs: 'logs',+ HealthChecks: 'health_checks',+ Endpoints: 'endpoints',+ ReplayVision: 'replay_vision',+ Analytics: 'analytics',+ Freshdesk: 'freshdesk',+ Freshservice: 'freshservice',+ Front: 'front',+ Gorgias: 'gorgias',+ Kustomer: 'kustomer',+ Dixa: 'dixa',+ Plain: 'plain',+ Gitlab: 'gitlab',+ Gitea: 'gitea',+ Shortcut: 'shortcut',+ Sentry: 'sentry',+ Rollbar: 'rollbar',+ Bugsnag: 'bugsnag',+ Honeybadger: 'honeybadger',+ Raygun: 'raygun',+ Snyk: 'snyk',+ Sonarqube: 'sonarqube',+ Semgrep: 'semgrep',+ Rapid7Insightvm: 'rapid7_insightvm',+ Featurebase: 'featurebase',+ Frill: 'frill',+ Aha: 'aha',+ Uservoice: 'uservoice',+ Productboard: 'productboard',+ Canny: 'canny',+ Asknicely: 'asknicely',+ Retently: 'retently',+ Appfigures: 'appfigures',+ Appfollow: 'appfollow',+ JudgemeReviews: 'judgeme_reviews',+ Intercom: 'intercom',+ Hubspot: 'hubspot',+ EngineeringAnalytics: 'engineering_analytics',+ GoogleSearchConsole: 'google_search_console',+} as const++/**+ * * `session_analysis_cluster` - Session analysis cluster+ * * `evaluation_report` - Evaluation report+ * * `issue` - Issue+ * * `ticket` - Ticket+ * * `issue_created` - Issue created+ * * `issue_reopened` - Issue reopened+ * * `issue_spiking` - Issue spiking+ * * `cross_source_issue` - Cross source issue+ * * `alert_state_change` - Alert state change+ * * `health_issue` - Health issue+ * * `endpoint_execution_failed` - Endpoint execution failed+ * * `endpoint_breakdown_limit_exceeded` - Endpoint breakdown limit exceeded+ * * `scanner_finding` - Scanner finding+ * * `anomaly_investigation` - Anomaly investigation+ * * `feedback` - Feedback+ * * `review` - Review+ * * `ci_flaky_check` - CI flaky check+ * * `ci_broken_default_branch` - CI broken default branch+ * * `ci_duration_regression` - CI duration regression+ * * `search_opportunity` - Search opportunity+ */+export type SignalSourceConfigSourceTypeEnumApi =+ (typeof SignalSourceConfigSourceTypeEnumApi)[keyof typeof SignalSourceConfigSourceTypeEnumApi]++export const SignalSourceConfigSourceTypeEnumApi = {+ SessionAnalysisCluster: 'session_analysis_cluster',+ EvaluationReport: 'evaluation_report',+ Issue: 'issue',+ Ticket: 'ticket',+ IssueCreated: 'issue_created',+ IssueReopened: 'issue_reopened',+ IssueSpiking: 'issue_spiking',+ CrossSourceIssue: 'cross_source_issue',+ AlertStateChange: 'alert_state_change',+ HealthIssue: 'health_issue',+ EndpointExecutionFailed: 'endpoint_execution_failed',+ EndpointBreakdownLimitExceeded: 'endpoint_breakdown_limit_exceeded',+ ScannerFinding: 'scanner_finding',+ AnomalyInvestigation: 'anomaly_investigation',+ Feedback: 'feedback',+ Review: 'review',+ CiFlakyCheck: 'ci_flaky_check',+ CiBrokenDefaultBranch: 'ci_broken_default_branch',+ CiDurationRegression: 'ci_duration_regression',+ SearchOpportunity: 'search_opportunity',+} as const++export interface InboxOnboardingSourceApi {+ /** Source product selected during setup.+ *+ * * `session_replay` - Session replay+ * * `llm_analytics` - LLM analytics+ * * `github` - GitHub+ * * `linear` - Linear+ * * `jira` - Jira+ * * `zendesk` - Zendesk+ * * `conversations` - Conversations+ * * `error_tracking` - Error tracking+ * * `pganalyze` - pganalyze+ * * `signals_scout` - Signals scout+ * * `signals_check` - Report check+ * * `logs` - Logs+ * * `health_checks` - Health checks+ * * `endpoints` - Endpoints+ * * `replay_vision` - Replay Vision+ * * `analytics` - Product analytics+ * * `freshdesk` - Freshdesk+ * * `freshservice` - Freshservice+ * * `front` - Front+ * * `gorgias` - Gorgias+ * * `kustomer` - Kustomer+ * * `dixa` - Dixa+ * * `plain` - Plain+ * * `gitlab` - GitLab+ * * `gitea` - Gitea+ * * `shortcut` - Shortcut+ * * `sentry` - Sentry+ * * `rollbar` - Rollbar+ * * `bugsnag` - Bugsnag+ * * `honeybadger` - Honeybadger+ * * `raygun` - Raygun+ * * `snyk` - Snyk+ * * `sonarqube` - SonarQube+ * * `semgrep` - Semgrep+ * * `rapid7_insightvm` - Rapid7 InsightVM+ * * `featurebase` - Featurebase+ * * `frill` - Frill+ * * `aha` - Aha+ * * `uservoice` - UserVoice+ * * `productboard` - Productboard+ * * `canny` - Canny+ * * `asknicely` - AskNicely+ * * `retently` - Retently+ * * `appfigures` - Appfigures+ * * `appfollow` - AppFollow+ * * `judgeme_reviews` - Judge.me+ * * `intercom` - Intercom+ * * `hubspot` - HubSpot+ * * `engineering_analytics` - Engineering analytics+ * * `google_search_console` - Google Search Console */+ source_product: SignalSourceProductEnumApi+ /** Signal type selected during setup.+ *+ * * `session_analysis_cluster` - Session analysis cluster+ * * `evaluation_report` - Evaluation report+ * * `issue` - Issue+ * * `ticket` - Ticket+ * * `issue_created` - Issue created+ * * `issue_reopened` - Issue reopened+ * * `issue_spiking` - Issue spiking+ * * `cross_source_issue` - Cross source issue+ * * `alert_state_change` - Alert state change+ * * `health_issue` - Health issue+ * * `endpoint_execution_failed` - Endpoint execution failed+ * * `endpoint_breakdown_limit_exceeded` - Endpoint breakdown limit exceeded+ * * `scanner_finding` - Scanner finding+ * * `anomaly_investigation` - Anomaly investigation+ * * `feedback` - Feedback+ * * `review` - Review+ * * `ci_flaky_check` - CI flaky check+ * * `ci_broken_default_branch` - CI broken default branch+ * * `ci_duration_regression` - CI duration regression+ * * `search_opportunity` - Search opportunity */+ source_type: SignalSourceConfigSourceTypeEnumApi+ /** Whether this source should be enabled at activation. */+ enabled: boolean+}++/**+ * * `canonical` - canonical+ * * `custom` - custom+ */+export type ScoutOriginEnumApi = (typeof ScoutOriginEnumApi)[keyof typeof ScoutOriginEnumApi]++export const ScoutOriginEnumApi = {+ Canonical: 'canonical',+ Custom: 'custom',+} as const++export interface ScoutSuggestionProposedConfigApi {+ /**+ * Suggested five-field cron schedule in the project timezone, or null for an interval.+ * @nullable+ */+ run_cron_schedule?: string | null+ /**+ * Suggested minutes between runs when no cron is given; null means the daily default.+ * @nullable+ */+ run_interval_minutes?: number | null+ /** Whether the suggested scout should write to the inbox (false = dry run). */+ emit: boolean+}++/**+ * * `high` - high+ * * `medium` - medium+ * * `low` - low+ */+export type ConfidenceTierEnumApi = (typeof ConfidenceTierEnumApi)[keyof typeof ConfidenceTierEnumApi]++export const ConfidenceTierEnumApi = {+ High: 'high',+ Medium: 'medium',+ Low: 'low',+} as const++export interface ScoutSuggestionItemApi {+ /** Stable id of this suggestion within the batch; use it to dismiss. */+ id: string+ /** `canonical`: enable a PostHog-authored scout that exists but is off. `custom`: create a drafted scout.+ *+ * * `canonical` - canonical+ * * `custom` - custom */+ kind: ScoutOriginEnumApi+ /** The scout's `signals-scout-*` skill name (existing for canonical, proposed for custom). */+ skill_name: string+ /** Short sentence-case title: what the scout watches. */+ title: string+ /** Project-specific evidence for this suggestion, in prose. */+ why_here: string+ /** Custom only: the one-line description the scout would be created with. */+ description: string+ /** Custom only: the complete skill body the scout would be created with. */+ draft_body: string+ /** Suggested schedule and emit posture. */+ proposed_config: ScoutSuggestionProposedConfigApi+ /** True when nothing in the current fleet covers this. */+ gap: boolean+ /** The producer's confidence.+ *+ * * `low` - low+ * * `medium` - medium+ * * `high` - high */+ confidence: ConfidenceTierEnumApi+}++export interface InboxOnboardingDraftApi {+ /** Step to resume after returning.+ *+ * * `signals` - Signals+ * * `scouts` - Scouts+ * * `github` - GitHub */+ step: InboxOnboardingStepEnumApi+ /** Staged signal source choices. */+ sources: InboxOnboardingSourceApi[]+ /**+ * Existing enabled scanners selected to emit signals.+ * @maxItems 100+ */+ scanner_ids: string[]+ /** Selected scout suggestion drafts. */+ suggestions: ScoutSuggestionItemApi[]+ /**+ * Scouts enabled by an unfinished activation, retained to undo later deselections.+ * @maxItems 50+ * @items.maxLength 200+ */+ activation_scouts?: string[]+ /** Opt in to automatically creating pull requests. */+ automatic_implementation: boolean+ /** Lowest priority to implement automatically; P1 includes P0 and P1.+ *+ * * `P0` - P0+ * * `P1` - P1+ * * `P2` - P2+ * * `P3` - P3+ * * `P4` - P4 */+ implementation_priority: AutonomyPriorityEnumApi+}++/**+ * * `control` - Control+ * * `test` - Focused steps+ */+export type InboxOnboardingVariantEnumApi =+ (typeof InboxOnboardingVariantEnumApi)[keyof typeof InboxOnboardingVariantEnumApi]++export const InboxOnboardingVariantEnumApi = {+ Control: 'control',+ Test: 'test',+} as const++export interface InboxOnboardingStateApi {+ /** Saved setup choices, without activating them. */+ draft: InboxOnboardingDraftApi | null+ /**+ * When verified setup completed.+ * @nullable+ */+ completed_at: string | null+ /** Variant recorded at the first eligible impression.+ *+ * * `control` - Control+ * * `test` - Focused steps */+ variant: InboxOnboardingVariantEnumApi | null+}++export interface InboxOnboardingExposureApi {+ /** Assigned experiment variant at the eligible Inbox impression.+ *+ * * `control` - Control+ * * `test` - Focused steps */+ variant: InboxOnboardingVariantEnumApi+}+export interface PauseStateResponseApi {/*** The timestamp the pipeline is paused until, or null if not paused/not running.@@ -3707,17 +4094,6 @@ export interface SignalScoutSkillSummaryApi {readonly allowed_tools: readonly string[]}-/**- * * `canonical` - canonical- * * `custom` - custom- */-export type ScoutOriginEnumApi = (typeof ScoutOriginEnumApi)[keyof typeof ScoutOriginEnumApi]--export const ScoutOriginEnumApi = {- Canonical: 'canonical',- Custom: 'custom',-} as const-export type ScoutRoleEnumApi = (typeof ScoutRoleEnumApi)[keyof typeof ScoutRoleEnumApi]export const ScoutRoleEnumApi = {@@ -4713,19 +5089,6 @@ export const TrialCriterionVerdictVerdictEnumApi = {NotApplicable: 'not_applicable',} as const-/**- * * `high` - high- * * `medium` - medium- * * `low` - low- */-export type ConfidenceTierEnumApi = (typeof ConfidenceTierEnumApi)[keyof typeof ConfidenceTierEnumApi]--export const ConfidenceTierEnumApi = {- High: 'high',- Medium: 'medium',- Low: 'low',-} as const-export interface TrialCriterionEvidenceApi {/** @maxLength 100 */source_id: string@@ -7572,51 +7935,6 @@ export const SignalScoutSuggestionSetStatusEnumApi = {LowActivity: 'low_activity',} as const-export interface ScoutSuggestionProposedConfigApi {- /**- * Suggested five-field cron schedule in the project timezone, or null for an interval.- * @nullable- */- run_cron_schedule?: string | null- /**- * Suggested minutes between runs when no cron is given; null means the daily default.- * @nullable- */- run_interval_minutes?: number | null- /** Whether the suggested scout should write to the inbox (false = dry run). */- emit: boolean-}--export interface ScoutSuggestionItemApi {- /** Stable id of this suggestion within the batch; use it to dismiss. */- id: string- /** `canonical`: enable a PostHog-authored scout that exists but is off. `custom`: create a drafted scout.- *- * * `canonical` - canonical- * * `custom` - custom */- kind: ScoutOriginEnumApi- /** The scout's `signals-scout-*` skill name (existing for canonical, proposed for custom). */- skill_name: string- /** Short sentence-case title: what the scout watches. */- title: string- /** Project-specific evidence for this suggestion, in prose. */- why_here: string- /** Custom only: the one-line description the scout would be created with. */- description: string- /** Custom only: the complete skill body the scout would be created with. */- draft_body: string- /** Suggested schedule and emit posture. */- proposed_config: ScoutSuggestionProposedConfigApi- /** True when nothing in the current fleet covers this. */- gap: boolean- /** The producer's confidence.- *- * * `low` - low- * * `medium` - medium- * * `high` - high */- confidence: ConfidenceTierEnumApi-}-export interface ScoutSuggestionSetApi {/** `fresh`: current batch. `stale`: the fleet changed since it was generated, or the batch aged past the refresh window. `failed`: the last refresh failed (items are the prior batch, if any). `empty`: nothing to suggest yet. `low_activity`: the project was too quiet to scan, so nothing was generated.*@@ -7644,161 +7962,6 @@ export interface ScoutSuggestionRefreshApi {workflow_id: string}-/**- * * `session_replay` - Session replay- * * `llm_analytics` - LLM analytics- * * `github` - GitHub- * * `linear` - Linear- * * `jira` - Jira- * * `zendesk` - Zendesk- * * `conversations` - Conversations- * * `error_tracking` - Error tracking- * * `pganalyze` - pganalyze- * * `signals_scout` - Signals scout- * * `signals_check` - Report check- * * `logs` - Logs- * * `health_checks` - Health checks- * * `endpoints` - Endpoints- * * `replay_vision` - Replay Vision- * * `analytics` - Product analytics- * * `freshdesk` - Freshdesk- * * `freshservice` - Freshservice- * * `front` - Front- * * `gorgias` - Gorgias- * * `kustomer` - Kustomer- * * `dixa` - Dixa- * * `plain` - Plain- * * `gitlab` - GitLab- * * `gitea` - Gitea- * * `shortcut` - Shortcut- * * `sentry` - Sentry- * * `rollbar` - Rollbar- * * `bugsnag` - Bugsnag- * * `honeybadger` - Honeybadger- * * `raygun` - Raygun- * * `snyk` - Snyk- * * `sonarqube` - SonarQube- * * `semgrep` - Semgrep- * * `rapid7_insightvm` - Rapid7 InsightVM- * * `featurebase` - Featurebase- * * `frill` - Frill- * * `aha` - Aha- * * `uservoice` - UserVoice- * * `productboard` - Productboard- * * `canny` - Canny- * * `asknicely` - AskNicely- * * `retently` - Retently- * * `appfigures` - Appfigures- * * `appfollow` - AppFollow- * * `judgeme_reviews` - Judge.me- * * `intercom` - Intercom- * * `hubspot` - HubSpot- * * `engineering_analytics` - Engineering analytics- * * `google_search_console` - Google Search Console- */-export type SignalSourceProductEnumApi = (typeof SignalSourceProductEnumApi)[keyof typeof SignalSourceProductEnumApi]--export const SignalSourceProductEnumApi = {- SessionReplay: 'session_replay',- LlmAnalytics: 'llm_analytics',- Github: 'github',- Linear: 'linear',- Jira: 'jira',- Zendesk: 'zendesk',- Conversations: 'conversations',- ErrorTracking: 'error_tracking',- Pganalyze: 'pganalyze',- SignalsScout: 'signals_scout',- SignalsCheck: 'signals_check',- Logs: 'logs',- HealthChecks: 'health_checks',- Endpoints: 'endpoints',- ReplayVision: 'replay_vision',- Analytics: 'analytics',- Freshdesk: 'freshdesk',- Freshservice: 'freshservice',- Front: 'front',- Gorgias: 'gorgias',- Kustomer: 'kustomer',- Dixa: 'dixa',- Plain: 'plain',- Gitlab: 'gitlab',- Gitea: 'gitea',- Shortcut: 'shortcut',- Sentry: 'sentry',- Rollbar: 'rollbar',- Bugsnag: 'bugsnag',- Honeybadger: 'honeybadger',- Raygun: 'raygun',- Snyk: 'snyk',- Sonarqube: 'sonarqube',- Semgrep: 'semgrep',- Rapid7Insightvm: 'rapid7_insightvm',- Featurebase: 'featurebase',- Frill: 'frill',- Aha: 'aha',- Uservoice: 'uservoice',- Productboard: 'productboard',- Canny: 'canny',- Asknicely: 'asknicely',- Retently: 'retently',- Appfigures: 'appfigures',- Appfollow: 'appfollow',- JudgemeReviews: 'judgeme_reviews',- Intercom: 'intercom',- Hubspot: 'hubspot',- EngineeringAnalytics: 'engineering_analytics',- GoogleSearchConsole: 'google_search_console',-} as const--/**- * * `session_analysis_cluster` - Session analysis cluster- * * `evaluation_report` - Evaluation report- * * `issue` - Issue- * * `ticket` - Ticket- * * `issue_created` - Issue created- * * `issue_reopened` - Issue reopened- * * `issue_spiking` - Issue spiking- * * `cross_source_issue` - Cross source issue- * * `alert_state_change` - Alert state change- * * `health_issue` - Health issue- * * `endpoint_execution_failed` - Endpoint execution failed- * * `endpoint_breakdown_limit_exceeded` - Endpoint breakdown limit exceeded- * * `scanner_finding` - Scanner finding- * * `anomaly_investigation` - Anomaly investigation- * * `feedback` - Feedback- * * `review` - Review- * * `ci_flaky_check` - CI flaky check- * * `ci_broken_default_branch` - CI broken default branch- * * `ci_duration_regression` - CI duration regression- * * `search_opportunity` - Search opportunity- */-export type SignalSourceConfigSourceTypeEnumApi =- (typeof SignalSourceConfigSourceTypeEnumApi)[keyof typeof SignalSourceConfigSourceTypeEnumApi]--export const SignalSourceConfigSourceTypeEnumApi = {- SessionAnalysisCluster: 'session_analysis_cluster',- EvaluationReport: 'evaluation_report',- Issue: 'issue',- Ticket: 'ticket',- IssueCreated: 'issue_created',- IssueReopened: 'issue_reopened',- IssueSpiking: 'issue_spiking',- CrossSourceIssue: 'cross_source_issue',- AlertStateChange: 'alert_state_change',- HealthIssue: 'health_issue',- EndpointExecutionFailed: 'endpoint_execution_failed',- EndpointBreakdownLimitExceeded: 'endpoint_breakdown_limit_exceeded',- ScannerFinding: 'scanner_finding',- AnomalyInvestigation: 'anomaly_investigation',- Feedback: 'feedback',- Review: 'review',- CiFlakyCheck: 'ci_flaky_check',- CiBrokenDefaultBranch: 'ci_broken_default_branch',- CiDurationRegression: 'ci_duration_regression',- SearchOpportunity: 'search_opportunity',-} as const-export type SignalSourceSyncStatusEnumApi =(typeof SignalSourceSyncStatusEnumApi)[keyof typeof SignalSourceSyncStatusEnumApi]@@ -8239,11 +8402,12 @@ export type SignalsScoutConfigTrialSetupParams = {export type SignalsScoutConfigSyncParams = {/**- * Which surface asked for the materialization, recorded on the `signals_scout_fleet_synced` analytics event so a fleet a person's tab-open delivered is separable from one the coordinator was going to deliver anyway. Omitted means unknown.+ * Which surface asked for the materialization, recorded on the `signals_scout_fleet_synced` analytics event so a fleet a person's tab-open delivered is separable from one the coordinator was going to deliver anyway. The onboarding surface creates new configs disabled until the user activates them. Omitted means unknown.** * `roster` - roster* * `desktop` - desktop* * `wizard` - wizard+ * * `onboarding` - onboarding* @minLength 1*/surface?: SignalsScoutConfigSyncSurface@@ -8256,6 +8420,7 @@ export const SignalsScoutConfigSyncSurface = {Roster: 'roster',Desktop: 'desktop',Wizard: 'wizard',+ Onboarding: 'onboarding',} as constexport type SignalsScoutMembersListParams = {diff --git a/products/signals/frontend/generated/api.ts b/products/signals/frontend/generated/api.tsindex d5ef191e917b..950226932d63 100644--- a/products/signals/frontend/generated/api.ts+++ b/products/signals/frontend/generated/api.ts@@ -21,6 +21,9 @@ import type {FleetFindingsSummaryApi,ForgetRequestApi,ForgetResponseApi,+ InboxOnboardingDraftApi,+ InboxOnboardingExposureApi,+ InboxOnboardingStateApi,InboxSummaryApi,LighthouseAuditRequestApi,LighthouseAuditResponseApi,@@ -233,6 +236,85 @@ export const signalsInboxSummaryList = async (projectId: string, options?: Reque})}+export const getSignalsOnboardingListUrl = (projectId: string) => {+ return `/api/projects/${projectId}/signals/onboarding/`+}++export const signalsOnboardingList = async (+ projectId: string,+ options?: RequestInit+): Promise<InboxOnboardingStateApi> => {+ return apiMutator<InboxOnboardingStateApi>(getSignalsOnboardingListUrl(projectId), {+ ...options,+ method: 'GET',+ })+}++export const getSignalsOnboardingCreateUrl = (projectId: string) => {+ return `/api/projects/${projectId}/signals/onboarding/`+}++export const signalsOnboardingCreate = async (+ projectId: string,+ inboxOnboardingDraftApi: InboxOnboardingDraftApi,+ options?: RequestInit+): Promise<InboxOnboardingStateApi> => {+ return apiMutator<InboxOnboardingStateApi>(getSignalsOnboardingCreateUrl(projectId), {+ ...options,+ method: 'POST',+ headers: { 'Content-Type': 'application/json', ...options?.headers },+ body: JSON.stringify(inboxOnboardingDraftApi),+ })+}++export const getSignalsOnboardingCompleteCreateUrl = (projectId: string) => {+ return `/api/projects/${projectId}/signals/onboarding/complete/`+}++export const signalsOnboardingCompleteCreate = async (+ projectId: string,+ inboxOnboardingDraftApi: InboxOnboardingDraftApi,+ options?: RequestInit+): Promise<InboxOnboardingStateApi> => {+ return apiMutator<InboxOnboardingStateApi>(getSignalsOnboardingCompleteCreateUrl(projectId), {+ ...options,+ method: 'POST',+ headers: { 'Content-Type': 'application/json', ...options?.headers },+ body: JSON.stringify(inboxOnboardingDraftApi),+ })+}++export const getSignalsOnboardingExposeCreateUrl = (projectId: string) => {+ return `/api/projects/${projectId}/signals/onboarding/expose/`+}++export const signalsOnboardingExposeCreate = async (+ projectId: string,+ inboxOnboardingExposureApi: InboxOnboardingExposureApi,+ options?: RequestInit+): Promise<InboxOnboardingStateApi> => {+ return apiMutator<InboxOnboardingStateApi>(getSignalsOnboardingExposeCreateUrl(projectId), {+ ...options,+ method: 'POST',+ headers: { 'Content-Type': 'application/json', ...options?.headers },+ body: JSON.stringify(inboxOnboardingExposureApi),+ })+}++export const getSignalsOnboardingReconcileCreateUrl = (projectId: string) => {+ return `/api/projects/${projectId}/signals/onboarding/reconcile/`+}++export const signalsOnboardingReconcileCreate = async (+ projectId: string,+ options?: RequestInit+): Promise<InboxOnboardingStateApi> => {+ return apiMutator<InboxOnboardingStateApi>(getSignalsOnboardingReconcileCreateUrl(projectId), {+ ...options,+ method: 'POST',+ })+}+export const getSignalsProcessingListUrl = (projectId: string, params?: SignalsProcessingListParams) => {const normalizedParams = new URLSearchParams()@@ -1967,7 +2049,7 @@ export const getSignalsScoutConfigSyncUrl = (projectId: string, params?: Signals}/**- * Materialize the scout fleet for this project on demand (idempotent): seed the canonical `signals-scout-*` skills, create a default-schedule config for any scout lacking one, retire the skills whose canonical scout no longer ships, and return all scout configs. Normally the Temporal coordinator does this on its next tick; this action exists so the scout UIs and setup flows (e.g. the wizard's self-driving program) can hand the user a tunable fleet immediately.+ * Materialize the scout fleet for this project on demand (idempotent): seed the canonical `signals-scout-*` skills, create a default-schedule config for any scout lacking one, retire the skills whose canonical scout no longer ships, and return all scout configs. Normally the Temporal coordinator does this on its next tick; this action exists so the scout UIs and setup flows (e.g. the wizard's self-driving program) can hand the user a tunable fleet immediately. With surface=onboarding, new configs stay disabled until explicitly activated.* @summary Sync scout configs*/export const signalsScoutConfigSync = async (diff --git a/products/signals/frontend/generated/api.zod.ts b/products/signals/frontend/generated/api.zod.tsindex 2529265941e7..7a50a46a7138 100644--- a/products/signals/frontend/generated/api.zod.ts+++ b/products/signals/frontend/generated/api.zod.ts@@ -121,6 +121,367 @@ export const SignalsConfigCreateBody = /* @__PURE__ */ zod.object({),})+export const signalsOnboardingCreateBodyScannerIdsMax = 100++export const signalsOnboardingCreateBodyActivationScoutsItemMax = 200++export const signalsOnboardingCreateBodyActivationScoutsMax = 50++export const SignalsOnboardingCreateBody = /* @__PURE__ */ zod.object({+ step: zod+ .enum(['signals', 'scouts', 'github'])+ .describe('\* `signals` - Signals\n\* `scouts` - Scouts\n\* `github` - GitHub')+ .describe(+ 'Step to resume after returning.\n\n\* `signals` - Signals\n\* `scouts` - Scouts\n\* `github` - GitHub'+ ),+ sources: zod+ .array(+ zod.object({+ source_product: zod+ .enum([+ 'session_replay',+ 'llm_analytics',+ 'github',+ 'linear',+ 'jira',+ 'zendesk',+ 'conversations',+ 'error_tracking',+ 'pganalyze',+ 'signals_scout',+ 'signals_check',+ 'logs',+ 'health_checks',+ 'endpoints',+ 'replay_vision',+ 'analytics',+ 'freshdesk',+ 'freshservice',+ 'front',+ 'gorgias',+ 'kustomer',+ 'dixa',+ 'plain',+ 'gitlab',+ 'gitea',+ 'shortcut',+ 'sentry',+ 'rollbar',+ 'bugsnag',+ 'honeybadger',+ 'raygun',+ 'snyk',+ 'sonarqube',+ 'semgrep',+ 'rapid7_insightvm',+ 'featurebase',+ 'frill',+ 'aha',+ 'uservoice',+ 'productboard',+ 'canny',+ 'asknicely',+ 'retently',+ 'appfigures',+ 'appfollow',+ 'judgeme_reviews',+ 'intercom',+ 'hubspot',+ 'engineering_analytics',+ 'google_search_console',+ ])+ .describe(+ '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ )+ .describe(+ 'Source product selected during setup.\n\n\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ ),+ source_type: zod+ .enum([+ 'session_analysis_cluster',+ 'evaluation_report',+ 'issue',+ 'ticket',+ 'issue_created',+ 'issue_reopened',+ 'issue_spiking',+ 'cross_source_issue',+ 'alert_state_change',+ 'health_issue',+ 'endpoint_execution_failed',+ 'endpoint_breakdown_limit_exceeded',+ 'scanner_finding',+ 'anomaly_investigation',+ 'feedback',+ 'review',+ 'ci_flaky_check',+ 'ci_broken_default_branch',+ 'ci_duration_regression',+ 'search_opportunity',+ ])+ .describe(+ '\* `session_analysis_cluster` - Session analysis cluster\n\* `evaluation_report` - Evaluation report\n\* `issue` - Issue\n\* `ticket` - Ticket\n\* `issue_created` - Issue created\n\* `issue_reopened` - Issue reopened\n\* `issue_spiking` - Issue spiking\n\* `cross_source_issue` - Cross source issue\n\* `alert_state_change` - Alert state change\n\* `health_issue` - Health issue\n\* `endpoint_execution_failed` - Endpoint execution failed\n\* `endpoint_breakdown_limit_exceeded` - Endpoint breakdown limit exceeded\n\* `scanner_finding` - Scanner finding\n\* `anomaly_investigation` - Anomaly investigation\n\* `feedback` - Feedback\n\* `review` - Review\n\* `ci_flaky_check` - CI flaky check\n\* `ci_broken_default_branch` - CI broken default branch\n\* `ci_duration_regression` - CI duration regression\n\* `search_opportunity` - Search opportunity'+ )+ .describe(+ 'Signal type selected during setup.\n\n\* `session_analysis_cluster` - Session analysis cluster\n\* `evaluation_report` - Evaluation report\n\* `issue` - Issue\n\* `ticket` - Ticket\n\* `issue_created` - Issue created\n\* `issue_reopened` - Issue reopened\n\* `issue_spiking` - Issue spiking\n\* `cross_source_issue` - Cross source issue\n\* `alert_state_change` - Alert state change\n\* `health_issue` - Health issue\n\* `endpoint_execution_failed` - Endpoint execution failed\n\* `endpoint_breakdown_limit_exceeded` - Endpoint breakdown limit exceeded\n\* `scanner_finding` - Scanner finding\n\* `anomaly_investigation` - Anomaly investigation\n\* `feedback` - Feedback\n\* `review` - Review\n\* `ci_flaky_check` - CI flaky check\n\* `ci_broken_default_branch` - CI broken default branch\n\* `ci_duration_regression` - CI duration regression\n\* `search_opportunity` - Search opportunity'+ ),+ enabled: zod.boolean().describe('Whether this source should be enabled at activation.'),+ })+ )+ .describe('Staged signal source choices.'),+ scanner_ids: zod+ .array(zod.uuid())+ .max(signalsOnboardingCreateBodyScannerIdsMax)+ .describe('Existing enabled scanners selected to emit signals.'),+ suggestions: zod+ .array(+ zod.object({+ id: zod.string().describe('Stable id of this suggestion within the batch; use it to dismiss.'),+ kind: zod+ .enum(['canonical', 'custom'])+ .describe('\* `canonical` - canonical\n\* `custom` - custom')+ .describe(+ '`canonical`: enable a PostHog-authored scout that exists but is off. `custom`: create a drafted scout.\n\n\* `canonical` - canonical\n\* `custom` - custom'+ ),+ skill_name: zod+ .string()+ .describe(+ "The scout's `signals-scout-\*` skill name (existing for canonical, proposed for custom)."+ ),+ title: zod.string().describe('Short sentence-case title: what the scout watches.'),+ why_here: zod.string().describe('Project-specific evidence for this suggestion, in prose.'),+ description: zod+ .string()+ .describe('Custom only: the one-line description the scout would be created with.'),+ draft_body: zod+ .string()+ .describe('Custom only: the complete skill body the scout would be created with.'),+ proposed_config: zod+ .object({+ run_cron_schedule: zod+ .string()+ .nullish()+ .describe(+ 'Suggested five-field cron schedule in the project timezone, or null for an interval.'+ ),+ run_interval_minutes: zod+ .number()+ .nullish()+ .describe(+ 'Suggested minutes between runs when no cron is given; null means the daily default.'+ ),+ emit: zod+ .boolean()+ .describe('Whether the suggested scout should write to the inbox (false = dry run).'),+ })+ .describe('Suggested schedule and emit posture.'),+ gap: zod.boolean().describe('True when nothing in the current fleet covers this.'),+ confidence: zod+ .enum(['high', 'medium', 'low'])+ .describe('\* `high` - high\n\* `medium` - medium\n\* `low` - low')+ .describe("The producer's confidence.\n\n\* `low` - low\n\* `medium` - medium\n\* `high` - high"),+ })+ )+ .describe('Selected scout suggestion drafts.'),+ activation_scouts: zod+ .array(zod.string().max(signalsOnboardingCreateBodyActivationScoutsItemMax))+ .max(signalsOnboardingCreateBodyActivationScoutsMax)+ .optional()+ .describe('Scouts enabled by an unfinished activation, retained to undo later deselections.'),+ automatic_implementation: zod.boolean().describe('Opt in to automatically creating pull requests.'),+ implementation_priority: zod+ .enum(['P0', 'P1', 'P2', 'P3', 'P4'])+ .describe('\* `P0` - P0\n\* `P1` - P1\n\* `P2` - P2\n\* `P3` - P3\n\* `P4` - P4')+ .describe(+ 'Lowest priority to implement automatically; P1 includes P0 and P1.\n\n\* `P0` - P0\n\* `P1` - P1\n\* `P2` - P2\n\* `P3` - P3\n\* `P4` - P4'+ ),+})++export const signalsOnboardingCompleteCreateBodyScannerIdsMax = 100++export const signalsOnboardingCompleteCreateBodyActivationScoutsItemMax = 200++export const signalsOnboardingCompleteCreateBodyActivationScoutsMax = 50++export const SignalsOnboardingCompleteCreateBody = /* @__PURE__ */ zod.object({+ step: zod+ .enum(['signals', 'scouts', 'github'])+ .describe('\* `signals` - Signals\n\* `scouts` - Scouts\n\* `github` - GitHub')+ .describe(+ 'Step to resume after returning.\n\n\* `signals` - Signals\n\* `scouts` - Scouts\n\* `github` - GitHub'+ ),+ sources: zod+ .array(+ zod.object({+ source_product: zod+ .enum([+ 'session_replay',+ 'llm_analytics',+ 'github',+ 'linear',+ 'jira',+ 'zendesk',+ 'conversations',+ 'error_tracking',+ 'pganalyze',+ 'signals_scout',+ 'signals_check',+ 'logs',+ 'health_checks',+ 'endpoints',+ 'replay_vision',+ 'analytics',+ 'freshdesk',+ 'freshservice',+ 'front',+ 'gorgias',+ 'kustomer',+ 'dixa',+ 'plain',+ 'gitlab',+ 'gitea',+ 'shortcut',+ 'sentry',+ 'rollbar',+ 'bugsnag',+ 'honeybadger',+ 'raygun',+ 'snyk',+ 'sonarqube',+ 'semgrep',+ 'rapid7_insightvm',+ 'featurebase',+ 'frill',+ 'aha',+ 'uservoice',+ 'productboard',+ 'canny',+ 'asknicely',+ 'retently',+ 'appfigures',+ 'appfollow',+ 'judgeme_reviews',+ 'intercom',+ 'hubspot',+ 'engineering_analytics',+ 'google_search_console',+ ])+ .describe(+ '\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ )+ .describe(+ 'Source product selected during setup.\n\n\* `session_replay` - Session replay\n\* `llm_analytics` - LLM analytics\n\* `github` - GitHub\n\* `linear` - Linear\n\* `jira` - Jira\n\* `zendesk` - Zendesk\n\* `conversations` - Conversations\n\* `error_tracking` - Error tracking\n\* `pganalyze` - pganalyze\n\* `signals_scout` - Signals scout\n\* `signals_check` - Report check\n\* `logs` - Logs\n\* `health_checks` - Health checks\n\* `endpoints` - Endpoints\n\* `replay_vision` - Replay Vision\n\* `analytics` - Product analytics\n\* `freshdesk` - Freshdesk\n\* `freshservice` - Freshservice\n\* `front` - Front\n\* `gorgias` - Gorgias\n\* `kustomer` - Kustomer\n\* `dixa` - Dixa\n\* `plain` - Plain\n\* `gitlab` - GitLab\n\* `gitea` - Gitea\n\* `shortcut` - Shortcut\n\* `sentry` - Sentry\n\* `rollbar` - Rollbar\n\* `bugsnag` - Bugsnag\n\* `honeybadger` - Honeybadger\n\* `raygun` - Raygun\n\* `snyk` - Snyk\n\* `sonarqube` - SonarQube\n\* `semgrep` - Semgrep\n\* `rapid7_insightvm` - Rapid7 InsightVM\n\* `featurebase` - Featurebase\n\* `frill` - Frill\n\* `aha` - Aha\n\* `uservoice` - UserVoice\n\* `productboard` - Productboard\n\* `canny` - Canny\n\* `asknicely` - AskNicely\n\* `retently` - Retently\n\* `appfigures` - Appfigures\n\* `appfollow` - AppFollow\n\* `judgeme_reviews` - Judge.me\n\* `intercom` - Intercom\n\* `hubspot` - HubSpot\n\* `engineering_analytics` - Engineering analytics\n\* `google_search_console` - Google Search Console'+ ),+ source_type: zod+ .enum([+ 'session_analysis_cluster',+ 'evaluation_report',+ 'issue',+ 'ticket',+ 'issue_created',+ 'issue_reopened',+ 'issue_spiking',+ 'cross_source_issue',+ 'alert_state_change',+ 'health_issue',+ 'endpoint_execution_failed',+ 'endpoint_breakdown_limit_exceeded',+ 'scanner_finding',+ 'anomaly_investigation',+ 'feedback',+ 'review',+ 'ci_flaky_check',+ 'ci_broken_default_branch',+ 'ci_duration_regression',+ 'search_opportunity',+ ])+ .describe(+ '\* `session_analysis_cluster` - Session analysis cluster\n\* `evaluation_report` - Evaluation report\n\* `issue` - Issue\n\* `ticket` - Ticket\n\* `issue_created` - Issue created\n\* `issue_reopened` - Issue reopened\n\* `issue_spiking` - Issue spiking\n\* `cross_source_issue` - Cross source issue\n\* `alert_state_change` - Alert state change\n\* `health_issue` - Health issue\n\* `endpoint_execution_failed` - Endpoint execution failed\n\* `endpoint_breakdown_limit_exceeded` - Endpoint breakdown limit exceeded\n\* `scanner_finding` - Scanner finding\n\* `anomaly_investigation` - Anomaly investigation\n\* `feedback` - Feedback\n\* `review` - Review\n\* `ci_flaky_check` - CI flaky check\n\* `ci_broken_default_branch` - CI broken default branch\n\* `ci_duration_regression` - CI duration regression\n\* `search_opportunity` - Search opportunity'+ )+ .describe(+ 'Signal type selected during setup.\n\n\* `session_analysis_cluster` - Session analysis cluster\n\* `evaluation_report` - Evaluation report\n\* `issue` - Issue\n\* `ticket` - Ticket\n\* `issue_created` - Issue created\n\* `issue_reopened` - Issue reopened\n\* `issue_spiking` - Issue spiking\n\* `cross_source_issue` - Cross source issue\n\* `alert_state_change` - Alert state change\n\* `health_issue` - Health issue\n\* `endpoint_execution_failed` - Endpoint execution failed\n\* `endpoint_breakdown_limit_exceeded` - Endpoint breakdown limit exceeded\n\* `scanner_finding` - Scanner finding\n\* `anomaly_investigation` - Anomaly investigation\n\* `feedback` - Feedback\n\* `review` - Review\n\* `ci_flaky_check` - CI flaky check\n\* `ci_broken_default_branch` - CI broken default branch\n\* `ci_duration_regression` - CI duration regression\n\* `search_opportunity` - Search opportunity'+ ),+ enabled: zod.boolean().describe('Whether this source should be enabled at activation.'),+ })+ )+ .describe('Staged signal source choices.'),+ scanner_ids: zod+ .array(zod.uuid())+ .max(signalsOnboardingCompleteCreateBodyScannerIdsMax)+ .describe('Existing enabled scanners selected to emit signals.'),+ suggestions: zod+ .array(+ zod.object({+ id: zod.string().describe('Stable id of this suggestion within the batch; use it to dismiss.'),+ kind: zod+ .enum(['canonical', 'custom'])+ .describe('\* `canonical` - canonical\n\* `custom` - custom')+ .describe(+ '`canonical`: enable a PostHog-authored scout that exists but is off. `custom`: create a drafted scout.\n\n\* `canonical` - canonical\n\* `custom` - custom'+ ),+ skill_name: zod+ .string()+ .describe(+ "The scout's `signals-scout-\*` skill name (existing for canonical, proposed for custom)."+ ),+ title: zod.string().describe('Short sentence-case title: what the scout watches.'),+ why_here: zod.string().describe('Project-specific evidence for this suggestion, in prose.'),+ description: zod+ .string()+ .describe('Custom only: the one-line description the scout would be created with.'),+ draft_body: zod+ .string()+ .describe('Custom only: the complete skill body the scout would be created with.'),+ proposed_config: zod+ .object({+ run_cron_schedule: zod+ .string()+ .nullish()+ .describe(+ 'Suggested five-field cron schedule in the project timezone, or null for an interval.'+ ),+ run_interval_minutes: zod+ .number()+ .nullish()+ .describe(+ 'Suggested minutes between runs when no cron is given; null means the daily default.'+ ),+ emit: zod+ .boolean()+ .describe('Whether the suggested scout should write to the inbox (false = dry run).'),+ })+ .describe('Suggested schedule and emit posture.'),+ gap: zod.boolean().describe('True when nothing in the current fleet covers this.'),+ confidence: zod+ .enum(['high', 'medium', 'low'])+ .describe('\* `high` - high\n\* `medium` - medium\n\* `low` - low')+ .describe("The producer's confidence.\n\n\* `low` - low\n\* `medium` - medium\n\* `high` - high"),+ })+ )+ .describe('Selected scout suggestion drafts.'),+ activation_scouts: zod+ .array(zod.string().max(signalsOnboardingCompleteCreateBodyActivationScoutsItemMax))+ .max(signalsOnboardingCompleteCreateBodyActivationScoutsMax)+ .optional()+ .describe('Scouts enabled by an unfinished activation, retained to undo later deselections.'),+ automatic_implementation: zod.boolean().describe('Opt in to automatically creating pull requests.'),+ implementation_priority: zod+ .enum(['P0', 'P1', 'P2', 'P3', 'P4'])+ .describe('\* `P0` - P0\n\* `P1` - P1\n\* `P2` - P2\n\* `P3` - P3\n\* `P4` - P4')+ .describe(+ 'Lowest priority to implement automatically; P1 includes P0 and P1.\n\n\* `P0` - P0\n\* `P1` - P1\n\* `P2` - P2\n\* `P3` - P3\n\* `P4` - P4'+ ),+})++export const SignalsOnboardingExposeCreateBody = /* @__PURE__ */ zod.object({+ variant: zod+ .enum(['control', 'test'])+ .describe('\* `control` - Control\n\* `test` - Focused steps')+ .describe(+ 'Assigned experiment variant at the eligible Inbox impression.\n\n\* `control` - Control\n\* `test` - Focused steps'+ ),+})+/*** View and control signal processing pipeline state for a team.*/diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 072cf73082c6..6a00d2a8c5ef 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -60577,6 +60577,383 @@ export namespace Schemas {working: ImpactWorking | null;}+ /**+ * * `signals` - Signals+ * * `scouts` - Scouts+ * * `github` - GitHub+ */+ export type InboxOnboardingStepEnum = typeof InboxOnboardingStepEnum[keyof typeof InboxOnboardingStepEnum];+++ export const InboxOnboardingStepEnum = {+ Signals: 'signals',+ Scouts: 'scouts',+ Github: 'github',+ } as const;++ /**+ * * `session_replay` - Session replay+ * * `llm_analytics` - LLM analytics+ * * `github` - GitHub+ * * `linear` - Linear+ * * `jira` - Jira+ * * `zendesk` - Zendesk+ * * `conversations` - Conversations+ * * `error_tracking` - Error tracking+ * * `pganalyze` - pganalyze+ * * `signals_scout` - Signals scout+ * * `signals_check` - Report check+ * * `logs` - Logs+ * * `health_checks` - Health checks+ * * `endpoints` - Endpoints+ * * `replay_vision` - Replay Vision+ * * `analytics` - Product analytics+ * * `freshdesk` - Freshdesk+ * * `freshservice` - Freshservice+ * * `front` - Front+ * * `gorgias` - Gorgias+ * * `kustomer` - Kustomer+ * * `dixa` - Dixa+ * * `plain` - Plain+ * * `gitlab` - GitLab+ * * `gitea` - Gitea+ * * `shortcut` - Shortcut+ * * `sentry` - Sentry+ * * `rollbar` - Rollbar+ * * `bugsnag` - Bugsnag+ * * `honeybadger` - Honeybadger+ * * `raygun` - Raygun+ * * `snyk` - Snyk+ * * `sonarqube` - SonarQube+ * * `semgrep` - Semgrep+ * * `rapid7_insightvm` - Rapid7 InsightVM+ * * `featurebase` - Featurebase+ * * `frill` - Frill+ * * `aha` - Aha+ * * `uservoice` - UserVoice+ * * `productboard` - Productboard+ * * `canny` - Canny+ * * `asknicely` - AskNicely+ * * `retently` - Retently+ * * `appfigures` - Appfigures+ * * `appfollow` - AppFollow+ * * `judgeme_reviews` - Judge.me+ * * `intercom` - Intercom+ * * `hubspot` - HubSpot+ * * `engineering_analytics` - Engineering analytics+ * * `google_search_console` - Google Search Console+ */+ export type SignalSourceProductEnum = typeof SignalSourceProductEnum[keyof typeof SignalSourceProductEnum];+++ export const SignalSourceProductEnum = {+ SessionReplay: 'session_replay',+ LlmAnalytics: 'llm_analytics',+ Github: 'github',+ Linear: 'linear',+ Jira: 'jira',+ Zendesk: 'zendesk',+ Conversations: 'conversations',+ ErrorTracking: 'error_tracking',+ Pganalyze: 'pganalyze',+ SignalsScout: 'signals_scout',+ SignalsCheck: 'signals_check',+ Logs: 'logs',+ HealthChecks: 'health_checks',+ Endpoints: 'endpoints',+ ReplayVision: 'replay_vision',+ Analytics: 'analytics',+ Freshdesk: 'freshdesk',+ Freshservice: 'freshservice',+ Front: 'front',+ Gorgias: 'gorgias',+ Kustomer: 'kustomer',+ Dixa: 'dixa',+ Plain: 'plain',+ Gitlab: 'gitlab',+ Gitea: 'gitea',+ Shortcut: 'shortcut',+ Sentry: 'sentry',+ Rollbar: 'rollbar',+ Bugsnag: 'bugsnag',+ Honeybadger: 'honeybadger',+ Raygun: 'raygun',+ Snyk: 'snyk',+ Sonarqube: 'sonarqube',+ Semgrep: 'semgrep',+ Rapid7Insightvm: 'rapid7_insightvm',+ Featurebase: 'featurebase',+ Frill: 'frill',+ Aha: 'aha',+ Uservoice: 'uservoice',+ Productboard: 'productboard',+ Canny: 'canny',+ Asknicely: 'asknicely',+ Retently: 'retently',+ Appfigures: 'appfigures',+ Appfollow: 'appfollow',+ JudgemeReviews: 'judgeme_reviews',+ Intercom: 'intercom',+ Hubspot: 'hubspot',+ EngineeringAnalytics: 'engineering_analytics',+ GoogleSearchConsole: 'google_search_console',+ } as const;++ /**+ * * `session_analysis_cluster` - Session analysis cluster+ * * `evaluation_report` - Evaluation report+ * * `issue` - Issue+ * * `ticket` - Ticket+ * * `issue_created` - Issue created+ * * `issue_reopened` - Issue reopened+ * * `issue_spiking` - Issue spiking+ * * `cross_source_issue` - Cross source issue+ * * `alert_state_change` - Alert state change+ * * `health_issue` - Health issue+ * * `endpoint_execution_failed` - Endpoint execution failed+ * * `endpoint_breakdown_limit_exceeded` - Endpoint breakdown limit exceeded+ * * `scanner_finding` - Scanner finding+ * * `anomaly_investigation` - Anomaly investigation+ * * `feedback` - Feedback+ * * `review` - Review+ * * `ci_flaky_check` - CI flaky check+ * * `ci_broken_default_branch` - CI broken default branch+ * * `ci_duration_regression` - CI duration regression+ * * `search_opportunity` - Search opportunity+ */+ export type SignalSourceConfigSourceTypeEnum = typeof SignalSourceConfigSourceTypeEnum[keyof typeof SignalSourceConfigSourceTypeEnum];+++ export const SignalSourceConfigSourceTypeEnum = {+ SessionAnalysisCluster: 'session_analysis_cluster',+ EvaluationReport: 'evaluation_report',+ Issue: 'issue',+ Ticket: 'ticket',+ IssueCreated: 'issue_created',+ IssueReopened: 'issue_reopened',+ IssueSpiking: 'issue_spiking',+ CrossSourceIssue: 'cross_source_issue',+ AlertStateChange: 'alert_state_change',+ HealthIssue: 'health_issue',+ EndpointExecutionFailed: 'endpoint_execution_failed',+ EndpointBreakdownLimitExceeded: 'endpoint_breakdown_limit_exceeded',+ ScannerFinding: 'scanner_finding',+ AnomalyInvestigation: 'anomaly_investigation',+ Feedback: 'feedback',+ Review: 'review',+ CiFlakyCheck: 'ci_flaky_check',+ CiBrokenDefaultBranch: 'ci_broken_default_branch',+ CiDurationRegression: 'ci_duration_regression',+ SearchOpportunity: 'search_opportunity',+ } as const;++ export interface InboxOnboardingSource {+ /** Source product selected during setup.+ *+ * * `session_replay` - Session replay+ * * `llm_analytics` - LLM analytics+ * * `github` - GitHub+ * * `linear` - Linear+ * * `jira` - Jira+ * * `zendesk` - Zendesk+ * * `conversations` - Conversations+ * * `error_tracking` - Error tracking+ * * `pganalyze` - pganalyze+ * * `signals_scout` - Signals scout+ * * `signals_check` - Report check+ * * `logs` - Logs+ * * `health_checks` - Health checks+ * * `endpoints` - Endpoints+ * * `replay_vision` - Replay Vision+ * * `analytics` - Product analytics+ * * `freshdesk` - Freshdesk+ * * `freshservice` - Freshservice+ * * `front` - Front+ * * `gorgias` - Gorgias+ * * `kustomer` - Kustomer+ * * `dixa` - Dixa+ * * `plain` - Plain+ * * `gitlab` - GitLab+ * * `gitea` - Gitea+ * * `shortcut` - Shortcut+ * * `sentry` - Sentry+ * * `rollbar` - Rollbar+ * * `bugsnag` - Bugsnag+ * * `honeybadger` - Honeybadger+ * * `raygun` - Raygun+ * * `snyk` - Snyk+ * * `sonarqube` - SonarQube+ * * `semgrep` - Semgrep+ * * `rapid7_insightvm` - Rapid7 InsightVM+ * * `featurebase` - Featurebase+ * * `frill` - Frill+ * * `aha` - Aha+ * * `uservoice` - UserVoice+ * * `productboard` - Productboard+ * * `canny` - Canny+ * * `asknicely` - AskNicely+ * * `retently` - Retently+ * * `appfigures` - Appfigures+ * * `appfollow` - AppFollow+ * * `judgeme_reviews` - Judge.me+ * * `intercom` - Intercom+ * * `hubspot` - HubSpot+ * * `engineering_analytics` - Engineering analytics+ * * `google_search_console` - Google Search Console */+ source_product: SignalSourceProductEnum;+ /** Signal type selected during setup.+ *+ * * `session_analysis_cluster` - Session analysis cluster+ * * `evaluation_report` - Evaluation report+ * * `issue` - Issue+ * * `ticket` - Ticket+ * * `issue_created` - Issue created+ * * `issue_reopened` - Issue reopened+ * * `issue_spiking` - Issue spiking+ * * `cross_source_issue` - Cross source issue+ * * `alert_state_change` - Alert state change+ * * `health_issue` - Health issue+ * * `endpoint_execution_failed` - Endpoint execution failed+ * * `endpoint_breakdown_limit_exceeded` - Endpoint breakdown limit exceeded+ * * `scanner_finding` - Scanner finding+ * * `anomaly_investigation` - Anomaly investigation+ * * `feedback` - Feedback+ * * `review` - Review+ * * `ci_flaky_check` - CI flaky check+ * * `ci_broken_default_branch` - CI broken default branch+ * * `ci_duration_regression` - CI duration regression+ * * `search_opportunity` - Search opportunity */+ source_type: SignalSourceConfigSourceTypeEnum;+ /** Whether this source should be enabled at activation. */+ enabled: boolean;+ }++ /**+ * * `canonical` - canonical+ * * `custom` - custom+ */+ export type ScoutOriginEnum = typeof ScoutOriginEnum[keyof typeof ScoutOriginEnum];+++ export const ScoutOriginEnum = {+ Canonical: 'canonical',+ Custom: 'custom',+ } as const;++ export interface ScoutSuggestionProposedConfig {+ /**+ * Suggested five-field cron schedule in the project timezone, or null for an interval.+ * @nullable+ */+ run_cron_schedule?: string | null;+ /**+ * Suggested minutes between runs when no cron is given; null means the daily default.+ * @nullable+ */+ run_interval_minutes?: number | null;+ /** Whether the suggested scout should write to the inbox (false = dry run). */+ emit: boolean;+ }++ export interface ScoutSuggestionItem {+ /** Stable id of this suggestion within the batch; use it to dismiss. */+ id: string;+ /** `canonical`: enable a PostHog-authored scout that exists but is off. `custom`: create a drafted scout.+ *+ * * `canonical` - canonical+ * * `custom` - custom */+ kind: ScoutOriginEnum;+ /** The scout's `signals-scout-*` skill name (existing for canonical, proposed for custom). */+ skill_name: string;+ /** Short sentence-case title: what the scout watches. */+ title: string;+ /** Project-specific evidence for this suggestion, in prose. */+ why_here: string;+ /** Custom only: the one-line description the scout would be created with. */+ description: string;+ /** Custom only: the complete skill body the scout would be created with. */+ draft_body: string;+ /** Suggested schedule and emit posture. */+ proposed_config: ScoutSuggestionProposedConfig;+ /** True when nothing in the current fleet covers this. */+ gap: boolean;+ /** The producer's confidence.+ *+ * * `low` - low+ * * `medium` - medium+ * * `high` - high */+ confidence: ConfidenceTierEnum;+ }++ export interface InboxOnboardingDraft {+ /** Step to resume after returning.+ *+ * * `signals` - Signals+ * * `scouts` - Scouts+ * * `github` - GitHub */+ step: InboxOnboardingStepEnum;+ /** Staged signal source choices. */+ sources: InboxOnboardingSource[];+ /**+ * Existing enabled scanners selected to emit signals.+ * @maxItems 100+ */+ scanner_ids: string[];+ /** Selected scout suggestion drafts. */+ suggestions: ScoutSuggestionItem[];+ /**+ * Scouts enabled by an unfinished activation, retained to undo later deselections.+ * @maxItems 50+ * @items.maxLength 200+ */+ activation_scouts?: string[];+ /** Opt in to automatically creating pull requests. */+ automatic_implementation: boolean;+ /** Lowest priority to implement automatically; P1 includes P0 and P1.+ *+ * * `P0` - P0+ * * `P1` - P1+ * * `P2` - P2+ * * `P3` - P3+ * * `P4` - P4 */+ implementation_priority: AutonomyPriorityEnum;+ }++ /**+ * * `control` - Control+ * * `test` - Focused steps+ */+ export type InboxOnboardingVariantEnum = typeof InboxOnboardingVariantEnum[keyof typeof InboxOnboardingVariantEnum];+++ export const InboxOnboardingVariantEnum = {+ Control: 'control',+ Test: 'test',+ } as const;++ export interface InboxOnboardingExposure {+ /** Assigned experiment variant at the eligible Inbox impression.+ *+ * * `control` - Control+ * * `test` - Focused steps */+ variant: InboxOnboardingVariantEnum;+ }++ export interface InboxOnboardingState {+ /** Saved setup choices, without activating them. */+ draft: InboxOnboardingDraft | null;+ /**+ * When verified setup completed.+ * @nullable+ */+ completed_at: string | null;+ /** Variant recorded at the first eligible impression.+ *+ * * `control` - Control+ * * `test` - Focused steps */+ variant: InboxOnboardingVariantEnum | null;+ }+export interface InboxSummaryPullRequest {/** GitHub repository in owner/name format. */repository: string;@@ -75085,162 +75462,6 @@ export namespace Schemas {ranker?: string | null;}- /**- * * `session_replay` - Session replay- * * `llm_analytics` - LLM analytics- * * `github` - GitHub- * * `linear` - Linear- * * `jira` - Jira- * * `zendesk` - Zendesk- * * `conversations` - Conversations- * * `error_tracking` - Error tracking- * * `pganalyze` - pganalyze- * * `signals_scout` - Signals scout- * * `signals_check` - Report check- * * `logs` - Logs- * * `health_checks` - Health checks- * * `endpoints` - Endpoints- * * `replay_vision` - Replay Vision- * * `analytics` - Product analytics- * * `freshdesk` - Freshdesk- * * `freshservice` - Freshservice- * * `front` - Front- * * `gorgias` - Gorgias- * * `kustomer` - Kustomer- * * `dixa` - Dixa- * * `plain` - Plain- * * `gitlab` - GitLab- * * `gitea` - Gitea- * * `shortcut` - Shortcut- * * `sentry` - Sentry- * * `rollbar` - Rollbar- * * `bugsnag` - Bugsnag- * * `honeybadger` - Honeybadger- * * `raygun` - Raygun- * * `snyk` - Snyk- * * `sonarqube` - SonarQube- * * `semgrep` - Semgrep- * * `rapid7_insightvm` - Rapid7 InsightVM- * * `featurebase` - Featurebase- * * `frill` - Frill- * * `aha` - Aha- * * `uservoice` - UserVoice- * * `productboard` - Productboard- * * `canny` - Canny- * * `asknicely` - AskNicely- * * `retently` - Retently- * * `appfigures` - Appfigures- * * `appfollow` - AppFollow- * * `judgeme_reviews` - Judge.me- * * `intercom` - Intercom- * * `hubspot` - HubSpot- * * `engineering_analytics` - Engineering analytics- * * `google_search_console` - Google Search Console- */- export type SignalSourceProductEnum = typeof SignalSourceProductEnum[keyof typeof SignalSourceProductEnum];--- export const SignalSourceProductEnum = {- SessionReplay: 'session_replay',- LlmAnalytics: 'llm_analytics',- Github: 'github',- Linear: 'linear',- Jira: 'jira',- Zendesk: 'zendesk',- Conversations: 'conversations',- ErrorTracking: 'error_tracking',- Pganalyze: 'pganalyze',- SignalsScout: 'signals_scout',- SignalsCheck: 'signals_check',- Logs: 'logs',- HealthChecks: 'health_checks',- Endpoints: 'endpoints',- ReplayVision: 'replay_vision',- Analytics: 'analytics',- Freshdesk: 'freshdesk',- Freshservice: 'freshservice',- Front: 'front',- Gorgias: 'gorgias',- Kustomer: 'kustomer',- Dixa: 'dixa',- Plain: 'plain',- Gitlab: 'gitlab',- Gitea: 'gitea',- Shortcut: 'shortcut',- Sentry: 'sentry',- Rollbar: 'rollbar',- Bugsnag: 'bugsnag',- Honeybadger: 'honeybadger',- Raygun: 'raygun',- Snyk: 'snyk',- Sonarqube: 'sonarqube',- Semgrep: 'semgrep',- Rapid7Insightvm: 'rapid7_insightvm',- Featurebase: 'featurebase',- Frill: 'frill',- Aha: 'aha',- Uservoice: 'uservoice',- Productboard: 'productboard',- Canny: 'canny',- Asknicely: 'asknicely',- Retently: 'retently',- Appfigures: 'appfigures',- Appfollow: 'appfollow',- JudgemeReviews: 'judgeme_reviews',- Intercom: 'intercom',- Hubspot: 'hubspot',- EngineeringAnalytics: 'engineering_analytics',- GoogleSearchConsole: 'google_search_console',- } as const;-- /**- * * `session_analysis_cluster` - Session analysis cluster- * * `evaluation_report` - Evaluation report- * * `issue` - Issue- * * `ticket` - Ticket- * * `issue_created` - Issue created- * * `issue_reopened` - Issue reopened- * * `issue_spiking` - Issue spiking- * * `cross_source_issue` - Cross source issue- * * `alert_state_change` - Alert state change- * * `health_issue` - Health issue- * * `endpoint_execution_failed` - Endpoint execution failed- * * `endpoint_breakdown_limit_exceeded` - Endpoint breakdown limit exceeded- * * `scanner_finding` - Scanner finding- * * `anomaly_investigation` - Anomaly investigation- * * `feedback` - Feedback- * * `review` - Review- * * `ci_flaky_check` - CI flaky check- * * `ci_broken_default_branch` - CI broken default branch- * * `ci_duration_regression` - CI duration regression- * * `search_opportunity` - Search opportunity- */- export type SignalSourceConfigSourceTypeEnum = typeof SignalSourceConfigSourceTypeEnum[keyof typeof SignalSourceConfigSourceTypeEnum];--- export const SignalSourceConfigSourceTypeEnum = {- SessionAnalysisCluster: 'session_analysis_cluster',- EvaluationReport: 'evaluation_report',- Issue: 'issue',- Ticket: 'ticket',- IssueCreated: 'issue_created',- IssueReopened: 'issue_reopened',- IssueSpiking: 'issue_spiking',- CrossSourceIssue: 'cross_source_issue',- AlertStateChange: 'alert_state_change',- HealthIssue: 'health_issue',- EndpointExecutionFailed: 'endpoint_execution_failed',- EndpointBreakdownLimitExceeded: 'endpoint_breakdown_limit_exceeded',- ScannerFinding: 'scanner_finding',- AnomalyInvestigation: 'anomaly_investigation',- Feedback: 'feedback',- Review: 'review',- CiFlakyCheck: 'ci_flaky_check',- CiBrokenDefaultBranch: 'ci_broken_default_branch',- CiDurationRegression: 'ci_duration_regression',- SearchOpportunity: 'search_opportunity',- } as const;-export type SignalSourceSyncStatusEnum = typeof SignalSourceSyncStatusEnum[keyof typeof SignalSourceSyncStatusEnum];@@ -99990,18 +100211,6 @@ export namespace Schemas {variant_analysis?: boolean;}- /**- * * `canonical` - canonical- * * `custom` - custom- */- export type ScoutOriginEnum = typeof ScoutOriginEnum[keyof typeof ScoutOriginEnum];--- export const ScoutOriginEnum = {- Canonical: 'canonical',- Custom: 'custom',- } as const;-export type ScoutRoleEnum = typeof ScoutRoleEnum[keyof typeof ScoutRoleEnum];@@ -101199,51 +101408,6 @@ export namespace Schemas {scopes: string[];}- export interface ScoutSuggestionProposedConfig {- /**- * Suggested five-field cron schedule in the project timezone, or null for an interval.- * @nullable- */- run_cron_schedule?: string | null;- /**- * Suggested minutes between runs when no cron is given; null means the daily default.- * @nullable- */- run_interval_minutes?: number | null;- /** Whether the suggested scout should write to the inbox (false = dry run). */- emit: boolean;- }-- export interface ScoutSuggestionItem {- /** Stable id of this suggestion within the batch; use it to dismiss. */- id: string;- /** `canonical`: enable a PostHog-authored scout that exists but is off. `custom`: create a drafted scout.- *- * * `canonical` - canonical- * * `custom` - custom */- kind: ScoutOriginEnum;- /** The scout's `signals-scout-*` skill name (existing for canonical, proposed for custom). */- skill_name: string;- /** Short sentence-case title: what the scout watches. */- title: string;- /** Project-specific evidence for this suggestion, in prose. */- why_here: string;- /** Custom only: the one-line description the scout would be created with. */- description: string;- /** Custom only: the complete skill body the scout would be created with. */- draft_body: string;- /** Suggested schedule and emit posture. */- proposed_config: ScoutSuggestionProposedConfig;- /** True when nothing in the current fleet covers this. */- gap: boolean;- /** The producer's confidence.- *- * * `low` - low- * * `medium` - medium- * * `high` - high */- confidence: ConfidenceTierEnum;- }-export interface ScoutSuggestionRefresh {/** The dispatched refresh workflow id. */workflow_id: string;@@ -131327,11 +131491,12 @@ export namespace Schemas {export type SignalsScoutConfigSyncParams = {/**- * Which surface asked for the materialization, recorded on the `signals_scout_fleet_synced` analytics event so a fleet a person's tab-open delivered is separable from one the coordinator was going to deliver anyway. Omitted means unknown.+ * Which surface asked for the materialization, recorded on the `signals_scout_fleet_synced` analytics event so a fleet a person's tab-open delivered is separable from one the coordinator was going to deliver anyway. The onboarding surface creates new configs disabled until the user activates them. Omitted means unknown.** * `roster` - roster* * `desktop` - desktop* * `wizard` - wizard+ * * `onboarding` - onboarding* @minLength 1*/surface?: SignalsScoutConfigSyncSurface;@@ -131344,6 +131509,7 @@ export namespace Schemas {Roster: 'roster',Desktop: 'desktop',Wizard: 'wizard',+ Onboarding: 'onboarding',} as const;export type SignalsScoutMembersListParams = {diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.tsindex f6406adaf07d..d1d9ac061a01 100644--- a/services/mcp/src/generated/signals/api.ts+++ b/services/mcp/src/generated/signals/api.ts@@ -2087,7 +2087,7 @@ export const SignalsScoutConfigTrialSetupQueryParams = () => zod.object({})/**- * Materialize the scout fleet for this project on demand (idempotent): seed the canonical `signals-scout-*` skills, create a default-schedule config for any scout lacking one, retire the skills whose canonical scout no longer ships, and return all scout configs. Normally the Temporal coordinator does this on its next tick; this action exists so the scout UIs and setup flows (e.g. the wizard's self-driving program) can hand the user a tunable fleet immediately.+ * Materialize the scout fleet for this project on demand (idempotent): seed the canonical `signals-scout-*` skills, create a default-schedule config for any scout lacking one, retire the skills whose canonical scout no longer ships, and return all scout configs. Normally the Temporal coordinator does this on its next tick; this action exists so the scout UIs and setup flows (e.g. the wizard's self-driving program) can hand the user a tunable fleet immediately. With surface=onboarding, new configs stay disabled until explicitly activated.* @summary Sync scout configs*/export const SignalsScoutConfigSyncParams = () => zod.object({@@ -2100,10 +2100,10 @@ export const SignalsScoutConfigSyncParams = () => zod.object({export const SignalsScoutConfigSyncQueryParams = () => zod.object({surface: zod- .enum(['roster', 'desktop', 'wizard'])+ .enum(['roster', 'desktop', 'wizard', 'onboarding']).optional().describe(- "Which surface asked for the materialization, recorded on the `signals_scout_fleet_synced` analytics event so a fleet a person's tab-open delivered is separable from one the coordinator was going to deliver anyway. Omitted means unknown.\n\n\* `roster` - roster\n\* `desktop` - desktop\n\* `wizard` - wizard"+ "Which surface asked for the materialization, recorded on the `signals_scout_fleet_synced` analytics event so a fleet a person's tab-open delivered is separable from one the coordinator was going to deliver anyway. The onboarding surface creates new configs disabled until the user activates them. Omitted means unknown.\n\n\* `roster` - roster\n\* `desktop` - desktop\n\* `wizard` - wizard\n\* `onboarding` - onboarding"),})diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-sync.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-sync.jsonindex ae87855e45bb..3efa09bf5f57 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-sync.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-sync.json@@ -2,8 +2,8 @@"$schema": "https://json-schema.org/draft/2020-12/schema","properties": {"surface": {- "description": "Which surface asked for the materialization, recorded on the `signals_scout_fleet_synced` analytics event so a fleet a person's tab-open delivered is separable from one the coordinator was going to deliver anyway. Omitted means unknown.\n\n* `roster` - roster\n* `desktop` - desktop\n* `wizard` - wizard",- "enum": ["roster", "desktop", "wizard"],+ "description": "Which surface asked for the materialization, recorded on the `signals_scout_fleet_synced` analytics event so a fleet a person's tab-open delivered is separable from one the coordinator was going to deliver anyway. The onboarding surface creates new configs disabled until the user activates them. Omitted means unknown.\n\n* `roster` - roster\n* `desktop` - desktop\n* `wizard` - wizard\n* `onboarding` - onboarding",+ "enum": ["roster", "desktop", "wizard", "onboarding"],"type": "string"}},diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-sync.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-sync.jsonindex ae87855e45bb..3efa09bf5f57 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-sync.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-sync.json@@ -2,8 +2,8 @@"$schema": "https://json-schema.org/draft/2020-12/schema","properties": {"surface": {- "description": "Which surface asked for the materialization, recorded on the `signals_scout_fleet_synced` analytics event so a fleet a person's tab-open delivered is separable from one the coordinator was going to deliver anyway. Omitted means unknown.\n\n* `roster` - roster\n* `desktop` - desktop\n* `wizard` - wizard",- "enum": ["roster", "desktop", "wizard"],+ "description": "Which surface asked for the materialization, recorded on the `signals_scout_fleet_synced` analytics event so a fleet a person's tab-open delivered is separable from one the coordinator was going to deliver anyway. The onboarding surface creates new configs disabled until the user activates them. Omitted means unknown.\n\n* `roster` - roster\n* `desktop` - desktop\n* `wizard` - wizard\n* `onboarding` - onboarding",+ "enum": ["roster", "desktop", "wizard", "onboarding"],"type": "string"}},