Skip to content

: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.

feat(signals): surface scout-run emit tally as first-class data (#62033)

Andrew Maguire2ca59d391269
diff --git a/products/signals/backend/migrations/0033_signalscoutrun_emitted_count_and_more.py b/products/signals/backend/migrations/0033_signalscoutrun_emitted_count_and_more.py
new file mode 100644
index 000000000000..e13507c51200
--- /dev/null
+++ b/products/signals/backend/migrations/0033_signalscoutrun_emitted_count_and_more.py
@@ -0,0 +1,22 @@
+# Generated by Django 5.2.14 on 2026-06-07 11:00
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("signals", "0032_signalteamconfig_autostart_base_branches"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="signalscoutrun",
+ name="emitted_count",
+ field=models.IntegerField(db_default=0, default=0, null=True),
+ ),
+ migrations.AddField(
+ model_name="signalscoutrun",
+ name="emitted_finding_ids",
+ field=models.JSONField(blank=True, db_default=[], default=list, null=True),
+ ),
+ ]
diff --git a/products/signals/backend/migrations/max_migration.txt b/products/signals/backend/migrations/max_migration.txt
index 5a957921231d..30a023988d7e 100644
--- a/products/signals/backend/migrations/max_migration.txt
+++ b/products/signals/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0032_signalteamconfig_autostart_base_branches
+0033_signalscoutrun_emitted_count_and_more
diff --git a/products/signals/backend/models.py b/products/signals/backend/models.py
index 5bf884142974..d77275373ce3 100644
--- a/products/signals/backend/models.py
+++ b/products/signals/backend/models.py
@@ -480,7 +480,9 @@ class SignalScoutRun(TeamScopedRootMixin, UUIDModel):
timing, error, and chat-log live on the `TaskRun`; emitted findings are
`Signal` / `SignalReport` rows created by `emit_signal`. This row carries only
the scout-specific fields that need to be queryable as real columns
- (`skill_name` for the per-team running-check, `scout_config` for audit lineage).
+ (`skill_name` for the per-team running-check, `scout_config` for audit lineage,
+ and the `emitted_count` / `emitted_finding_ids` emit tally so "did this run
+ surface anything?" is a column lookup, not a prose-`summary` parse).
"""
# See SignalScoutConfig.all_teams for rationale.
@@ -517,6 +519,19 @@ class SignalScoutRun(TeamScopedRootMixin, UUIDModel):
# emit any findings (and so left no `Signal` row to query against). Empty default
# so historical rows and mid-run reads return a string, not NULL.
summary = models.TextField(blank=True, default="", db_default="")
+ # Tally of findings this run actually emitted (preflight-skipped/dry-run emits don't
+ # count). Bumped post-success by `emit_finding`; kept as a real column so a run that
+ # surfaced something is queryable directly (the `emitted` filter on the list endpoint)
+ # instead of parsing the prose `summary`. NOT an idempotency barrier — re-emitting the
+ # same `finding_id` increments it again, just like it emits a second signal.
+ # Nullable (with a 0 `db_default`) so the AddField stays non-blocking on a table that
+ # already has rows — new and historical rows both read 0; NULL is permitted but never
+ # written by the ORM path.
+ emitted_count = models.IntegerField(null=True, default=0, db_default=0)
+ # The `finding_id`s behind `emitted_count`, in emit order — lets a caller tie a run back
+ # to its `Signal` rows (`source_id = run:<run_id>:finding:<finding_id>`) without a
+ # ClickHouse scan. Parallel to `emitted_count` (`len(emitted_finding_ids) == emitted_count`).
+ emitted_finding_ids = models.JSONField(null=True, blank=True, default=list, db_default=[])
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
diff --git a/products/signals/backend/scout_harness/serializers.py b/products/signals/backend/scout_harness/serializers.py
index 906d27fa9527..0bc5658e985b 100644
--- a/products/signals/backend/scout_harness/serializers.py
+++ b/products/signals/backend/scout_harness/serializers.py
@@ -59,6 +59,21 @@ class SignalScoutRunSummarySerializer(serializers.Serializer):
"runs that errored before close-out. The dedupe key for non-emitting runs."
),
)
+ emitted_count = serializers.IntegerField(
+ help_text=(
+ "Number of findings this run actually emitted to the inbox. 0 for runs that "
+ "investigated but surfaced nothing, or ran dry-run / before AI approval. "
+ "`> 0` means the run produced at least one `Signal`."
+ ),
+ )
+ emitted_finding_ids = serializers.ListField(
+ child=serializers.CharField(),
+ help_text=(
+ "The `finding_id`s behind `emitted_count`, in emit order. Each maps to a "
+ "`Signal` with `source_id = run:<run_id>:finding:<finding_id>`. Empty for "
+ "non-emitting runs."
+ ),
+ )
class SignalScoutRunDetailSerializer(SignalScoutRunSummarySerializer):
@@ -86,6 +101,14 @@ class SearchRecentRunsQuerySerializer(serializers.Serializer):
required=False,
help_text="Case-insensitive substring match on the scout's end-of-run `summary`. Omit to skip the filter.",
)
+ emitted = serializers.BooleanField(
+ required=False,
+ allow_null=True,
+ help_text=(
+ "Filter by emit outcome. `true` returns only runs that emitted at least one finding "
+ "(`emitted_count > 0`); `false` returns only runs that emitted nothing. Omit for both."
+ ),
+ )
limit = serializers.IntegerField(
required=False,
min_value=1,
diff --git a/products/signals/backend/scout_harness/tools/emit.py b/products/signals/backend/scout_harness/tools/emit.py
index 66b867c2a16e..75c0d47b6d53 100644
--- a/products/signals/backend/scout_harness/tools/emit.py
+++ b/products/signals/backend/scout_harness/tools/emit.py
@@ -4,11 +4,16 @@ Each finding is forwarded to `emit_signal` with a deterministic `source_id`:
`f"run:{run.id}:finding:{finding_id}"`. This is for traceability only — it is NOT
an idempotency barrier. The downstream pipeline assigns every signal a fresh random
`document_id` and dedupes on that, never on `source_id` (which it only stores in
-metadata), so a re-call with the same `finding_id` emits a *second* signal. The
-previous in-postgres idempotency layer (writing to `SignalScoutRun.findings` jsonb
-pre-emit, marking `emitted=True` post-success) was dropped in PR 2 review along with
-the `findings` field itself; this module no longer persists any scout-side state and
-provides no dedupe, so callers must not retry an emit that may have already succeeded.
+metadata), so a re-call with the same `finding_id` emits a *second* signal.
+
+Post-success we bump a scout-side tally on the run row (`emitted_count` +
+`emitted_finding_ids` via `_record_emit`) so "did this run surface anything?" is a
+column lookup rather than a prose-`summary` parse or a ClickHouse scan. The tally write
+is best-effort: a failure to record it never propagates out of the emit, because the
+signal has already fired and the caller must not be told the emit failed. It is
+observability only, NOT a dedupe layer — there is no scout-side idempotency, so callers
+must not retry an emit that may have already succeeded; a retry double-counts here
+exactly as it double-emits downstream.
Attribution (`scout_run_id`, `task_run_id`, `finding_id`, `skill_name`, `skill_version`)
is read off the run row so the agent never has to plumb it through. `task_run_id` is the
@@ -25,6 +30,8 @@ import logging
from dataclasses import asdict, dataclass
from typing import Any
+from django.db import transaction
+
from posthog.models import Team
from posthog.sync import database_sync_to_async
@@ -147,6 +154,7 @@ async def emit_finding(
weight=weight,
extra=extra,
)
+ await database_sync_to_async(_record_emit, thread_sensitive=False)(run_id=run.id, finding_id=finding_id)
logger.info(
"signals_scout.emit: emitted",
extra={**attempt_extra, "source_id": source_id},
@@ -227,6 +235,7 @@ def emit_finding_sync(
weight=weight,
extra=extra,
)
+ _record_emit(run_id=run.id, finding_id=finding_id)
logger.info(
"signals_scout.emit: emitted",
extra={**attempt_extra, "source_id": source_id},
@@ -311,6 +320,34 @@ def _new_finding_id() -> str:
return str(uuid.uuid4())
+def _record_emit(*, run_id: Any, finding_id: str) -> None:
+ """Bump the run's post-success emit tally: append `finding_id` and recount.
+
+ Best-effort and observability only — not a dedupe barrier (see the module docstring).
+ The emit has already fired by the time this runs, so **any** failure here (row gone,
+ lock timeout, transient DB error) is swallowed: surfacing it would make a succeeded
+ emit look failed and invite a double-emitting retry. Runs under `select_for_update` so
+ the read-modify-write on `emitted_finding_ids` is safe even though emits within a single
+ run are sequential today, and keeps `emitted_count` exactly `len(emitted_finding_ids)`
+ so the two never drift. Uses the unscoped `all_teams` manager because the caller already
+ validated `team`/`run` ownership and emit can run with no team scope set (Temporal
+ activity)."""
+ try:
+ with transaction.atomic():
+ run = SignalScoutRun.all_teams.select_for_update().filter(pk=run_id).first()
+ if run is None:
+ logger.warning("signals_scout.emit: run %s gone, skipping emit tally", run_id)
+ return
+ finding_ids = [*(run.emitted_finding_ids or []), finding_id]
+ run.emitted_finding_ids = finding_ids
+ run.emitted_count = len(finding_ids)
+ run.save(update_fields=["emitted_finding_ids", "emitted_count"])
+ except Exception:
+ # Tally is best-effort; the signal already emitted. Log and move on so the emit
+ # call returns success rather than a false failure the caller might retry.
+ logger.exception("signals_scout.emit: failed to record emit tally for run %s", run_id)
+
+
def _log_extra(
*,
team_id: int,
diff --git a/products/signals/backend/scout_harness/tools/runs.py b/products/signals/backend/scout_harness/tools/runs.py
index 6db2aac628ae..2dbf5bb11835 100644
--- a/products/signals/backend/scout_harness/tools/runs.py
+++ b/products/signals/backend/scout_harness/tools/runs.py
@@ -6,16 +6,17 @@ working on yesterday?"). Strictly team-scoped — no cross-team reads.
`SignalScoutRun` is a thin bridge to `tasks.TaskRun`: status, timestamps, and
error all flow from the linked TaskRun via `select_related("task_run")`. The
-only scout-owned content on the row itself is `summary` — the one-paragraph
-close-out the agent emits at end_turn, used as the dedupe key for runs that
-didn't emit any findings (and so left no `Signal` row to query against).
-Findings are recoverable as emitted `Signal` rows keyed by
+scout-owned content on the row itself is `summary` — the one-paragraph close-out
+the agent emits at end_turn, used as the dedupe key for runs that didn't emit any
+findings (and so left no `Signal` row to query against) — plus the
+`emitted_count` / `emitted_finding_ids` emit tally bumped post-success by
+`emit_finding`. Findings are recoverable as emitted `Signal` rows keyed by
`source_id = run:<run_id>:finding:<finding_id>`.
"""
from __future__ import annotations
-from dataclasses import asdict, dataclass
+from dataclasses import asdict, dataclass, field
from datetime import datetime
from typing import Any
@@ -37,6 +38,8 @@ class RunSummary:
started_at: str
completed_at: str | None
summary: str
+ emitted_count: int = 0
+ emitted_finding_ids: list[str] = field(default_factory=list)
task_id: str | None = None
task_run_id: str | None = None
task_url: str | None = None
@@ -61,6 +64,8 @@ class RunDetail:
started_at: str
completed_at: str | None
summary: str
+ emitted_count: int = 0
+ emitted_finding_ids: list[str] = field(default_factory=list)
task_id: str | None = None
task_run_id: str | None = None
task_url: str | None = None
@@ -75,6 +80,7 @@ def search_recent_runs(
date_from: datetime | None = None,
date_to: datetime | None = None,
text: str | None = None,
+ emitted: bool | None = None,
limit: int = DEFAULT_RUN_SEARCH_LIMIT,
) -> list[RunSummary]:
"""Return the most recent runs for a team, newest first.
@@ -85,7 +91,9 @@ def search_recent_runs(
backwards past the result cap on subsequent calls (cursor-style iteration).
`text` is a case-insensitive substring match on the agent's end-of-run
`summary` — the primary dedupe path for runs that didn't emit findings.
- Results are capped at `MAX_RUN_SEARCH_LIMIT`.
+ `emitted` filters on emit outcome: `True` keeps only runs that emitted at least
+ one finding (`emitted_count > 0`), `False` keeps only runs that emitted nothing;
+ omit it for both. Results are capped at `MAX_RUN_SEARCH_LIMIT`.
"""
clamped_limit = _clamp_limit(limit)
qs = SignalScoutRun.objects.filter(team_id=team_id).select_related("task_run").order_by("-created_at")
@@ -95,6 +103,8 @@ def search_recent_runs(
qs = qs.filter(created_at__lt=date_to)
if text:
qs = qs.filter(summary__icontains=text)
+ if emitted is not None:
+ qs = qs.filter(emitted_count__gt=0) if emitted else qs.filter(emitted_count=0)
qs = qs[:clamped_limit]
return [_to_summary(row, team_id=team_id) for row in qs]
@@ -123,6 +133,8 @@ def _to_summary(row: SignalScoutRun, *, team_id: int) -> RunSummary:
started_at=task_run.created_at.isoformat() if task_run is not None else row.created_at.isoformat(),
completed_at=task_run.completed_at.isoformat() if task_run is not None and task_run.completed_at else None,
summary=row.summary,
+ emitted_count=row.emitted_count or 0,
+ emitted_finding_ids=list(row.emitted_finding_ids or []),
task_id=task_id,
task_run_id=task_run_id,
task_url=_build_task_url(team_id=team_id, task_id=task_id, task_run_id=task_run_id),
diff --git a/products/signals/backend/scout_harness/views.py b/products/signals/backend/scout_harness/views.py
index cfbe2361cdb0..c42410e193e0 100644
--- a/products/signals/backend/scout_harness/views.py
+++ b/products/signals/backend/scout_harness/views.py
@@ -162,7 +162,8 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
"Used by the headless scout to dedupe against work other runs already covered. ILIKE "
"matches on `summary`. `date_from` / `date_to` are a half-open window on `created_at` "
"(`>= date_from`, `< date_to`); pass `date_to` on subsequent calls to walk past the "
- "100-row cap. Results capped at 100."
+ "100-row cap. Pass `emitted=true` to see only runs that surfaced at least one finding. "
+ "Results capped at 100."
),
)
def list(self, request: Request, *args, **kwargs) -> Response:
@@ -170,12 +171,14 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
date_from = validated.get("date_from")
date_to = validated.get("date_to")
text = validated.get("text") or None
+ emitted = validated.get("emitted")
limit = validated.get("limit") or 20
rows = search_recent_runs(
team_id=_canonical_team_id(self),
date_from=date_from,
date_to=date_to,
text=text,
+ emitted=emitted,
limit=limit,
)
return Response(SignalScoutRunSummarySerializer([row.as_dict() for row in rows], many=True).data)
diff --git a/products/signals/backend/test/test_scout_harness_api.py b/products/signals/backend/test/test_scout_harness_api.py
index 72b8f81d992b..2270569a2aec 100644
--- a/products/signals/backend/test/test_scout_harness_api.py
+++ b/products/signals/backend/test/test_scout_harness_api.py
@@ -6,6 +6,7 @@ from unittest.mock import AsyncMock, patch
from django.conf import settings
from django.test import override_settings
+from parameterized import parameterized
from rest_framework import status
from posthog.api.oauth.test_dcr import generate_rsa_key
@@ -127,6 +128,24 @@ class TestScoutHarnessRunsAPI(APIBaseTest):
ids = [row["run_id"] for row in response.json()]
assert ids == [str(keep.id)]
+ def test_list_surfaces_emit_tally(self) -> None:
+ _make_run(self.team, emitted_count=2, emitted_finding_ids=["f-a", "f-b"])
+ response = self.client.get(self._list_url())
+ assert response.status_code == status.HTTP_200_OK
+ row = response.json()[0]
+ assert row["emitted_count"] == 2
+ assert row["emitted_finding_ids"] == ["f-a", "f-b"]
+
+ @parameterized.expand([("emitted_true", "true"), ("emitted_false", "false")])
+ def test_list_emitted_filter_keeps_only_the_matching_runs(self, _name: str, emitted_param: str) -> None:
+ emitting = _make_run(self.team, emitted_count=1, emitted_finding_ids=["f-x"])
+ quiet = _make_run(self.team) # emitted_count defaults to 0
+ response = self.client.get(f"{self._list_url()}?emitted={emitted_param}")
+ assert response.status_code == status.HTTP_200_OK
+ ids = [row["run_id"] for row in response.json()]
+ expected = emitting if emitted_param == "true" else quiet
+ assert ids == [str(expected.id)]
+
def test_retrieve_returns_bridge_projection(self) -> None:
run = _make_run(self.team, summary="looked at /checkout, nothing actionable")
response = self.client.get(self._detail_url(str(run.id)))
@@ -138,6 +157,9 @@ class TestScoutHarnessRunsAPI(APIBaseTest):
# Status flows from the linked TaskRun (default fixture sets IN_PROGRESS).
assert body["status"] == TaskRun.Status.IN_PROGRESS
assert body["summary"] == "looked at /checkout, nothing actionable"
+ # Emit tally defaults surface even on a run that emitted nothing.
+ assert body["emitted_count"] == 0
+ assert body["emitted_finding_ids"] == []
def test_retrieve_unknown_id_returns_404(self) -> None:
response = self.client.get(self._detail_url("00000000-0000-0000-0000-000000000000"))
diff --git a/products/signals/backend/test/test_scout_harness_tools.py b/products/signals/backend/test/test_scout_harness_tools.py
index 8f2733fce53c..c5aefa750e2c 100644
--- a/products/signals/backend/test/test_scout_harness_tools.py
+++ b/products/signals/backend/test/test_scout_harness_tools.py
@@ -9,6 +9,7 @@ from unittest.mock import AsyncMock, patch
from django.utils import timezone
import pytest_asyncio
+from parameterized import parameterized
from posthog.models.scoping import team_scope
from posthog.sync import database_sync_to_async
@@ -159,6 +160,44 @@ class TestSearchRecentRuns(BaseTest):
assert detail is not None
assert detail.summary == "emit-free run; only known-noise patterns"
+ def test_emit_tally_round_trips_through_projection(self) -> None:
+ run = _create_run(self.team, emitted_count=2, emitted_finding_ids=["f-a", "f-b"])
+
+ hits = search_recent_runs(team_id=self.team.id, limit=1)
+
+ assert hits[0].emitted_count == 2
+ assert hits[0].emitted_finding_ids == ["f-a", "f-b"]
+ detail = get_run(team_id=self.team.id, run_id=str(run.id))
+ assert detail is not None
+ assert detail.emitted_count == 2
+ assert detail.emitted_finding_ids == ["f-a", "f-b"]
+
+ def test_emit_tally_defaults_to_zero_and_empty(self) -> None:
+ _create_run(self.team)
+
+ hits = search_recent_runs(team_id=self.team.id, limit=1)
+
+ assert hits[0].emitted_count == 0
+ assert hits[0].emitted_finding_ids == []
+
+ @parameterized.expand([("emitted_true", True), ("emitted_false", False)])
+ def test_emitted_filter_keeps_only_the_matching_runs(self, _name: str, emitted: bool) -> None:
+ emitting = _create_run(self.team, emitted_count=1, emitted_finding_ids=["f-x"])
+ quiet = _create_run(self.team) # emitted_count defaults to 0
+
+ hits = search_recent_runs(team_id=self.team.id, emitted=emitted)
+
+ expected = emitting if emitted else quiet
+ assert [h.run_id for h in hits] == [str(expected.id)]
+
+ def test_emitted_filter_omitted_returns_both(self) -> None:
+ _create_run(self.team, emitted_count=1, emitted_finding_ids=["f-x"])
+ _create_run(self.team)
+
+ hits = search_recent_runs(team_id=self.team.id)
+
+ assert len(hits) == 2
+
class TestGetRun(BaseTest):
def test_returns_full_run_payload(self) -> None:
@@ -658,6 +697,83 @@ async def test_emit_finding_fails_closed_when_config_missing(arun_emit, ateam_em
mock_emit.assert_not_called()
+# --- emit tally (emitted_count / emitted_finding_ids) tests ---
+
+
+async def test_emit_finding_records_tally_on_run(ateam_emit, arun_emit):
+ # Two successful emits bump emitted_count to 2 and append both finding_ids in order.
+ with patch("products.signals.backend.facade.api.emit_signal", new=AsyncMock()):
+ for fid in ("f-one", "f-two"):
+ await emit_finding(
+ team=ateam_emit,
+ run=arun_emit,
+ description="d",
+ weight=0.5,
+ confidence=0.5,
+ evidence=[EvidenceEntry(source_product="logs", summary="x")],
+ finding_id=fid,
+ )
+
+ await database_sync_to_async(arun_emit.refresh_from_db)()
+ assert arun_emit.emitted_count == 2
+ assert arun_emit.emitted_finding_ids == ["f-one", "f-two"]
+
+
+async def test_emit_finding_skip_does_not_record_tally(arun_emit, ateam_emit):
+ # A dry-run (preflight-skipped) emit must leave the tally untouched — only signals
+ # that actually fired count toward "did this run surface anything?".
+ await database_sync_to_async(
+ SignalScoutConfig.all_teams.filter(team=ateam_emit, skill_name=arun_emit.skill_name).update
+ )(emit=False)
+
+ with patch("products.signals.backend.facade.api.emit_signal", new=AsyncMock()):
+ result = await emit_finding(
+ team=ateam_emit,
+ run=arun_emit,
+ description="d",
+ weight=0.5,
+ confidence=0.5,
+ evidence=[EvidenceEntry(source_product="logs", summary="x")],
+ finding_id="f-skip",
+ )
+
+ assert result.emitted is False
+ await database_sync_to_async(arun_emit.refresh_from_db)()
+ assert arun_emit.emitted_count == 0
+ assert arun_emit.emitted_finding_ids == []
+
+
+async def test_emit_finding_succeeds_when_tally_write_fails(ateam_emit, arun_emit):
+ # The tally is best-effort: a DB failure recording it must NOT surface as a failed
+ # emit. The signal already fired, so a propagated error would invite a double-emitting
+ # retry on a non-idempotent endpoint.
+ with patch("products.signals.backend.facade.api.emit_signal", new=AsyncMock()):
+ # Fail only the tally write's row lock, not the preflight gate's config lookup
+ # (both go through the same manager), so we exercise _record_emit's swallow.
+ with patch.object(SignalScoutRun.all_teams, "select_for_update", side_effect=RuntimeError("db down")):
+ result = await emit_finding(
+ team=ateam_emit,
+ run=arun_emit,
+ description="d",
+ weight=0.5,
+ confidence=0.5,
+ evidence=[EvidenceEntry(source_product="logs", summary="x")],
+ finding_id="f-tally-fail",
+ )
+
+ assert result.emitted is True
+ assert result.skipped_reason is None
+ # The tally write blew up and was swallowed, so the row stays at its default.
+ await database_sync_to_async(arun_emit.refresh_from_db)()
+ assert arun_emit.emitted_count == 0
+
+
@pytest.mark.asyncio
@pytest.mark.django_db
async def test_emit_finding_fails_closed_when_config_deleted_then_recreated(arun_emit, ateam_emit):
diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.ts
index af258e157570..6ff83ee02000 100644
--- a/products/signals/frontend/generated/api.schemas.ts
+++ b/products/signals/frontend/generated/api.schemas.ts
@@ -784,6 +784,10 @@ export interface SignalScoutRunSummaryApi {
task_url?: string | null
/** One-paragraph close-out the scout wrote at end-of-run. Empty string for runs that errored before close-out. The dedupe key for non-emitting runs. */
summary: string
+ /** Number of findings this run actually emitted to the inbox. 0 for runs that investigated but surfaced nothing, or ran dry-run / before AI approval. `> 0` means the run produced at least one `Signal`. */
+ emitted_count: number
+ /** The `finding_id`s behind `emitted_count`, in emit order. Each maps to a `Signal` with `source_id = run:<run_id>:finding:<finding_id>`. Empty for non-emitting runs. */
+ emitted_finding_ids: string[]
}
/**
@@ -824,6 +828,10 @@ export interface SignalScoutRunDetailApi {
task_url?: string | null
/** One-paragraph close-out the scout wrote at end-of-run. Empty string for runs that errored before close-out. The dedupe key for non-emitting runs. */
summary: string
+ /** Number of findings this run actually emitted to the inbox. 0 for runs that investigated but surfaced nothing, or ran dry-run / before AI approval. `> 0` means the run produced at least one `Signal`. */
+ emitted_count: number
+ /** The `finding_id`s behind `emitted_count`, in emit order. Each maps to a `Signal` with `source_id = run:<run_id>:finding:<finding_id>`. Empty for non-emitting runs. */
+ emitted_finding_ids: string[]
}
/**
@@ -1183,6 +1191,11 @@ export type SignalsScoutRunsListParams = {
* ISO-8601 exclusive upper bound on `created_at`. Pass to walk back past the result cap on subsequent calls (cursor-style: set to the `started_at` of the oldest run from the prior page).
*/
date_to?: string
+ /**
+ * Filter by emit outcome. `true` returns only runs that emitted at least one finding (`emitted_count > 0`); `false` returns only runs that emitted nothing. Omit for both.
+ * @nullable
+ */
+ emitted?: boolean | null
/**
* Max rows to return (default 20, hard cap 100).
* @minimum 1
diff --git a/products/signals/frontend/generated/api.ts b/products/signals/frontend/generated/api.ts
index 2524415fe123..03ed5e385c6c 100644
--- a/products/signals/frontend/generated/api.ts
+++ b/products/signals/frontend/generated/api.ts
@@ -290,7 +290,7 @@ export const getSignalsScoutRunsListUrl = (projectId: string, params?: SignalsSc
}
/**
- * Return the most recent `SignalScoutRun` summaries for this project, newest first. Used by the headless scout to dedupe against work other runs already covered. ILIKE matches on `summary`. `date_from` / `date_to` are a half-open window on `created_at` (`>= date_from`, `< date_to`); pass `date_to` on subsequent calls to walk past the 100-row cap. Results capped at 100.
+ * Return the most recent `SignalScoutRun` summaries for this project, newest first. Used by the headless scout to dedupe against work other runs already covered. ILIKE matches on `summary`. `date_from` / `date_to` are a half-open window on `created_at` (`>= date_from`, `< date_to`); pass `date_to` on subsequent calls to walk past the 100-row cap. Pass `emitted=true` to see only runs that surfaced at least one finding. Results capped at 100.
* @summary Search recent agent runs
*/
export const signalsScoutRunsList = async (
diff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yaml
index 29e0ad3bd016..c8d40e219883 100644
--- a/products/signals/mcp/tools.yaml
+++ b/products/signals/mcp/tools.yaml
@@ -256,10 +256,12 @@ tools:
title: List recent scout runs
description: >
Return the most recent `SignalScoutRun` summaries for this project, newest first. Used by the headless scout
- to dedupe against work other runs already covered. Pass `text` for a case-insensitive substring match on the
- run's `summary` (the primary dedupe key for runs that didn't emit findings). Pass `date_from` / `date_to`
- (ISO-8601, inclusive lower / exclusive upper bound on `created_at`) to scope to a window. Results capped at
- 100.
+ to dedupe against work other runs already covered. Each row carries `emitted_count` (how many findings the
+ run surfaced to the inbox) and `emitted_finding_ids`. Pass `emitted=true` to return only runs that emitted
+ at least one finding (or `emitted=false` for runs that surfaced nothing). Pass `text` for a case-insensitive
+ substring match on the run's `summary` (the primary dedupe key for runs that didn't emit findings). Pass
+ `date_from` / `date_to` (ISO-8601, inclusive lower / exclusive upper bound on `created_at`) to scope to a
+ window. Results capped at 100.
signals-scout-runs-retrieve:
operation: signals_scout_runs_retrieve
enabled: true
@@ -271,9 +273,10 @@ tools:
idempotent: true
title: Get a scout run by ID
description: >
- Return the full `SignalScoutRun` row, including the agent's end-of-run `summary`. Status, timestamps, and
- error flow from the linked `tasks.TaskRun`; emitted findings live as `Signal` rows queryable by `source_id =
- run:<run_id>:finding:<finding_id>`. Strictly team-scoped — a UUID belonging to another team returns 404.
+ Return the full `SignalScoutRun` row, including the agent's end-of-run `summary`, `emitted_count`, and
+ `emitted_finding_ids`. Status, timestamps, and error flow from the linked `tasks.TaskRun`; emitted findings
+ live as `Signal` rows queryable by `source_id = run:<run_id>:finding:<finding_id>` (one per id in
+ `emitted_finding_ids`). Strictly team-scoped — a UUID belonging to another team returns 404.
signals-scout-scratchpad-forget:
operation: signals_scout_scratchpad_forget
enabled: true
diff --git a/products/signals/skills/exploring-signals-scouts/SKILL.md b/products/signals/skills/exploring-signals-scouts/SKILL.md
index dd83223a5e06..021bff5afdaf 100644
--- a/products/signals/skills/exploring-signals-scouts/SKILL.md
+++ b/products/signals/skills/exploring-signals-scouts/SKILL.md
@@ -37,7 +37,7 @@ There are five things you can observe about the fleet, each with its own tool:
| What you want to know | Tool | What it tells you |
| -------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------- |
| Which scouts run, how often, in what posture | `signals-scout-config-list` | One row per scout: schedule, `enabled`, `emit`, `last_run_at` |
-| What the scouts actually did, run by run | `signals-scout-runs-list` / `-retrieve` | Per-run status, timing, end-of-run summary, deep-link |
+| What the scouts actually did, run by run | `signals-scout-runs-list` / `-retrieve` | Per-run status, timing, end-of-run summary, `emitted_count`, deep-link |
| What the fleet has learned across runs | `signals-scout-scratchpad-search` | Durable per-team memory (baselines, noise, allowlists) |
| What the scouts actually **emitted** | `execute-sql` over `document_embeddings` | The authoritative per-finding record (weight, severity, confidence) — see below |
| What the scouts surfaced to the user | `inbox-reports-list` | Findings that cleared the bar and became inbox reports |
@@ -148,11 +148,15 @@ call out anything anomalous (never run, last run errored, stuck in dry-run for a
- **Search summaries** with `text` — a case-insensitive substring match on each run's end-of-run
`summary`. This is how the headless scout dedupes, and it's how you find "did any run already
look at the checkout error spike?"
+- **Filter by emit outcome** with `emitted` — `emitted=true` returns only runs that surfaced at
+ least one finding, `emitted=false` only the quiet runs. This is the direct way to answer "which
+ runs actually emitted something?" without parsing prose.
Each summary row carries `run_id`, `skill_name`, `skill_version`, `status`, `started_at`,
-`completed_at`, `task_url` (a deep-link into the Tasks UI for the full transcript), and the
-`summary` prose. Lead with the `summary` when narrating to the user — it's the scout's own
-plain-language close-out — and always offer the `task_url` for the full reasoning.
+`completed_at`, `emitted_count` (how many findings the run emitted), `emitted_finding_ids` (their
+ids), `task_url` (a deep-link into the Tasks UI for the full transcript), and the `summary` prose.
+Lead with the `summary` when narrating to the user — it's the scout's own plain-language close-out —
+and always offer the `task_url` for the full reasoning.
## Workflow: drill into a single run
@@ -167,11 +171,12 @@ Note the field name flip: `runs-list` returns each run's id as `run_id`, but `ru
takes it as `id`. Pass the `run_id` value through as `id`.
Returns the full run: `status`, `started_at` / `completed_at` (compute duration from these),
-`skill_name` / `skill_version` (what ran, at what body version), the end-of-run `summary`, and
-`task_url`. The transcript — the actual tool calls and reasoning — lives in the Tasks UI behind
-`task_url`, not in this payload; hand the user that link when they want to see every step. A
-**failed** run returns an empty `summary` and **no error field** — the payload looks the same as
-the list row, so to learn _why_ it failed you need the transcript.
+`skill_name` / `skill_version` (what ran, at what body version), the end-of-run `summary`,
+`emitted_count` / `emitted_finding_ids`, and `task_url`. The transcript — the actual tool calls and
+reasoning — lives in the Tasks UI behind `task_url`, not in this payload; hand the user that link
+when they want to see every step. A **failed** run returns an empty `summary` and **no error
+field** — the payload looks the same as the list row, so to learn _why_ it failed you need the
+transcript.
You don't have to open the UI for that: **`tasks-runs-session-logs-retrieve` returns the run's
session log (every tool call, message, and reasoning step) as data** — handy when you're
@@ -190,16 +195,15 @@ you with tool _names_ but no idea what the scout actually queried. Fetch the **f
the script reassemble each call (it groups by `toolCallId`, keeps the richest `rawInput`, and
attaches the completion's `rawOutput`/`status`).
-**Telling whether a run emitted is not as direct as you'd hope.** The run row carries no emit
-flag and no finding count — the only readily-available signal is the prose `summary`, which says
-"EMITTED nothing" on a quiet run and names what it emitted otherwise. Read it carefully: a phrase
-like "already emitted P1 … did not re-emit" describes a _prior_ run and means this run emitted
-nothing, so substring-matching the summary for "emitted" is unreliable. Findings do carry a
-deterministic `source_id = run:<run_id>:finding:<finding_id>`, but it's stored in the signal's
-`metadata.extra` (not a top-level field) and grouping merges scout findings into the same
-clusters as other sources, so the `source_product: "signals_scout"` inbox filter does **not**
-reliably surface them. See [`references/scout-data-model.md`](references/scout-data-model.md) for
-the run-to-finding link and its limits.
+**Whether a run emitted is a first-class field: `emitted_count`.** `emitted_count > 0` means the
+run surfaced that many findings; `emitted_count: 0` means it closed out empty. Don't parse the prose
+`summary` for this any more — a phrase like "already emitted P1 … did not re-emit" describes a
+_prior_ run, so substring-matching the summary for "emitted" is unreliable, whereas `emitted_count`
+is the authoritative tally. `emitted_finding_ids` lists the `finding_id`s behind that count, in emit
+order; each maps to a `Signal` with `source_id = run:<run_id>:finding:<finding_id>`, giving a
+reliable run → finding link. See [`references/scout-data-model.md`](references/scout-data-model.md)
+for the run-to-finding link and how an emitted finding rides through grouping into the
+`source_product: "signals_scout"` inbox filter.
A run with `status` complete and an empty-handed summary ("surface at baseline, nothing to
emit") is a **healthy** outcome, not a failure — most runs should close out empty. Treat a stream
@@ -286,11 +290,13 @@ result is the set of reports the fleet has surfaced.
An empty result means the fleet hasn't emitted (yet), **not** that the filter is broken. Scouts hold
a high bar — most runs close out without emitting — so on a quiet or newly enrolled project zero
-scout-backed reports is the normal, expected state. Read it as "nothing surfaced," and fall back to
-each run's `summary` for the per-run record of what was (or wasn't) emitted. To browse the inbox more
-broadly, use the [`inbox-exploration`](../inbox-exploration/SKILL.md) skill (statuses, suggested
-reviewers, drilling into a report's underlying signals). The emit contract behind each finding —
-weight, confidence, severity, the description prose — is documented in
+scout-backed reports is the normal, expected state. For the per-run view of what emitted, work from
+the runs instead: `signals-scout-runs-list?emitted=true` lists every emitting run, and each run's
+`emitted_count` / `emitted_finding_ids` tell you how many and which findings it produced (each
+`finding_id` maps to a `Signal` with `source_id = run:<run_id>:finding:<finding_id>`). To browse the
+inbox more broadly, use the [`inbox-exploration`](../inbox-exploration/SKILL.md) skill (statuses,
+suggested reviewers, drilling into a report's underlying signals). The emit contract behind each
+finding — weight, confidence, severity, the description prose — is documented in
[`../authoring-signals-scouts/references/emit-contract.md`](../authoring-signals-scouts/references/emit-contract.md).
## Workflow: assess health and performance
@@ -308,11 +314,13 @@ below. The full playbook, including how to read each signal and the common failu
backed up / down, or runs stranded), which `runs-list` alone hides.
- **Success rate** — how many runs reach a clean `status` vs. error out? A run of errors is a
broken scout, not a quiet one.
-- **Emit rate** — what fraction of runs emitted vs. closed out empty. Near-zero over a long window
- on a live surface can mean the discriminator is too strict (or the surface really is quiet);
- near-100% usually means it's too noisy. Most healthy scouts emit rarely.
+- **Emit rate** — what fraction of runs emitted vs. closed out empty. Read it straight off
+ `emitted_count` per run (or split the window with `runs-list?emitted=true` / `?emitted=false`).
+ Near-zero over a long window on a live surface can mean the discriminator is too strict (or the
+ surface really is quiet); near-100% usually means it's too noisy. Most healthy scouts emit rarely.
- **Signal-to-noise** — of what it emitted, how much became actionable inbox reports vs. got
- suppressed? Cross-check emitted findings against `inbox-reports-list` report states.
+ suppressed? Use each emitting run's `emitted_finding_ids` to tie runs to their `Signal` rows, and
+ cross-check against `inbox-reports-list` report states.
- **Memory growth** — a healthy scout accumulates `pattern:` / `noise:` / `dedupe:` entries over
time. A scout with an empty scratchpad after many runs isn't learning.
@@ -423,9 +431,10 @@ disabled) or failed.
a user thinks a scout is broken when it isn't.
- **An empty close-out is success.** Most runs should find nothing. Don't report a wall of clean,
empty runs as a problem.
-- **There's no emit flag to filter on.** Neither the run row nor the inbox exposes a clean
- "scout-emitted" filter — judge emit-vs-quiet from each run's `summary`, and don't read an empty
- `source_product: "signals_scout"` inbox result as "the fleet emitted nothing."
+- **Emit-vs-quiet is a first-class run field.** Filter runs directly with `runs-list?emitted=true`
+ (or read `emitted_count` per run) to find what emitted, without parsing the prose `summary`. The
+ `source_product: "signals_scout"` inbox filter lists the _reports_ the fleet surfaced; an empty
+ result there means it hasn't emitted yet (scouts hold a high bar), not that the filter is broken.
- **A ~30-min run that `failed` is usually a timeout, not a broken scout.** Completed runs finish
in a couple of minutes. Most often the scout over-investigated and ran the full budget (the fleet
self-corrects by writing "tight-run recipe" scratchpad entries) — but some are false timeouts
diff --git a/products/signals/skills/exploring-signals-scouts/references/assessing-performance.md b/products/signals/skills/exploring-signals-scouts/references/assessing-performance.md
index 4140e5440b52..6853ed427241 100644
--- a/products/signals/skills/exploring-signals-scouts/references/assessing-performance.md
+++ b/products/signals/skills/exploring-signals-scouts/references/assessing-performance.md
@@ -13,11 +13,12 @@ signals-scout-runs-list
```
Filter the result to the scout's `skill_name`, then reason across the dimensions, reading each
-run's `summary`. Learned memory comes from `signals-scout-scratchpad-search`. Note up front: there
-is **no emit flag or finding count on a run**, and `inbox-reports-list { "source_product":
-"signals_scout" }` does not reliably surface scout output (grouping attributes findings to the
-underlying product) — so emit-related dimensions below are read from the run summaries, not a clean
-metric.
+run's `summary`. Learned memory comes from `signals-scout-scratchpad-search`. Note up front: each
+run carries `emitted_count` / `emitted_finding_ids` (and the list endpoint takes an `emitted`
+filter), so emit volume is a clean metric off the runs themselves — and `inbox-reports-list {
+"source_product": "signals_scout" }` lists the reports the fleet surfaced (the tag rides through
+grouping). Read the two together: the runs tell you how often the scout spoke, the inbox filter what
+cleared the bar into an actionable report.
## The dimensions
@@ -53,8 +54,9 @@ so don't infer over-investigation from the ~30-minute duration alone.
### 3. Emit rate — how often does it speak?
-Of completed runs, what fraction emitted a finding vs. closed out empty? You read this from the run
-`summaries` (no emit metric exists). Judge it against the surface, not in the abstract — **most
+Of completed runs, what fraction emitted a finding vs. closed out empty? Read it straight off each
+run's `emitted_count` (`> 0` = emitted), or split the window with `runs-list?emitted=true` /
+`?emitted=false` and compare counts. Judge it against the surface, not in the abstract — **most
healthy scouts emit rarely**, and on a quiet, mature project nearly every run legitimately closes
out empty.
@@ -68,11 +70,13 @@ out empty.
### 4. Signal-to-noise — was the output worth it?
-Of what the scout emitted, how much was actionable vs. dismissed as noise? You can't filter the
-inbox to `source_product: "signals_scout"` (grouping attributes findings to the underlying product,
-so that filter returns nothing), so judge this from the run summaries plus the scratchpad: a
-healthy scout's summaries describe deliberate, calibrated emits and the scratchpad fills with
-`dedupe:` / `noise:` / `addressed:` entries as it learns what not to re-raise.
+Of what the scout emitted, how much was actionable vs. dismissed as noise? You know _how much_ it
+emitted from `emitted_count`, and `emitted_finding_ids` ties each emitting run to its `Signal` rows.
+For the downstream fate, `inbox-reports-list { "source_product": "signals_scout" }` lists the
+scout-backed reports — cross-check their states against the emit volume, and read the run summaries
+plus the scratchpad for the qualitative picture: a healthy scout's summaries describe deliberate,
+calibrated emits and the scratchpad fills with `dedupe:` / `noise:` / `addressed:` entries as it
+learns what not to re-raise.
- **Diagnosis if it looks noisy:** if summaries show the same thing emitted repeatedly, or the
scratchpad lacks `dedupe:` entries for things it has flagged, its dedupe memory isn't working —
diff --git a/products/signals/skills/exploring-signals-scouts/references/scout-data-model.md b/products/signals/skills/exploring-signals-scouts/references/scout-data-model.md
index 7897d23116c5..9fb41e9af628 100644
--- a/products/signals/skills/exploring-signals-scouts/references/scout-data-model.md
+++ b/products/signals/skills/exploring-signals-scouts/references/scout-data-model.md
@@ -30,17 +30,19 @@ shape). Each run is one sandboxed agent execution of one scout. The run is a thi
`runs-retrieve` takes the run id as `id`, **not** `run_id` — even though the list and the detail
payload both name the field `run_id`. Pass the list's `run_id` value through as `id`.
-| Field | Meaning |
-| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `run_id` | UUID of the run. Pass it to `runs-retrieve` as `id`. Strictly team-scoped (404 across teams). |
-| `skill_name` | Which scout ran. |
-| `skill_version` | The body version that ran. If a scout was edited, older runs ran an older version — useful when comparing behavior before/after a change. |
-| `status` | Run outcome, from the linked `TaskRun` (see below). |
-| `started_at` | ISO-8601 — when the `TaskRun` was created. |
-| `completed_at` | ISO-8601 — when it finished. `null` while in flight. Duration = `completed_at - started_at`. |
-| `task_id`, `task_run_id` | Identifiers on the Tasks side. |
-| `task_url` | Relative deep-link to the Tasks UI for this run — **the full transcript** (every tool call and reasoning step) lives here, not in the run payload. |
-| `summary` | The scout's own one-paragraph end-of-run close-out. The primary thing to read and relay. Empty for runs that errored before close-out. |
+| Field | Meaning |
+| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `run_id` | UUID of the run. Pass it to `runs-retrieve` as `id`. Strictly team-scoped (404 across teams). |
+| `skill_name` | Which scout ran. |
+| `skill_version` | The body version that ran. If a scout was edited, older runs ran an older version — useful when comparing behavior before/after a change. |
+| `status` | Run outcome, from the linked `TaskRun` (see below). |
+| `started_at` | ISO-8601 — when the `TaskRun` was created. |
+| `completed_at` | ISO-8601 — when it finished. `null` while in flight. Duration = `completed_at - started_at`. |
+| `emitted_count` | How many findings the run emitted to the inbox. `0` = closed out empty (most runs); `> 0` = surfaced something. The authoritative emit tally for runs from when the field shipped onward — don't infer emit-vs-quiet from the prose `summary`. (Runs that predate the field read `0` and aren't backfilled; for those, fall back to the `summary`.) |
+| `emitted_finding_ids` | The `finding_id`s behind `emitted_count`, in emit order. Each maps to a `Signal` with `source_id = run:<run_id>:finding:<finding_id>`. Empty for non-emitting runs. |
+| `task_id`, `task_run_id` | Identifiers on the Tasks side. |
+| `task_url` | Relative deep-link to the Tasks UI for this run — **the full transcript** (every tool call and reasoning step) lives here, not in the run payload. |
+| `summary` | The scout's own one-paragraph end-of-run close-out. The primary thing to read and relay. Empty for runs that errored before close-out. |
### Run status values
@@ -48,7 +50,7 @@ payload both name the field `run_id`. Pass the list's `run_id` value through as
as a **healthy quiet run**, not a failure — most runs should close out empty.
- in-flight / started — currently running (`completed_at` null).
-- completed — finished cleanly. May or may not have emitted; read the `summary`.
+- completed — finished cleanly. May or may not have emitted; check `emitted_count` (`0` = quiet).
- failed — the run errored before closing out. Its `summary` is empty and the payload exposes
**no error field** — read the transcript to see what went wrong (open `task_url`, or pull it as
data with `tasks-runs-session-logs-retrieve`). In practice the common failure is a ~30-minute
@@ -60,27 +62,34 @@ as a **healthy quiet run**, not a failure — most runs should close out empty.
(The exact string set comes from the Tasks `TaskRun` model; match leniently — read the `summary`
and `completed_at` together rather than keying on one status string.)
-## Run → finding link (and why it's awkward)
+## Run → finding link
-Findings are **not** stored on the run row, and there is no emit flag or finding count on it
-either — so you cannot query "which runs emitted" directly from the run. When a scout emits, the
-finding goes through `emit_signal()` with `source_product="signals_scout"` /
-`source_type="cross_source_issue"` and flows through the same grouping pipeline as every other
-source. Each finding gets a deterministic `source_id = run:<run_id>:finding:<finding_id>`:
+The run row **does** tell you whether and what it emitted: `emitted_count` is the authoritative
+tally (bumped post-success on each emit; preflight-skipped / dry-run emits don't count) and
+`emitted_finding_ids` lists the `finding_id`s behind it. Filter the list endpoint with
+`emitted=true` / `emitted=false` to slice runs by outcome without reading any prose. A run with
+`emitted_count: 0` closed out empty — expected and correct most of the time.
+
+To go from a run to its actual `Signal` rows: when a scout emits, the finding goes through
+`emit_signal()` with `source_product="signals_scout"` / `source_type="cross_source_issue"` and each
+finding gets a deterministic `source_id = run:<run_id>:finding:<finding_id>` — one per id in
+`emitted_finding_ids`:
- The `source_id` is stored at the **top level** of the signal's `metadata` (i.e.
`metadata.source_id`), alongside `metadata.source_product` — not inside `metadata.extra`. Grouping
v2 generates its own `document_id` and dedupes on that — never on `source_id` — so re-emitting the
- same `finding_id` creates a second signal rather than updating the first.
+ same `finding_id` creates a second signal rather than updating the first (and bumps `emitted_count`
+ again, since the run tally counts emits, not distinct findings).
- The `source_product="signals_scout"` tag rides through grouping into the persisted signal
metadata, so a report that contains a scout finding carries `signals_scout` among its contributing
signals. That's what `inbox-reports-list { "source_product": "signals_scout" }` filters on, and
it's the direct way to list scout-backed reports.
-Two ways to follow a finding, then: filter the inbox by `source_product="signals_scout"` to see the
-reports the fleet produced, or read the run's prose `summary` for the per-run record of what a single
-run did or didn't emit. A run that closed out empty has no findings — expected and correct most of
-the time, since scouts only emit when they clear a high bar.
+So three complementary angles on emit outcome: `emitted_count` (and the `emitted` filter) on the run
+for whether a run spoke, `emitted_finding_ids` to trace a run to its individual `Signal` rows, and
+`inbox-reports-list { "source_product": "signals_scout" }` to list the reports the fleet has
+surfaced. A run that closed out empty has no findings — expected and correct most of the time, since
+scouts only emit when they clear a high bar.
## SignalScratchpad — durable fleet memory
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index a4bd434ba837..354e30bbb709 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -5034,7 +5034,7 @@
}
},
"signals-scout-runs-list": {
- "description": "Return the most recent `SignalScoutRun` summaries for this project, newest first. Used by the headless scout to dedupe against work other runs already covered. Pass `text` for a case-insensitive substring match on the run's `summary` (the primary dedupe key for runs that didn't emit findings). Pass `date_from` / `date_to` (ISO-8601, inclusive lower / exclusive upper bound on `created_at`) to scope to a window. Results capped at 100.",
+ "description": "Return the most recent `SignalScoutRun` summaries for this project, newest first. Used by the headless scout to dedupe against work other runs already covered. Each row carries `emitted_count` (how many findings the run surfaced to the inbox) and `emitted_finding_ids`. Pass `emitted=true` to return only runs that emitted at least one finding (or `emitted=false` for runs that surfaced nothing). Pass `text` for a case-insensitive substring match on the run's `summary` (the primary dedupe key for runs that didn't emit findings). Pass `date_from` / `date_to` (ISO-8601, inclusive lower / exclusive upper bound on `created_at`) to scope to a window. Results capped at 100.",
"category": "Signals",
"feature": "signals",
"summary": "List recent scout runs",
@@ -5048,7 +5048,7 @@
}
},
"signals-scout-runs-retrieve": {
- "description": "Return the full `SignalScoutRun` row, including the agent's end-of-run `summary`. Status, timestamps, and error flow from the linked `tasks.TaskRun`; emitted findings live as `Signal` rows queryable by `source_id = run:<run_id>:finding:<finding_id>`. Strictly team-scoped — a UUID belonging to another team returns 404.",
+ "description": "Return the full `SignalScoutRun` row, including the agent's end-of-run `summary`, `emitted_count`, and `emitted_finding_ids`. Status, timestamps, and error flow from the linked `tasks.TaskRun`; emitted findings live as `Signal` rows queryable by `source_id = run:<run_id>:finding:<finding_id>` (one per id in `emitted_finding_ids`). Strictly team-scoped — a UUID belonging to another team returns 404.",
"category": "Signals",
"feature": "signals",
"summary": "Get a scout run by ID",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index e53efb5ba5cd..14508ff56864 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -5361,7 +5361,7 @@
}
},
"signals-scout-runs-list": {
- "description": "Return the most recent `SignalScoutRun` summaries for this project, newest first. Used by the headless scout to dedupe against work other runs already covered. Pass `text` for a case-insensitive substring match on the run's `summary` (the primary dedupe key for runs that didn't emit findings). Pass `date_from` / `date_to` (ISO-8601, inclusive lower / exclusive upper bound on `created_at`) to scope to a window. Results capped at 100.",
+ "description": "Return the most recent `SignalScoutRun` summaries for this project, newest first. Used by the headless scout to dedupe against work other runs already covered. Each row carries `emitted_count` (how many findings the run surfaced to the inbox) and `emitted_finding_ids`. Pass `emitted=true` to return only runs that emitted at least one finding (or `emitted=false` for runs that surfaced nothing). Pass `text` for a case-insensitive substring match on the run's `summary` (the primary dedupe key for runs that didn't emit findings). Pass `date_from` / `date_to` (ISO-8601, inclusive lower / exclusive upper bound on `created_at`) to scope to a window. Results capped at 100.",
"category": "Signals",
"feature": "signals",
"summary": "List recent scout runs",
@@ -5375,7 +5375,7 @@
}
},
"signals-scout-runs-retrieve": {
- "description": "Return the full `SignalScoutRun` row, including the agent's end-of-run `summary`. Status, timestamps, and error flow from the linked `tasks.TaskRun`; emitted findings live as `Signal` rows queryable by `source_id = run:<run_id>:finding:<finding_id>`. Strictly team-scoped — a UUID belonging to another team returns 404.",
+ "description": "Return the full `SignalScoutRun` row, including the agent's end-of-run `summary`, `emitted_count`, and `emitted_finding_ids`. Status, timestamps, and error flow from the linked `tasks.TaskRun`; emitted findings live as `Signal` rows queryable by `source_id = run:<run_id>:finding:<finding_id>` (one per id in `emitted_finding_ids`). Strictly team-scoped — a UUID belonging to another team returns 404.",
"category": "Signals",
"feature": "signals",
"summary": "Get a scout run by ID",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 1a0c4495775d..eeeb51e4b798 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -38755,6 +38755,10 @@ export namespace Schemas {
task_url?: string | null;
/** One-paragraph close-out the scout wrote at end-of-run. Empty string for runs that errored before close-out. The dedupe key for non-emitting runs. */
summary: string;
+ /** Number of findings this run actually emitted to the inbox. 0 for runs that investigated but surfaced nothing, or ran dry-run / before AI approval. `> 0` means the run produced at least one `Signal`. */
+ emitted_count: number;
+ /** The `finding_id`s behind `emitted_count`, in emit order. Each maps to a `Signal` with `source_id = run:<run_id>:finding:<finding_id>`. Empty for non-emitting runs. */
+ emitted_finding_ids: string[];
}
/**
@@ -38795,6 +38799,10 @@ export namespace Schemas {
task_url?: string | null;
/** One-paragraph close-out the scout wrote at end-of-run. Empty string for runs that errored before close-out. The dedupe key for non-emitting runs. */
summary: string;
+ /** Number of findings this run actually emitted to the inbox. 0 for runs that investigated but surfaced nothing, or ran dry-run / before AI approval. `> 0` means the run produced at least one `Signal`. */
+ emitted_count: number;
+ /** The `finding_id`s behind `emitted_count`, in emit order. Each maps to a `Signal` with `source_id = run:<run_id>:finding:<finding_id>`. Empty for non-emitting runs. */
+ emitted_finding_ids: string[];
}
export interface _User {
@@ -51644,6 +51652,11 @@ export namespace Schemas {
* ISO-8601 exclusive upper bound on `created_at`. Pass to walk back past the result cap on subsequent calls (cursor-style: set to the `started_at` of the oldest run from the prior page).
*/
date_to?: string;
+ /**
+ * Filter by emit outcome. `true` returns only runs that emitted at least one finding (`emitted_count > 0`); `false` returns only runs that emitted nothing. Omit for both.
+ * @nullable
+ */
+ emitted?: boolean | null;
/**
* Max rows to return (default 20, hard cap 100).
* @minimum 1
diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.ts
index 92e7f6e924ee..685671f6fa4c 100644
--- a/services/mcp/src/generated/signals/api.ts
+++ b/services/mcp/src/generated/signals/api.ts
@@ -196,7 +196,7 @@ export const SignalsScoutProjectProfileGetQueryParams = /* @__PURE__ */ zod.obje
})
/**
- * Return the most recent `SignalScoutRun` summaries for this project, newest first. Used by the headless scout to dedupe against work other runs already covered. ILIKE matches on `summary`. `date_from` / `date_to` are a half-open window on `created_at` (`>= date_from`, `< date_to`); pass `date_to` on subsequent calls to walk past the 100-row cap. Results capped at 100.
+ * Return the most recent `SignalScoutRun` summaries for this project, newest first. Used by the headless scout to dedupe against work other runs already covered. ILIKE matches on `summary`. `date_from` / `date_to` are a half-open window on `created_at` (`>= date_from`, `< date_to`); pass `date_to` on subsequent calls to walk past the 100-row cap. Pass `emitted=true` to see only runs that surfaced at least one finding. Results capped at 100.
* @summary Search recent agent runs
*/
export const SignalsScoutRunsListParams = /* @__PURE__ */ zod.object({
@@ -220,6 +220,12 @@ export const SignalsScoutRunsListQueryParams = /* @__PURE__ */ zod.object({
.describe(
'ISO-8601 exclusive upper bound on `created_at`. Pass to walk back past the result cap on subsequent calls (cursor-style: set to the `started_at` of the oldest run from the prior page).'
),
+ emitted: zod
+ .boolean()
+ .nullish()
+ .describe(
+ 'Filter by emit outcome. `true` returns only runs that emitted at least one finding (`emitted_count > 0`); `false` returns only runs that emitted nothing. Omit for both.'
+ ),
limit: zod
.number()
.min(1)
diff --git a/services/mcp/src/tools/generated/signals.ts b/services/mcp/src/tools/generated/signals.ts
index d18300067533..23d301dc5382 100644
--- a/services/mcp/src/tools/generated/signals.ts
+++ b/services/mcp/src/tools/generated/signals.ts
@@ -416,6 +416,7 @@ const signalsScoutRunsList = (): ToolBase<
query: {
date_from: params.date_from,
date_to: params.date_to,
+ emitted: params.emitted,
limit: params.limit,
text: params.text,
},
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-runs-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-runs-list.json
index 0ea252c1bfdd..315a58ad431d 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-runs-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-runs-list.json
@@ -13,6 +13,17 @@
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
+ "emitted": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Filter by emit outcome. `true` returns only runs that emitted at least one finding (`emitted_count > 0`); `false` returns only runs that emitted nothing. Omit for both."
+ },
"limit": {
"description": "Max rows to return (default 20, hard cap 100).",
"maximum": 100,