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): add an operational scout role to the harness (#99829)

posthog[bot]a7ab0c77d1c8
diff --git a/docs/internal/signals-operational-scouts.md b/docs/internal/signals-operational-scouts.md
new file mode 100644
index 000000000000..8107e7cc18c0
--- /dev/null
+++ b/docs/internal/signals-operational-scouts.md
@@ -0,0 +1,16 @@
+# Operational scouts
+
+A canonical scout declares `scout-role: operational` in its `SKILL.md` frontmatter.
+The harness enables it outside the seed allowlist and the enabled-scout limit.
+The holdback list still applies.
+An operational scout remains exempt from inactivity warnings and pauses.
+User pauses and failure pauses remain in effect.
+
+The config records whether the role set `auto_pause_exempt` in `auto_pause_exempt_by_role`.
+When a scout loses its operational role, the next coordinator tick removes only the exemption set by the role.
+An explicit `auto_pause_exempt` edit through the config API clears this ownership marker, so the user setting survives a role change.
+Role reconciliation runs independently of skill content hashes.
+
+Archived canonical skills retain their operational identity in config responses.
+The config API refuses to delete their configs.
+Set `enabled=false` to stop an operational scout.
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index c7c875508a7c..a0a66d15f6a7 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -6165,7 +6165,7 @@ snapshots:
products-workflows-editor-graph--add-on-promotion-emails--light:
hash: v1.k794b7964.0df096512fda16f0d1fa1ebfed25fd9df287e7cf273d7bd56a93b3d5a316b2eb.0Td6CXL_NV0F9bNlH2sKu6FEJ3bi-WFQMYYeSV3LBY8
products-workflows-editor-graph--customer-onboarding-and-retention--dark:
- hash: v1.k794b7964.3191c1984e08a93b2b41186d743c5a7488306da8caac823a858b8b3009e8e249.tarfXhWwpkEO50Lg4xl-tg04f2F4DdHi_urFckZ3mLE
+ hash: v1.k794b7964.9c165882088a94a60c3f278c5ac933e19deea0799e2f178773b9562a06d5b587.T17LeudaJGjY7lpzSaWm3Vstubn72J6YmRirV14ZZGQ
products-workflows-editor-graph--customer-onboarding-and-retention--light:
hash: v1.k794b7964.d1a0262e3ba550f69a2ab3d0bcda4327157eb1f947c5ad35cb2267ba70cbdec8.2bL0CCEt9WyVdRlAp8Lyr03y_DB6ERgysK-0eIDqO1E
products-workflows-editor-graph--new-workflow--dark:
@@ -8121,9 +8121,9 @@ snapshots:
scenes-app-inbox-scene--empty-control--light:
hash: v1.k794b7964.40a8eaced770971fbe50173245db2b8f173948320a09b1f0a138ca90819e0c1a.FTwYK7wfCfCxR-YFKOLhK5ejxXe4qYDEjxWf2tG3vQo
scenes-app-inbox-scene--empty-with-many-scouts--dark:
- hash: v1.k794b7964.737eadc375ed0122478682812983b6139a399fe35c0b61b8212b5fdda1e15ebd.tcmc5t1Jpg2JjZ5l4ASoJTE8_U5E6HrOWsGghi-uoGI
+ hash: v1.k794b7964.912f58c1595c14260c58e5edfd74fe6429a05960ed05c3a93c38668f715f98b3.pCfUAofhEjo2TKaWOCbUnXghdlQqVcfHujJgROUT54w
scenes-app-inbox-scene--empty-with-many-scouts--light:
- hash: v1.k794b7964.e254ce785e328a8e47e53362026f920ddf77a2b7dd6402f6ad56c02e3590af4a.CiyEQnzqVrx-u3Q-nCE5ludmZMsIMXGJOa7TTxycB0E
+ hash: v1.k794b7964.606130d48b16c3688cb233bc286359045945967f6d05c9ab098f8aa795b17782.AJRxyRLHMGB9Oe3oASK6hq85ZTOwiRhwTb9GrjBEh_M
scenes-app-inbox-scene--inbox--dark:
hash: v1.k794b7964.e1e4ab0d21ba58926ab2d57e366734264122b146701a84fe3f442012ec64fc19.6sbEcCnUZmsj3KMtQMzsKHuyPxgs2UIKKF6xN7gufSA
scenes-app-inbox-scene--inbox--light:
@@ -8245,29 +8245,29 @@ snapshots:
scenes-app-inbox-scoutrepositoriespicker--scout-settings-variant--light:
hash: v1.k794b7964.a11cdab2114ddd1b6bc8d929da0d0b2c4e9cbc292d60e1adef64f93227e5a324.rL3wPJRk_-nRwk5unPytYNbzIlxyYLEjIf2lPkh_0Oc
scenes-app-inbox-scoutsroster--large-fleet--dark:
- hash: v1.k794b7964.f5df414cdabc9f417423cd433df6ea5aa20cdbd4f73e059241daf0383271f512.iGDNfvCV-kotAtlPP6xgOXiZW5F55Mznu0BJos660fU
+ hash: v1.k794b7964.bc5496dd845ecda6f0ad12cfb26aef001eebb616144626a43170c8a67febd43b.OvZS68_NkWoY-DVfy1T244ykeLC7vL8vDumGQzNbnic
scenes-app-inbox-scoutsroster--large-fleet--light:
- hash: v1.k794b7964.07b35c338c0a3a2dade7da4f2257f71924a19b401fcd438bfeb534057a291692.5vFLPCDhQdgHmGZzuEawqMWEdGRRvWicCrnl-geo5x4
+ hash: v1.k794b7964.ed67ad70f3fa88f0a8ec479cb91870ad1d9baab13bb4be71428c960c391bf0db.o6Eahjl27mO8luIjeK97HT62W6KldZEJDcPJDMaCx4c
scenes-app-inbox-scoutsroster--narrow--dark:
- hash: v1.k794b7964.67106f2ee332cdefdd195f9ac461c76dd294415e4f6df9dbb4863436048b1bbd.VX98iv4ZBxPp6mZ11iJxeesn7i41Dk0Kmdrziawc5Qg
+ hash: v1.k794b7964.563269374213e79108bbb022152b0489ff74bebfc5346e9f963f998953304f1f.9FmxupASPfGYeA0dT5MMVMmpnpuenKbo9I0_j3EmGT8
scenes-app-inbox-scoutsroster--narrow--light:
- hash: v1.k794b7964.fcdccdc5587bd8c324e82fd7620713aa70d0fc11cc3fd60617cd8385960d34f0.BrMGAFw1-lBRxGrCK8c_Ga5SKdLaAzoSH1GJj6KwvPI
+ hash: v1.k794b7964.9146b5b058fe264dcf9e062d2a0d9b1dbe30b0a0cfec4e53cfe389a5920f9826.1-i3E_dsDeO6Q8b_UoIj7gJ_th7qgHeQ98oHLMuoA3Q
scenes-app-inbox-scoutsroster--roster--dark:
hash: v1.k794b7964.1fa499f9b82d53b5303ac9c1aad41ae71c3181773bfebff8484f9aac6a5d7ad5.c9CzmU_NYRff7RF85AjHkQMh2xHZSlQNuLU0fF3-Uto
scenes-app-inbox-scoutsroster--roster--light:
hash: v1.k794b7964.9641b33b8a0ebdb5f80a54278c0fb1328904398cf933ee06bfa4ccf58eb00415.2jp3o2jztnpwRlJ3x9o_KtVLLiGu42UoAmE71dud5go
scenes-app-inbox-scoutsroster--roster-costs--dark:
- hash: v1.k794b7964.7ddc61e8730affa52b9afb1598b078872ba14f37475bd359b957df22661a6a84.xEXuC3bwseJYnapypkcC88Xl2b98bn3tgTblsquCLv0
+ hash: v1.k794b7964.beeccb8195997c1c1877f549c6b6902b9b69cb1d9c720940ab7f5968f0335a71.1Jm1H94ElUbRIL-n5q9IJY-TmEDzSzxPqAms52-08F4
scenes-app-inbox-scoutsroster--roster-costs--light:
- hash: v1.k794b7964.8c09e07c4ea2df4d050c98b1b79d7e8d5c4923c6c78d9e597be01bf3e772f3ff.j4eAE4YSqltTOlD410S6sqyGrbS1VSOfezTnH5EuPKE
+ hash: v1.k794b7964.75d202bfe5d3ed9019278d4a9730bfd7e1c9ccda3b7358eb167472499b65445b.Hz5OA1f_5_lQmDuCNFUw-HWUbfnWNyN5qfnvGPevHcU
scenes-app-inbox-scoutsroster--roster-costs-non-staff--dark:
- hash: v1.k794b7964.f5df414cdabc9f417423cd433df6ea5aa20cdbd4f73e059241daf0383271f512.f49a8vTCcZp2dO9FCVQLCh6ijGDtP1wu-gE0zJ6nlgQ
+ hash: v1.k794b7964.bc5496dd845ecda6f0ad12cfb26aef001eebb616144626a43170c8a67febd43b.JldNfdDLfUnEixxUwEc-HN7yzxRYqQesLQWPuf0gLrk
scenes-app-inbox-scoutsroster--roster-costs-non-staff--light:
- hash: v1.k794b7964.07b35c338c0a3a2dade7da4f2257f71924a19b401fcd438bfeb534057a291692.KZr3sPuI2eJ3GqzaWRlLHGNQtUXPN5kemWId-Pcf6F4
+ hash: v1.k794b7964.ed67ad70f3fa88f0a8ec479cb91870ad1d9baab13bb4be71428c960c391bf0db.kS-qICwDGcauBM7y48IGpq2cxtE4M9qmalLa716nJN4
scenes-app-inbox-scoutsroster--roster-costs-table--dark:
- hash: v1.k794b7964.e413457fe157fc4119197fc4cf8155ffcd44a38f9ef89ffa928555bc796dc674.JPlNpamhAWxFX_aWQ5BBG7tCN5pTYK3wc8sqnHB6XWs
+ hash: v1.k794b7964.508b273094f6e08573ddd45fd3eb9eb0ad462d2b3834dcac401272a61eb6f1e7.RPEKTl6gEq0dtaS5iWq-6zYyPZeHWxRwXyU8UJNPA_o
scenes-app-inbox-scoutsroster--roster-costs-table--light:
- hash: v1.k794b7964.49b466a57f2d708dc7038ff2fa235a5d1f6070bfaf7587372dfded6d77bfccae.tgynCIm3V7nqUVNgHAcdLmdoQzXNZDyGQ0QnCGoIT7I
+ hash: v1.k794b7964.652892a536e1b8bbf01bf83291dcd7235882bc37623ac48f9f0722eebc287f4c.tDCNWTUu2RZ1wY30Q4P1KqzavMtnNKbj8TG5oPy6PN8
scenes-app-inbox-scoutsroster--roster-legacy--dark:
hash: v1.k794b7964.5339804f4cc136f9700b3329b0121ab62f3008197dcb4ff7c91d714e1fbdbbb5.peuyX_VFezfUR5E8LAdqk4e3GZWeYZ8qhq1Xp6HNLnc
scenes-app-inbox-scoutsroster--roster-legacy--light:
diff --git a/products/replay_vision/frontend/generated/api.schemas.ts b/products/replay_vision/frontend/generated/api.schemas.ts
index 0efbcfcb18f5..0fdaf1cd931a 100644
--- a/products/replay_vision/frontend/generated/api.schemas.ts
+++ b/products/replay_vision/frontend/generated/api.schemas.ts
@@ -1876,6 +1876,13 @@ export const ScoutOriginEnumApi = {
Custom: 'custom',
} as const
+export type ScoutRoleEnumApi = (typeof ScoutRoleEnumApi)[keyof typeof ScoutRoleEnumApi]
+
+export const ScoutRoleEnumApi = {
+ Specialist: 'specialist',
+ Operational: 'operational',
+} as const
+
/**
* * `active` - Active
* * `pending_pause` - Pending pause
@@ -1931,6 +1938,8 @@ export interface SignalScoutConfigApi {
display_name?: string
/** Where this scout came from: `canonical` for a scout PostHog ships and maintains (seeded from `products/signals/skills/`), or `custom` for one a team hand-authored on this project. Use it to badge built-in vs custom scouts instead of a hardcoded name list. Defaults to `custom` if the skill is not currently present on the team. */
readonly scout_origin: ScoutOriginEnumApi
+ /** What this scout is to the harness: `specialist` for one that watches a product surface, or `operational` for one PostHog ships to watch the self-driving system itself. An operational scout is exempt from the inactivity sweep and from the enabled-scout cap, and is not a scout a project should delete. Always `specialist` for a custom scout. */
+ readonly scout_role: ScoutRoleEnumApi
/** Who answers for this scout, seed-creator first. Ownership is recorded on the scout's skill rather than on this config, so editing the skill or toggling the scout leaves it unchanged. Reports the scout files suggest these people as reviewers. Prefer this over `created_by`-style fields, which only say who last flipped a switch. Empty when nobody owns the scout, when the owners are no longer members with access to the project, or when the caller is a scout sandbox token: owners are member PII, and a scout reads them through the skill API instead. */
readonly owners: readonly UserBasicApi[]
/** Whether this scout runs on its schedule. Disabled scouts are skipped by the coordinator. Derived from `status`: true for `active` and `pending_pause`, false for the paused statuses. */
diff --git a/products/signals/backend/migrations/0134_scout_exemption_role_source.py b/products/signals/backend/migrations/0134_scout_exemption_role_source.py
new file mode 100644
index 000000000000..53e02eea5da5
--- /dev/null
+++ b/products/signals/backend/migrations/0134_scout_exemption_role_source.py
@@ -0,0 +1,17 @@
+# Generated by Django 5.2.17 on 2026-09-15 06:59
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("signals", "0133_github_issue_writeback"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="signalscoutconfig",
+ name="auto_pause_exempt_by_role",
+ field=models.BooleanField(db_default=False, default=False),
+ ),
+ ]
diff --git a/products/signals/backend/migrations/max_migration.txt b/products/signals/backend/migrations/max_migration.txt
index aa0e3a13d68a..903ec329a600 100644
--- a/products/signals/backend/migrations/max_migration.txt
+++ b/products/signals/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0133_github_issue_writeback
+0134_scout_exemption_role_source
diff --git a/products/signals/backend/models.py b/products/signals/backend/models.py
index c00e96dedd80..eff8b0c5d1e3 100644
--- a/products/signals/backend/models.py
+++ b/products/signals/backend/models.py
@@ -1807,6 +1807,8 @@ class SignalScoutConfig(ModelActivityMixin, TeamScopedRootMixin, UUIDModel):
# minting permanent immunity. `db_default` alongside `default` keeps the AddField
# non-blocking and the column populated for writers that don't know about it yet.
auto_pause_exempt = models.BooleanField(default=False, db_default=False)
+ # Keep user exemptions when a canonical scout stops being operational.
+ auto_pause_exempt_by_role = models.BooleanField(default=False, db_default=False)
# Dry-run vs emit. Defaults emit-on so a freshly authored scout is live from its first
# tick. Flip to False for dry-run — the scout runs and logs but `emit_finding` writes
# nothing — to validate it on a team before its findings reach the inbox.
diff --git a/products/signals/backend/scout_harness/AGENTS.md b/products/signals/backend/scout_harness/AGENTS.md
index daac98ae3b20..13c46e6c06cf 100644
--- a/products/signals/backend/scout_harness/AGENTS.md
+++ b/products/signals/backend/scout_harness/AGENTS.md
@@ -22,11 +22,13 @@ In production it is driven by `SignalsScoutCoordinatorWorkflow` (periodic tick e
`resolve_skill_owner_user_uuids` exposes the owner set (seed-creator first) to the report tools' reviewer provenance stamp (`is_skill_owner`). Author resolution is opt-in via `load_skill_for_run(..., include_authors=True)` — only the runner's prompt-building path pays for it; the report-authorization gate in `views.py` loads the skill per report write just to check `allowed_tools` and skips it.
- `lazy_seed.py`
Canonical skill sync. Reads `products/signals/skills/signals-scout-*/` from disk and reconciles them against the team's `LLMSkill` rows: creates missing rows, updates ones the team hasn't edited, leaves diverged / hand-authored rows alone, tombstones rows whose canonical skill was deleted. Only rows tagged `metadata.seeded_by="signals_scout_harness"` are ever updated. Called both lazily (coordinator tick, runner cold-start) and explicitly via the `sync_signals_scout_skills` management command.
+ It also parses the two config-shaping frontmatter keys, neither of which enters the content hash (both belong to the config, not the skill row): `scout-tags` (`canonical_config_tags_for`) and `scout-role` (`is_operational_scout`). `scout-role: operational` marks a scout that watches the self-driving system itself rather than a product surface — the fleet's follow-up validation scout — and an unknown value fails the parse rather than falling back, since a silently downgraded operational scout is the silencing the role exists to prevent.
- `fleet_sync.py`
`materialize_scout_fleet(team, surface=...)` — the on-demand `configs/sync/` path, and the only place that records what a materialization did. Resolves the seed posture + holdback from one flag read, runs `sync_canonical_skills(prune=True)` and `register_missing_configs`, then captures `signals_scout_fleet_synced` with the per-bucket counts the `SyncResult` carries (created / updated / diverged / tombstoned / pruned), the configs it registered, the fleet it left behind, whether the project had one before (`was_empty` — the rescue metric), the `surface` the caller declared, and how long the pass took. Every sync captures, zero counts included: a no-op sync is the denominator for "how often does opening the tab find work to do". Best-effort, like every other scout event.
It also carries the mass-prune tripwire. A reap that takes more than half the canonical fleet, and at least `MASS_PRUNE_FLOOR` scouts, is not a retirement — it means the sync read a fleet the deploy did not ship — so it stamps `unexpected_prune` on the event and captures `UnexpectedScoutFleetPrune` into error tracking. A detector, not a guard: by the time the count exists the rows are tombstoned.
- `config_registry.py`
`register_missing_configs(team_id)` — auto-creates an enabled, default-schedule `SignalScoutConfig` for any `signals-scout-*` skill lacking one ("author a skill, get a scout"). Called by the coordinator tick; the HTTP surface registers explicitly via the write-scoped config `create` endpoint instead (reads stay side-effect free). A canonical scout's `scout-tags` frontmatter (read through `lazy_seed.canonical_config_tags_for`) is stamped on the row it creates, which is how a product surface claims its scouts by tag instead of by hardcoded skill name — AI observability's self-driving tab lists the `ai-observability`-tagged configs. Forward-only like the rest of the seed posture: adding the key to an already-seeded scout leaves that team's existing config untagged until someone tags it through the config API.
+ An **operational** scout (`scout-role: operational`) is the one exception to all of that: it seeds enabled and `auto_pause_exempt`, past the `enabled_skills` allowlist and past `MAX_ENABLED_SCOUTS_PER_TEAM` (it still counts toward the cap, so its slot is visible), and `reconcile_operational_configs` runs on every tick to put rows seeded before the role existed back on those terms. The reconcile undoes only the harness's own silencing — a sweep warning or pause via `transition_status_by_system`, and a row the seed created disabled, which the model stores as `paused_by_user` and the reconcile tells apart by its null `status_changed_at`. A person's pause and a `repeated_failures` pause are both left standing. The holdback still gates the scout, whatever its role, and the config API refuses to delete it (`views.destroy`).
- `suggestions.py` / `suggestions_runner.py`
Pre-computed scout suggestions: the push-side twin of the "Suggest a scout" chat button. `suggestions.py` (temporalio-free, cheap to import) holds the structured-output contract the headless run returns (`ScoutSuggestionBatch`: 3-5 items, each a `canonical` "turn this on" pick or a `custom` draft with a ready-to-create `draft_body`), the `signals-scout-suggestions` flag-payload settings (`enabled`, `eligibility_tier` 0-4 (0 = allowlist only), `refresh_days`, `max_children_per_tick`, allow/blocklist, failure breaker), the planner (`plan_suggestion_runs`: recomputes the priority queue from Postgres every tick; tier, then never-generated, then most overdue, then most recently engaged; engagement is a report view or rating, a scout a person turned on or off (`status_changed_by`), or a scout a person created (`created_by`), never a plain edit or a system touch; nothing is stored as a queue; engagement is read only for the teams already in the tier map, since `SignalReportAction.last_at` is deliberately unindexed and an unbounded filter on it scans the whole action history; a team past the failure breaker doubles its refresh interval per further failure, because the cooldown is shorter than the refresh window and so could never hold a scheduled retry back), draft validation (`validate_suggestion_items` drops anything the one-click Create could not apply as-is), and persistence on `SignalScoutSuggestionSet` (one row per team, items as JSON, every write under a row lock since each is a read-modify-write of the column; dismissals carry forward by `skill_name` and survive as hidden tombstones when a batch omits the name, compacted to the dismissal fields so a dropped draft body does not sit in the row forever; a batch persisted after the fleet moved is stored `stale`, and a batch that merely aged past `refresh_days`, whether it held items or concluded there was nothing to suggest, reads as `stale` through `effective_status`, since nothing writes that status on expiry; a failed generation anywhere after the gates keeps the prior items and counts toward the breaker; `mark_stale_if_fleet_changed` is wired to `SignalScoutConfig` saves in `../receivers.py`). Reads hide dismissed, created, and already-enabled items, plus custom drafts whose name a stored skill or config has since taken; the manual refresh endpoint honors the same kill switch and blocklist as the planner, runs the scan as its authenticated caller rather than the resolved team member, and a manual dispatch stamps `last_requested_at` so the coordinator does not double up. `suggestions_runner.py` is the one piece that needs the tasks agent facade: `arun_scout_suggestions` gates (AI-processing consent, an acting user; deliberately no self-driving credits gate, since a scan opens no pull request and so bills nothing, while a skip would still burn the team's whole refresh window), mints a `read_only` headless task with the reserved `SIGNALS_SCOUT_SUGGESTIONS` origin, no GitHub token and no MCP Store servers, because the scan reads project text any member can write, parses the batch with no prose salvage (an unparseable close-out is a failed generation), validates, persists, and emits `$scout_suggestions_generated`. Driven by `temporal/agentic/scout_suggestions.py` (coordinator + child, same shape as the scout coordinator, own schedule) and exposed read/dismiss/refresh at `signals/scout/suggestions/` (`../scout_suggestions_api.py`), where membership, token scope, and resource-level RBAC all anchor to the canonical parent team. The prompt shares `SCOUT_PROJECT_SCAN_GUIDANCE` (in `prompt.py`) with the chat template so the two voices never drift.
- `slack_delivery.py` / `slack_delivery_queue.py` / `slack_charts.py`
@@ -60,7 +62,7 @@ In production it is driven by `SignalsScoutCoordinatorWorkflow` (periodic tick e
The stop switch on the waste axis (the failure breaker below covers the failure axis). `sweep_inactive_scouts()` judges **consumption, not emission**: a scout counts as consumed only when a **person** acted on a report it wrote or edited in the `TOUCHED_REPORT_LOOKBACK` — a log artefact attributed to a user (pipeline writers append log artefacts of their own, so unattributed ones don't count), a `SignalReportAction` row (the light interactions the inbox UI records server-side: opening a report's detail view via the `viewed` endpoint, rating it with the thumbs via `feedback` — reading counts on purpose, since that is how digest-style reports are consumed), or the report recently reaching `resolved`/`deleted` (`resolved` deliberately includes the GitHub webhook's resolve-on-merge, so a PR merged on GitHub with no in-app action still counts; `suppressed` is deliberately excluded because the same webhook suppresses on close-unmerged with no human involved).
The two `pause_reason`s behave differently: `ignored` (the scout holds at least one report older than `ESTABLISHED_REPORT_AGE` and none of its reports show consumption) warns and then pauses after `WARNING_GRACE`; `no_output` (silent, with no judgeable report evidence) only ever warns, because a watch scout's silence can be its job. A scout with output but nothing judgeable on the report side — findings-only, Slack-routed (consumption happens in Slack where no evidence flows back), or every report younger than `ESTABLISHED_REPORT_AGE` — is left alone.
It speaks the scout lifecycle vocabulary rather than keeping fields of its own: the warning is `status=pending_pause` (still scheduled), the pause is `status=paused_by_system` (syncing `enabled=False`), both through `transition_status_by_system`. The helper's ownership rule is writer-scoped: the sweep owns both of its reasons (so it can reclassify its own warning in either direction — `no_output` becomes `ignored` when report evidence establishes, restarting the grace clock, and `ignored` downgrades to `no_output` when its evidence ages out of the lookback, so a pause never lands on stale grounds), and neither the sweep nor the failure breaker can touch the other's pauses.
- Driven by the daily `pause_inactive_signal_scouts` Celery task rather than the coordinator tick, which stays bounded. A dry-run scout, one inside `in_cold_start_grace()`, one that has barely run (`MIN_RUNS_IN_WINDOW`), and one flagged `auto_pause_exempt` (watchdogs whose value is staying quiet) are all left alone; new warnings are capped per sweep (`MAX_WARNS_PER_SWEEP`), which also bounds later pauses, since a pause only ever follows a warning by `WARNING_GRACE`.
+ Driven by the daily `pause_inactive_signal_scouts` Celery task rather than the coordinator tick, which stays bounded. A dry-run scout, one inside `in_cold_start_grace()`, one that has barely run (`MIN_RUNS_IN_WINDOW`), and one flagged `auto_pause_exempt` (watchdogs whose value is staying quiet, including every operational scout, which `register_missing_configs` stamps for exactly this reason) are all left alone; new warnings are capped per sweep (`MAX_WARNS_PER_SWEEP`), which also bounds later pauses, since a pause only ever follows a warning by `WARNING_GRACE`.
Unlike the failure breaker there is no probe — an inactivity pause never runs again on its own. Re-enabling through the config API resumes the scout and re-anchors its grace window, so the sweep waits a full fresh `COLD_START_GRACE` and re-derives its verdict before judging it again (permanent immunity stays the explicit `auto_pause_exempt` field, never a resume side effect); that resume also emits `signals_scout_auto_pause_reverted`, the sweep's false-positive metric (the warn and pause emit `signals_scout_auto_pause_warned` / `signals_scout_auto_paused`).
- `limits.py`
Runtime ceilings as module constants: `DEFAULT_MAX_RUNTIME_S` (per-run budget), `ACTIVITY_SLACK_S`, and `WORKFLOW_HARD_CEILING_S` (`= DEFAULT_MAX_RUNTIME_S + ACTIVITY_SLACK_S`, the activity-level ceiling that gates the workflow's `start_to_close_timeout`).
diff --git a/products/signals/backend/scout_harness/config_registry.py b/products/signals/backend/scout_harness/config_registry.py
index 4294b4d240ce..9cc5f66912ad 100644
--- a/products/signals/backend/scout_harness/config_registry.py
+++ b/products/signals/backend/scout_harness/config_registry.py
@@ -15,17 +15,23 @@ from __future__ import annotations
from datetime import UTC, datetime
+from django.db import transaction
+from django.db.models import Q
from django.utils import timezone
import structlog
from croniter import CroniterError, croniter
+from posthog.models.activity_logging.activity_log import Trigger
+from posthog.models.activity_logging.model_activity import ActivityTriggerContext
+
from products.signals.backend.models import SignalScoutConfig
from products.signals.backend.scout_harness.lazy_seed import (
HARNESS_SEEDED_BY,
SCOUT_SKILL_CATEGORY,
canonical_config_tags_for,
canonical_skill_names,
+ is_operational_scout,
)
from products.signals.backend.scout_harness.limits import MAX_ENABLED_SCOUTS_PER_TEAM
from products.signals.backend.scout_harness.skill_loader import SIGNALS_SCOUT_SKILL_PREFIX
@@ -49,6 +55,8 @@ CRON_SCHEDULE_MAX_LENGTH = 100
# (a `*/15` fires 96×/day) while staying trivially cheap for sparse schedules.
_CRON_SAMPLE_OCCURRENCES = 100
+_OPERATIONAL_RECONCILE_JOB_TYPE = "signals_scout_operational_reconcile"
+
def cron_schedule_error(value: str) -> str | None:
"""Why `value` is not an acceptable scout cron schedule, or None when it is.
@@ -216,6 +224,12 @@ def register_missing_configs(
allowlisted scout registers disabled once the team is at the cap. Both checks are best-effort
(count + create, no lock) — a race can briefly overshoot by one, which the coordinator's
per-tick caps still bound.
+
+ A canonical scout declaring `scout-role: operational` (`lazy_seed.is_operational_scout`) is
+ outside all of that: it watches the self-driving system rather than a product surface, so it
+ seeds enabled, exempt from the inactivity sweep, past the allowlist and past the cap, and
+ `reconcile_operational_configs` keeps rows seeded before the role existed on those terms. The
+ holdback still applies — a withheld scout is dropped above, whatever its role.
"""
enabled_skills, enabled_interval = _resolve_seed_posture(seed_config_layers)
rows = list(
@@ -244,6 +258,9 @@ def register_missing_configs(
for name, metadata in rows
if (metadata or {}).get("seeded_by") == HARNESS_SEEDED_BY and name in on_disk_canonical
}
+ # Read off the canonical set, not the raw names: the role lives on disk, so a team's own scout
+ # sharing an operational name must not inherit the posture that skips the harness's gates.
+ operational_names = {name for name in canonical_names if is_operational_scout(name)}
configs = SignalScoutConfig.objects.for_team(team_id)
existing = set(configs.values_list("skill_name", flat=True))
@@ -251,14 +268,22 @@ def register_missing_configs(
enabled = enabled_scout_count(team_id) if missing else 0
for name in missing:
at_cap = enabled >= MAX_ENABLED_SCOUTS_PER_TEAM
- # A canonical scout is gated by the allowlist (when one is set); a custom scout never is.
- # The explicit `is not None` keeps the membership check well-typed (mypy can't carry the
- # narrowing through `gated`).
- gated = enabled_skills is not None and name in canonical_names
+ operational = name in operational_names
+ # A canonical scout is gated by the allowlist (when one is set); a custom scout never is,
+ # and neither is an operational one. The explicit `is not None` keeps the membership check
+ # well-typed (mypy can't carry the narrowing through `gated`).
+ gated = enabled_skills is not None and name in canonical_names and not operational
in_allowlist = (not gated) or (enabled_skills is not None and name in enabled_skills)
- seed_enabled = in_allowlist and not at_cap
+ # 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)
defaults: dict = {} if seed_enabled else {"enabled": False}
+ 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.
+ defaults["auto_pause_exempt"] = True
+ defaults["auto_pause_exempt_by_role"] = True
# A canonical scout can claim a product surface's tag in its SKILL.md frontmatter
# (`scout-tags`) — that's what lands it in that product's own scout list. Seeded at
# creation like the rest of the posture, so a person who later removes the tag keeps it
@@ -288,8 +313,91 @@ def register_missing_configs(
cap=MAX_ENABLED_SCOUTS_PER_TEAM,
)
+ reconcile_operational_configs(team_id, operational_names & skill_names, withheld_skill_names)
+
# 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,
# and after the loop above so a row created on this tick is stamped on this tick.
ensure_scout_category(team_id)
return skill_names | live_scout_skill_names(team_id, withheld_skill_names)
+
+
+def reconcile_operational_configs(
+ team_id: int,
+ skill_names: set[str],
+ withheld_skill_names: frozenset[str] | set[str] | None = None,
+) -> None:
+ """Put already-seeded operational scouts back on the posture their role asks for.
+
+ The rest of the seed posture is forward-only on purpose: an existing row is the team's to
+ tune, and re-stamping it every tick would revert people's choices. An operational scout is
+ the exception because it watches the self-driving system itself — when it is off, the thing
+ that notices nothing is working is the thing that stopped working — so the harness's own
+ earlier decisions about it are undone rather than left standing.
+
+ Two of them. The exemption is stamped whenever it is missing, so the inactivity sweep stops
+ reading the scout's designed quiet as waste. And a scout the harness silenced is resumed: a
+ sweep warning or pause through `transition_status_by_system` under the sweep's own reason,
+ and a row the seed created disabled (recognized by a `paused_by_user` status no writer has
+ moved since creation) by a direct write, since the lifecycle rightly refuses to overrule a
+ human pause and that is what an untouched seed row is stored as.
+
+ What it never touches: a pause a person made, and a pause the failure breaker owns. A scout
+ whose runs keep failing has its own half-open probe, and resuming it here would spend runs on
+ a scout that cannot finish one.
+ """
+ configs = (
+ SignalScoutConfig.objects.for_team(team_id)
+ .select_for_update()
+ .filter(Q(skill_name__in=skill_names) | Q(auto_pause_exempt_by_role=True))
+ .exclude(skill_name__in=withheld_skill_names or ())
+ )
+ for config in configs:
+ trigger = Trigger(
+ job_type=_OPERATIONAL_RECONCILE_JOB_TYPE,
+ job_id=str(config.id),
+ payload={"skill_name": config.skill_name},
+ )
+ with ActivityTriggerContext(trigger):
+ if config.skill_name not in skill_names:
+ config.auto_pause_exempt = False
+ config.auto_pause_exempt_by_role = False
+ config.save(update_fields=["auto_pause_exempt", "auto_pause_exempt_by_role", "updated_at"])
+ continue
+ if not config.auto_pause_exempt:
+ config.auto_pause_exempt = True
+ config.auto_pause_exempt_by_role = True
+ config.save(update_fields=["auto_pause_exempt", "auto_pause_exempt_by_role", "updated_at"])
+ logger.info(
+ "signals_scout: operational scout exempted from the inactivity sweep",
+ team_id=team_id,
+ skill_name=config.skill_name,
+ )
+ _resume_operational_config(config)
+
+
+def _resume_operational_config(config: SignalScoutConfig) -> None:
+ """Undo the harness's own silencing of one operational scout, and nothing else."""
+ if config.pause_reason in SignalScoutConfig.INACTIVITY_PAUSE_REASONS:
+ resumed = config.transition_status_by_system(
+ SignalScoutConfig.Status.ACTIVE,
+ pause_reason=SignalScoutConfig.PauseReason(config.pause_reason),
+ )
+ elif config.status == SignalScoutConfig.Status.PAUSED_BY_USER and config.status_changed_at is None:
+ # `save` stores an `enabled=False` create as `paused_by_user`, so a row the seed disabled
+ # is shaped like a human pause. The missing `status_changed_at` is what tells them apart:
+ # it is stamped on every transition, and null only while the row still sits as created.
+ config.status = SignalScoutConfig.Status.ACTIVE
+ config.enabled = True
+ config.pause_reason = None
+ config.save(update_fields=["status", "enabled", "pause_reason", "updated_at"])
+ resumed = True
+ else:
+ return
+ if resumed:
+ logger.info(
+ "signals_scout: operational scout resumed",
+ team_id=config.team_id,
+ skill_name=config.skill_name,
+ )
diff --git a/products/signals/backend/scout_harness/lazy_seed.py b/products/signals/backend/scout_harness/lazy_seed.py
index 2fff626988df..49095f8b22f2 100644
--- a/products/signals/backend/scout_harness/lazy_seed.py
+++ b/products/signals/backend/scout_harness/lazy_seed.py
@@ -84,6 +84,12 @@ HARNESS_SEEDED_BY = "signals_scout_harness"
# product treats `category` as an opaque string; this is the value the harness writes.
SCOUT_SKILL_CATEGORY = "scout"
+ScoutRole = Literal["specialist", "operational"]
+
+SCOUT_ROLE_SPECIALIST: ScoutRole = "specialist"
+SCOUT_ROLE_OPERATIONAL: ScoutRole = "operational"
+SCOUT_ROLES: tuple[ScoutRole, ...] = (SCOUT_ROLE_SPECIALIST, SCOUT_ROLE_OPERATIONAL)
+
@dataclass(frozen=True)
class CanonicalSkillFile:
@@ -101,7 +107,8 @@ class CanonicalSkill:
The agentskills.io spec uses `allowed-tools` (hyphen); we accept both, preferring the
spec form. `files` is the recursive content of the `_ALLOWED_BUNDLE_SUBDIRS` directories
alongside SKILL.md. `config_tags` is the optional `scout-tags` frontmatter list, seeded onto
- the scout's `SignalScoutConfig` when that row is first created.
+ the scout's `SignalScoutConfig` when that row is first created. `role` is the optional
+ `scout-role` frontmatter value — what the harness is allowed to do to the scout.
"""
name: str
@@ -111,6 +118,7 @@ class CanonicalSkill:
files: tuple[CanonicalSkillFile, ...]
source_path: Path
config_tags: tuple[str, ...] = ()
+ role: ScoutRole = SCOUT_ROLE_SPECIALIST
@dataclass(frozen=True)
@@ -197,6 +205,32 @@ def _parse_config_tags(frontmatter: dict, skill_file: Path, *, is_scout: bool) -
return tuple(sorted(tags))
+def _parse_scout_role(frontmatter: dict, skill_file: Path, *, is_scout: bool) -> ScoutRole:
+ """Read the optional `scout-role` frontmatter value — the posture the harness seeds the scout on.
+
+ A scout that watches the self-driving system itself declares `operational`, and the harness
+ stops treating its quiet as waste: it seeds enabled and exempt from the inactivity sweep, is
+ not gated by the launch allowlist, and is not blocked by the per-team cap. Everything else is
+ a `specialist` and keeps the normal posture, so the default is the safe one.
+
+ Only scouts have a config for the role to shape, so the key is rejected on a companion skill.
+ An unknown value fails the parse rather than falling back: a typo that silently downgraded an
+ operational scout to a specialist is exactly the silencing this role exists to prevent.
+ """
+ if "scout-role" not in frontmatter:
+ return SCOUT_ROLE_SPECIALIST
+ if not is_scout:
+ raise CanonicalSkillParseError(f"Only a signals-scout-* skill may declare 'scout-role': {skill_file}")
+ raw_role = frontmatter["scout-role"]
+ if raw_role == SCOUT_ROLE_OPERATIONAL:
+ return SCOUT_ROLE_OPERATIONAL
+ if raw_role == SCOUT_ROLE_SPECIALIST:
+ return SCOUT_ROLE_SPECIALIST
+ raise CanonicalSkillParseError(
+ f"SKILL.md frontmatter 'scout-role' must be one of {', '.join(SCOUT_ROLES)}: got {raw_role!r} in {skill_file}"
+ )
+
+
def _parse_canonical_skill(skill_dir: Path, *, is_scout: bool = True) -> CanonicalSkill:
skill_file = skill_dir / "SKILL.md"
raw = skill_file.read_text(encoding="utf-8")
@@ -258,6 +292,8 @@ def _parse_canonical_skill(skill_dir: Path, *, is_scout: bool = True) -> Canonic
)
config_tags = _parse_config_tags(frontmatter, skill_file, is_scout=is_scout)
+ role = _parse_scout_role(frontmatter, skill_file, is_scout=is_scout)
+
body = raw[match.end() :]
if len(body.encode("utf-8")) > _MAX_SKILL_BODY_BYTES:
raise CanonicalSkillParseError(f"SKILL.md body exceeds the {_MAX_SKILL_BODY_BYTES} byte limit: {skill_file}")
@@ -302,6 +338,7 @@ def _parse_canonical_skill(skill_dir: Path, *, is_scout: bool = True) -> Canonic
files=tuple(files),
source_path=skill_dir,
config_tags=config_tags,
+ role=role,
)
@@ -399,6 +436,31 @@ def canonical_config_tags_for(skill_name: str) -> tuple[str, ...]:
return _canonical_config_tags().get(skill_name, ())
+@lru_cache(maxsize=1)
+def _canonical_operational_scouts() -> frozenset[str]:
+ """Names of the canonical scouts that declare `scout-role: operational`.
+
+ Cached for the process like `canonical_skill_names` — the shipped fleet only changes on
+ deploy — and degrades to empty on a malformed canonical, which leaves every scout on the
+ specialist posture rather than failing config registration.
+ """
+ try:
+ return frozenset(skill.name for skill in discover_canonical_skills() if skill.role == SCOUT_ROLE_OPERATIONAL)
+ except CanonicalSkillParseError:
+ logger.warning("canonical_operational_scouts: malformed canonical skill on disk; seeding no operational roles")
+ return frozenset()
+
+
+def is_operational_scout(skill_name: str) -> bool:
+ """Whether the canonical scout of this name watches the self-driving system itself.
+
+ False for a custom scout, and for a canonical specialist. Callers must confirm the name is
+ canonical first — a team's own `signals-scout-*` skill can share a canonical name, and it
+ inherits nothing from disk, least of all a role that exempts it from the harness's controls.
+ """
+ return skill_name in _canonical_operational_scouts()
+
+
def scout_skill_origin(skill_name: str, metadata: dict | None) -> Literal["canonical", "custom"]:
"""Classify a scout skill row as `"canonical"` or `"custom"` by who owns it.
@@ -432,9 +494,9 @@ def _compute_canonical_hash(canonical: CanonicalSkill) -> str:
SHA-256 is overkill cryptographically but content-addressable hashes are cheap and we want
no false positives.
- Deliberately excludes `config_tags`: the hash is compared against `_compute_row_hash` over the
- team's `LLMSkill` row, which stores no tags (they live on the config), so folding them in here
- would make every seeded row read as diverged forever.
+ Deliberately excludes `config_tags` and `role`: the hash is compared against
+ `_compute_row_hash` over the team's `LLMSkill` row, which stores neither (both shape the
+ config instead), so folding them in here would make every seeded row read as diverged forever.
"""
payload = {
"description": canonical.description,
diff --git a/products/signals/backend/scout_harness/serializers.py b/products/signals/backend/scout_harness/serializers.py
index 0a8bf0175014..f3332a1f22a1 100644
--- a/products/signals/backend/scout_harness/serializers.py
+++ b/products/signals/backend/scout_harness/serializers.py
@@ -2779,6 +2779,11 @@ class ScoutOrigin(models.TextChoices):
CUSTOM = "custom", "custom"
+class ScoutRole(models.TextChoices):
+ SPECIALIST = "specialist", "specialist"
+ OPERATIONAL = "operational", "operational"
+
+
class SignalScoutConfigSerializer(serializers.ModelSerializer):
"""Read shape for a per-(team, skill) scout config.
@@ -2806,6 +2811,15 @@ class SignalScoutConfigSerializer(serializers.ModelSerializer):
"name list. Defaults to `custom` if the skill is not currently present on the team."
),
)
+ scout_role = serializers.SerializerMethodField(
+ help_text=(
+ "What this scout is to the harness: `specialist` for one that watches a product "
+ "surface, or `operational` for one PostHog ships to watch the self-driving system "
+ "itself. An operational scout is exempt from the inactivity sweep and from the "
+ "enabled-scout cap, and is not a scout a project should delete. Always `specialist` "
+ "for a custom scout."
+ ),
+ )
owners = serializers.SerializerMethodField(
help_text=(
"Who answers for this scout, seed-creator first. Ownership is recorded on the scout's "
@@ -2963,6 +2977,12 @@ class SignalScoutConfigSerializer(serializers.ModelSerializer):
info = (self.context.get("skill_info") or {}).get(obj.skill_name)
return info.origin if info else "custom"
+ @extend_schema_field(serializers.ChoiceField(choices=ScoutRole.choices))
+ def get_scout_role(self, obj: SignalScoutConfig) -> str:
+ # Same single-query `skill_info` map as `get_description`.
+ info = (self.context.get("skill_info") or {}).get(obj.skill_name)
+ return info.role if info else "specialist"
+
@extend_schema_field(UserBasicSerializer(many=True))
def get_owners(self, obj: SignalScoutConfig) -> list[dict[str, Any]]:
# A scout joins to its skill by name, which is also the key `LLMSkillOwner` uses, so the
@@ -2980,6 +3000,7 @@ class SignalScoutConfigSerializer(serializers.ModelSerializer):
"description",
"display_name",
"scout_origin",
+ "scout_role",
"owners",
"enabled",
"status",
@@ -3159,6 +3180,8 @@ class SignalScoutConfigUpdateSerializer(_ScoutConfigCapabilityFieldsMixin, seria
return _validate_output_destinations(value, self.context)
def update(self, instance: SignalScoutConfig, validated_data: dict) -> SignalScoutConfig:
+ if "auto_pause_exempt" in validated_data:
+ validated_data["auto_pause_exempt_by_role"] = False
output_destinations = validated_data.get("output_destinations")
current_slack = instance.output_destinations.get("slack") if instance.output_destinations else None
incoming_slack = output_destinations.get("slack") if output_destinations else None
diff --git a/products/signals/backend/scout_harness/views.py b/products/signals/backend/scout_harness/views.py
index 9f499c0e55b0..aab3b9cc478e 100644
--- a/products/signals/backend/scout_harness/views.py
+++ b/products/signals/backend/scout_harness/views.py
@@ -68,7 +68,13 @@ from products.signals.backend.report_charts import ChartSize
from products.signals.backend.report_generation.resolve_reviewers import MAX_PROJECT_MEMBERS, list_project_members
from products.signals.backend.scout_harness.config_registry import enabled_scout_count, ensure_scout_category
from products.signals.backend.scout_harness.fleet_sync import materialize_scout_fleet
-from products.signals.backend.scout_harness.lazy_seed import SCOUT_SKILL_CATEGORY, scout_skill_origin
+from products.signals.backend.scout_harness.lazy_seed import (
+ SCOUT_ROLE_OPERATIONAL,
+ SCOUT_ROLE_SPECIALIST,
+ SCOUT_SKILL_CATEGORY,
+ is_operational_scout,
+ scout_skill_origin,
+)
from products.signals.backend.scout_harness.limits import MAX_ENABLED_SCOUTS_PER_TEAM
from products.signals.backend.scout_harness.run_costs import scout_run_token_costs
from products.signals.backend.scout_harness.run_gates import (
@@ -109,6 +115,7 @@ from products.signals.backend.scout_harness.serializers import (
ScoutNoteCreateRequestSerializer,
ScoutNoteSerializer,
ScoutNotesQuerySerializer,
+ ScoutOrigin,
ScoutRunIdsBatchRequestSerializer,
ScoutRunTokenCostsSerializer,
ScratchpadEntrySerializer,
@@ -2069,31 +2076,41 @@ def _skill_matches_scout_definition(
class _ScoutSkillInfo:
"""Per-skill metadata the config serializer needs but doesn't store on the config row.
- Both fields come from the team's latest `LLMSkill` row for the scout, resolved by the
- view in one query so the list endpoint stays a single lookup rather than one per config.
+ Every field comes from the team's latest `LLMSkill` row for the scout (plus, for `role`, the
+ canonical fleet on disk), resolved by the view in one query so the list endpoint stays a
+ single lookup rather than one per config.
"""
description: str
origin: str # "canonical" | "custom" — see `lazy_seed.scout_skill_origin`.
+ role: str # "specialist" | "operational" — see `lazy_seed.is_operational_scout`.
def _skill_info_for(team_id: int, skill_names: list[str]) -> dict[str, _ScoutSkillInfo]:
- """Map each scout `skill_name` to its latest `LLMSkill` description + origin on the team.
+ """Map each scout `skill_name` to its latest `LLMSkill` description, origin and role on the team.
- One query for the whole config list — feeds the serializer's `description` and `origin`
- fields so callers get a quick steer on each scout (and whether it's a canonical or
- hand-authored scout) without loading the full skill body. Skills the team no longer has
- simply drop out of the map (serializer falls back to "" / "custom").
+ One query for the whole config list — feeds the serializer's `description`, `scout_origin` and
+ `scout_role` fields so callers get a quick steer on each scout (and on whether the roster may
+ offer to delete it) without loading the full skill body. Archived skills retain their origin
+ and role so archival cannot bypass deletion protection. Their descriptions stay empty.
"""
names = list(set(skill_names))
if not names:
return {}
- rows = LLMSkill.objects.filter(team_id=team_id, name__in=names, is_latest=True, deleted=False).values_list(
- "name", "description", "metadata"
+ rows = LLMSkill.objects.filter(team_id=team_id, name__in=names, is_latest=True).values_list(
+ "name", "description", "metadata", "deleted"
)
return {
- name: _ScoutSkillInfo(description=description or "", origin=scout_skill_origin(name, metadata))
- for name, description, metadata in rows
+ name: _ScoutSkillInfo(
+ description="" if deleted else (description or ""),
+ origin=(origin := scout_skill_origin(name, metadata)),
+ # The role is only the harness's to claim on a scout the harness owns: a team's own
+ # skill sharing a canonical name is custom, and reads as a specialist like any other.
+ role=SCOUT_ROLE_OPERATIONAL
+ if origin == ScoutOrigin.CANONICAL.value and is_operational_scout(name)
+ else SCOUT_ROLE_SPECIALIST,
+ )
+ for name, description, metadata, deleted in rows
}
@@ -2722,6 +2739,7 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
request=None,
responses={
204: OpenApiResponse(description="Config deleted."),
+ 400: OpenApiResponse(description="This scout is operational and cannot be deleted."),
404: OpenApiResponse(description="Config not found for this project."),
},
summary="Delete a scout config",
@@ -2735,7 +2753,9 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
"coordinator's next tick. A scout under any other name does not come back on its own: "
"its config stays deleted until you re-register it, and its skill still reads as a "
"scout meanwhile. To retire a live scout, archive its skill (or set `enabled=false` to "
- "make it inert) rather than deleting the config."
+ "make it inert) rather than deleting the config. A scout whose `scout_role` is "
+ "`operational` cannot be deleted: it is part of the self-driving system rather than "
+ "the project's own fleet."
),
operation_id="signals_scout_config_destroy",
)
@@ -2745,6 +2765,14 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
config = SignalScoutConfig.objects.unscoped().filter(team_id=team_id, id=config_id).first()
if config is None:
raise exceptions.NotFound()
+ # Never the orphan cleanup this endpoint is for, because an operational scout's skill
+ # ships on disk and the next coordinator tick seeds the row straight back.
+ info = _skill_info_for(team_id, [config.skill_name]).get(config.skill_name)
+ if info is not None and info.role == SCOUT_ROLE_OPERATIONAL:
+ raise exceptions.ValidationError(
+ "This scout watches the self-driving system itself, so it can't be deleted. "
+ "Switch it off in its settings if you need it to stop running."
+ )
# Delete on the instance (not the queryset) so ModelActivityMixin's delete hook fires —
# config changes drive spend and are activity-logged, removals included.
config.delete()
diff --git a/products/signals/backend/test/test_scout_coordinator.py b/products/signals/backend/test/test_scout_coordinator.py
index db4cfe569a2c..88d2f25ef694 100644
--- a/products/signals/backend/test/test_scout_coordinator.py
+++ b/products/signals/backend/test/test_scout_coordinator.py
@@ -2,6 +2,7 @@ from __future__ import annotations
import random
from datetime import UTC, datetime, timedelta
+from pathlib import Path
from typing import Any
from zoneinfo import ZoneInfo
@@ -23,6 +24,7 @@ from posthog.models.scoping import team_scope
from posthog.sync import database_sync_to_async
from products.signals.backend.models import SignalScoutConfig
+from products.signals.backend.scout_harness import lazy_seed
from products.signals.backend.scout_harness.config_registry import register_missing_configs
from products.signals.backend.scout_harness.lazy_seed import HARNESS_SEEDED_BY, sync_canonical_skills
from products.signals.backend.scout_harness.limits import (
@@ -33,6 +35,7 @@ from products.signals.backend.scout_harness.limits import (
# The flag-payload read + per-team cap resolution live in `scout_harness/team_limits.py`; helpers
# defined there are imported and patched there (see `_PAYLOAD_PATH` / `_IS_CLOUD_PATH`).
+from products.signals.backend.scout_harness.serializers import SignalScoutConfigUpdateSerializer
from products.signals.backend.scout_harness.team_limits import (
DEFAULT_ENROLLED_TEAM_IDS,
SIGNALS_SCOUT_DISCOVERY_DISTINCT_ID,
@@ -1503,6 +1506,226 @@ async def test_seed_launch_cadence_stamped_on_disabled_canonical(ateam):
assert rows["signals-scout-error-tracking"] == (False, 720)
+# ── Operational scouts (scout-role: operational) ──────────────────────────────────
+
+# Read from disk by the harness, so a rename here is a real fleet rename, not a fixture choice.
+_OPERATIONAL_SCOUT = "signals-scout-inbox-validation"
+
+
+async def test_operational_scout_seeds_enabled_and_exempt_outside_the_allowlist(ateam):
+ # The allowlist decides what a project spends watching its own product, and the harness
+ # watching itself is not that.
+ await database_sync_to_async(_create_skill)(ateam, "signals-scout-general")
+ await database_sync_to_async(_create_skill)(ateam, "signals-scout-error-tracking")
+ await database_sync_to_async(_create_skill)(ateam, _OPERATIONAL_SCOUT)
+
+ def _payload(*_a, **_k):
+ return {
+ "guaranteed_team_ids": [int(t) for t in _FLAGGED_TEAM_IDS],
+ "default_team_config": {"enabled_skills": ["signals-scout-general"]},
+ }
+
+ with patch(_PAYLOAD_PATH, side_effect=_payload):
+ await _run_activity()
+
+ rows = await database_sync_to_async(
+ lambda: {
+ c.skill_name: (c.enabled, c.auto_pause_exempt) for c in SignalScoutConfig.all_teams.filter(team_id=ateam.id)
+ }
+ )()
+ assert rows[_OPERATIONAL_SCOUT] == (True, True)
+ assert rows["signals-scout-general"] == (True, False)
+ assert rows["signals-scout-error-tracking"] == (False, False)
+
+
+async def test_operational_scout_seeds_enabled_past_the_enabled_cap(ateam):
+ # A full fleet must not silence the follow-up check.
+ await database_sync_to_async(_create_skill)(ateam, "signals-scout-existing")
+ await database_sync_to_async(_create_config)(ateam, "signals-scout-existing", enabled=True)
+ await database_sync_to_async(_create_skill)(ateam, "signals-scout-fresh")
+ await database_sync_to_async(_create_skill)(ateam, _OPERATIONAL_SCOUT)
+
+ with patch("products.signals.backend.scout_harness.config_registry.MAX_ENABLED_SCOUTS_PER_TEAM", 1):
+ await _run_activity()
+
+ rows = await database_sync_to_async(
+ lambda: {c.skill_name: c.enabled for c in SignalScoutConfig.all_teams.filter(team_id=ateam.id)}
+ )()
+ assert rows[_OPERATIONAL_SCOUT] is True
+ assert rows["signals-scout-fresh"] is False
+
+
+async def test_withheld_operational_scout_is_still_held_back(ateam):
+ # An unreleased scout must not let itself out by declaring what it is.
+ await database_sync_to_async(_create_skill)(ateam, _OPERATIONAL_SCOUT)
+
+ def _payload(*_a, **_k):
+ return {
+ "guaranteed_team_ids": [int(t) for t in _FLAGGED_TEAM_IDS],
+ "default_team_config": {"withheld_skills": [_OPERATIONAL_SCOUT]},
+ }
+
+ with patch(_PAYLOAD_PATH, side_effect=_payload):
+ planned = await _run_activity()
+
+ exists = await database_sync_to_async(
+ lambda: SignalScoutConfig.all_teams.filter(team_id=ateam.id, skill_name=_OPERATIONAL_SCOUT).exists()
+ )()
+ assert exists is False
+ assert [p.skill_name for p in planned] == []
+
+
+ "status,pause_reason",
+ [
+ (SignalScoutConfig.Status.PENDING_PAUSE, SignalScoutConfig.PauseReason.NO_OUTPUT),
+ (SignalScoutConfig.Status.PAUSED_BY_SYSTEM, SignalScoutConfig.PauseReason.IGNORED),
+ ],
+)
+def test_reconcile_resumes_an_operational_scout_the_sweep_silenced(status, pause_reason):
+ # The seed posture is forward-only, so a row that predates the role recovers only here.
+ org = Organization.objects.create(name="op-sweep-org", is_ai_data_processing_approved=True)
+ team = Team.objects.create(organization=org, name="op-sweep-team")
+ with team_scope(team.id, canonical=True):
+ _create_skill(team, _OPERATIONAL_SCOUT)
+ _create_config(team, _OPERATIONAL_SCOUT, status=status, pause_reason=pause_reason)
+
+ register_missing_configs(team.id)
+
+ config = SignalScoutConfig.all_teams.get(team_id=team.id, skill_name=_OPERATIONAL_SCOUT)
+ assert config.status == SignalScoutConfig.Status.ACTIVE
+ assert config.enabled is True
+ assert config.pause_reason is None
+ assert config.auto_pause_exempt is True
+
+
+def test_reconcile_resumes_an_operational_scout_seeded_disabled():
+ # An `enabled=False` create is stored as `paused_by_user`, so the reconcile has to tell an
+ # untouched seed apart from a person switching the scout off.
+ org = Organization.objects.create(name="op-seeded-off-org", is_ai_data_processing_approved=True)
+ team = Team.objects.create(organization=org, name="op-seeded-off-team")
+ with team_scope(team.id, canonical=True):
+ _create_skill(team, _OPERATIONAL_SCOUT)
+ seeded_off = _create_config(team, _OPERATIONAL_SCOUT, enabled=False)
+ assert seeded_off.status == SignalScoutConfig.Status.PAUSED_BY_USER
+ assert seeded_off.status_changed_at is None
+
+ register_missing_configs(team.id)
+
+ config = SignalScoutConfig.all_teams.get(team_id=team.id, skill_name=_OPERATIONAL_SCOUT)
+ assert config.enabled is True
+ assert config.status == SignalScoutConfig.Status.ACTIVE
+ assert config.auto_pause_exempt is True
+
+
[email protected]("explicit_exemption", [None, False, True])
+def test_role_change_preserves_only_user_exemptions(tmp_path: Path, explicit_exemption: bool | None) -> None:
+ org = Organization.objects.create(name="role-change-org", is_ai_data_processing_approved=True)
+ team = Team.objects.create(organization=org, name="role-change-team")
+ skill_dir = tmp_path / _OPERATIONAL_SCOUT
+ skill_dir.mkdir()
+ skill_file = skill_dir / "SKILL.md"
+ frontmatter = f"---\nname: {_OPERATIONAL_SCOUT}\ndescription: test scout\nscout-role: {{role}}\n---\nBody\n"
+ caches = (
+ lazy_seed.canonical_skill_names,
+ lazy_seed._canonical_config_tags,
+ lazy_seed._canonical_operational_scouts,
+ )
+ try:
+ with team_scope(team.id, canonical=True), patch.object(lazy_seed, "_SKILLS_DIR", tmp_path):
+ for cache in caches:
+ cache.cache_clear()
+ skill_file.write_text(frontmatter.format(role="operational"))
+ sync_canonical_skills(team)
+ register_missing_configs(team.id)
+ config = SignalScoutConfig.objects.get(team=team, skill_name=_OPERATIONAL_SCOUT)
+ assert config.auto_pause_exempt is True
+
+ if explicit_exemption is not None:
+ serializer = SignalScoutConfigUpdateSerializer(
+ config, data={"auto_pause_exempt": explicit_exemption}, partial=True
+ )
+ assert serializer.is_valid(), serializer.errors
+ serializer.save()
+
+ skill_file.write_text(frontmatter.format(role="specialist"))
+ for cache in caches:
+ cache.cache_clear()
+ sync_canonical_skills(team)
+ register_missing_configs(team.id)
+
+ config.refresh_from_db()
+ assert config.auto_pause_exempt is (explicit_exemption is True)
+ assert config.enabled is True
+ finally:
+ for cache in caches:
+ cache.cache_clear()
+
+
+def test_reconcile_leaves_a_human_pause_alone():
+ # The recorded transition is what separates this from the seed's own `paused_by_user` row.
+ org = Organization.objects.create(name="op-human-off-org", is_ai_data_processing_approved=True)
+ team = Team.objects.create(organization=org, name="op-human-off-team")
+ with team_scope(team.id, canonical=True):
+ _create_skill(team, _OPERATIONAL_SCOUT)
+ config = _create_config(team, _OPERATIONAL_SCOUT, enabled=False)
+ SignalScoutConfig.all_teams.filter(pk=config.pk).update(status_changed_at=timezone.now())
+
+ register_missing_configs(team.id)
+
+ config.refresh_from_db()
+ assert config.enabled is False
+ assert config.status == SignalScoutConfig.Status.PAUSED_BY_USER
+ # Still exempted: the sweep must not re-warn it if the person turns it back on.
+ assert config.auto_pause_exempt is True
+
+
+def test_reconcile_leaves_a_failure_pause_alone():
+ # The failure breaker owns this pause, and resuming it would spend runs on a scout that
+ # cannot finish one.
+ org = Organization.objects.create(name="op-failing-org", is_ai_data_processing_approved=True)
+ team = Team.objects.create(organization=org, name="op-failing-team")
+ with team_scope(team.id, canonical=True):
+ _create_skill(team, _OPERATIONAL_SCOUT)
+ _create_config(
+ team,
+ _OPERATIONAL_SCOUT,
+ status=SignalScoutConfig.Status.PAUSED_BY_SYSTEM,
+ pause_reason=SignalScoutConfig.PauseReason.REPEATED_FAILURES,
+ )
+
+ register_missing_configs(team.id)
+
+ config = SignalScoutConfig.all_teams.get(team_id=team.id, skill_name=_OPERATIONAL_SCOUT)
+ assert config.status == SignalScoutConfig.Status.PAUSED_BY_SYSTEM
+ assert config.pause_reason == SignalScoutConfig.PauseReason.REPEATED_FAILURES
+
+
+def test_a_teams_own_scout_sharing_an_operational_name_gets_no_exemption():
+ # A hand-authored skill must not inherit a posture that skips the harness's controls.
+ org = Organization.objects.create(name="op-lookalike-org", is_ai_data_processing_approved=True)
+ team = Team.objects.create(organization=org, name="op-lookalike-team")
+ with team_scope(team.id, canonical=True):
+ _create_skill(team, _OPERATIONAL_SCOUT, seeded=False)
+
+ register_missing_configs(team.id)
+
+ config = SignalScoutConfig.all_teams.get(team_id=team.id, skill_name=_OPERATIONAL_SCOUT)
+ assert config.auto_pause_exempt is False
+
+
# ── Per-scout holdback denylist (withheld_skills) ─────────────────────────────────
diff --git a/products/signals/backend/test/test_scout_harness_api.py b/products/signals/backend/test/test_scout_harness_api.py
index 7b12518b6e06..eaa99c83a7ac 100644
--- a/products/signals/backend/test/test_scout_harness_api.py
+++ b/products/signals/backend/test/test_scout_harness_api.py
@@ -2485,6 +2485,30 @@ class TestScoutHarnessConfigAPI(APIBaseTest):
assert response.status_code == status.HTTP_200_OK
assert response.json()[0]["scout_origin"] == expected_origin
+ @parameterized.expand(
+ [
+ # Both names are real on-disk canonical scouts, one of each role.
+ (
+ "operational_canonical",
+ "signals-scout-inbox-validation",
+ {"seeded_by": HARNESS_SEEDED_BY},
+ "operational",
+ ),
+ ("specialist_canonical", "signals-scout-general", {"seeded_by": HARNESS_SEEDED_BY}, "specialist"),
+ ("hand_authored_lookalike", "signals-scout-inbox-validation", {}, "specialist"),
+ ]
+ )
+ def test_list_classifies_role_from_the_canonical_fleet(
+ self, _name: str, skill_name: str, metadata: dict, expected_role: str
+ ) -> None:
+ SignalScoutConfig.objects.create(team=self.team, skill_name=skill_name)
+ LLMSkill.objects.create(team=self.team, name=skill_name, description="d", body="...", metadata=metadata)
+
+ response = self.client.get(self._list_url())
+
+ assert response.status_code == status.HTTP_200_OK
+ assert response.json()[0]["scout_role"] == expected_role
+
@parameterized.expand(["list", "partial_update", "sync"])
def test_config_responses_carry_the_skills_owners(self, action: str) -> None:
# Every response path builds the serializer's context by hand, and one that forgets the
@@ -3153,6 +3177,23 @@ class TestScoutHarnessConfigAPI(APIBaseTest):
assert response.status_code == status.HTTP_204_NO_CONTENT
assert not SignalScoutConfig.all_teams.filter(id=config.id).exists()
+ @parameterized.expand([(False,), (True,)])
+ def test_destroy_refuses_an_operational_scout(self, archived: bool) -> None:
+ config = SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-inbox-validation")
+ LLMSkill.objects.create(
+ team=self.team,
+ name="signals-scout-inbox-validation",
+ description="d",
+ body="...",
+ metadata={"seeded_by": HARNESS_SEEDED_BY},
+ deleted=archived,
+ )
+
+ response = self.client.delete(self._detail_url(str(config.id)))
+
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
+ assert SignalScoutConfig.all_teams.filter(id=config.id).exists()
+
def test_destroy_unknown_id_returns_404(self) -> None:
response = self.client.delete(self._detail_url("00000000-0000-0000-0000-000000000000"))
assert response.status_code == status.HTTP_404_NOT_FOUND
diff --git a/products/signals/backend/test/test_scout_harness_lazy_seed.py b/products/signals/backend/test/test_scout_harness_lazy_seed.py
index 90df95717696..3cb9154f08ce 100644
--- a/products/signals/backend/test/test_scout_harness_lazy_seed.py
+++ b/products/signals/backend/test/test_scout_harness_lazy_seed.py
@@ -14,6 +14,7 @@ from products.signals.backend.scout_harness.lazy_seed import (
CanonicalSkill,
CanonicalSkillFile,
CanonicalSkillParseError,
+ ScoutRole,
SyncResult,
_compute_canonical_hash,
_compute_row_hash,
@@ -52,6 +53,7 @@ def _make_canonical(
allowed_tools: tuple[str, ...] = (),
files: tuple[CanonicalSkillFile, ...] = (),
config_tags: tuple[str, ...] = (),
+ role: ScoutRole = "specialist",
) -> CanonicalSkill:
"""Build a CanonicalSkill for a unit test without going through disk + frontmatter."""
return CanonicalSkill(
@@ -62,6 +64,7 @@ def _make_canonical(
files=files,
source_path=Path("/tmp/fake"),
config_tags=config_tags,
+ role=role,
)
@@ -312,6 +315,65 @@ class TestDiscoverCanonicalSkills:
with pytest.raises(CanonicalSkillParseError, match="Only a signals-scout-\\* skill may declare 'scout-tags'"):
discover_canonical_skills(tmp_path)
+ def test_parses_scout_role(self, tmp_path: Path) -> None:
+ _write_canonical_skill(
+ tmp_path,
+ dir_name="signals-scout-bar",
+ frontmatter="""
+ ---
+ name: signals-scout-bar
+ description: bar skill
+ scout-role: operational
+ ---
+ """,
+ body="# Bar\n",
+ )
+ assert discover_canonical_skills(tmp_path)[0].role == "operational"
+
+ def test_defaults_to_the_specialist_role(self, tmp_path: Path) -> None:
+ # The default has to be the posture that keeps every control on.
+ _write_canonical_skill(
+ tmp_path,
+ dir_name="signals-scout-bar",
+ frontmatter="""
+ ---
+ name: signals-scout-bar
+ description: bar skill
+ ---
+ """,
+ body="# Bar\n",
+ )
+ assert discover_canonical_skills(tmp_path)[0].role == "specialist"
+
+ @pytest.mark.parametrize("scout_role_yaml", ["scout-role: infrastructure", "scout-role:", "scout-role:\n - ops"])
+ def test_rejects_unknown_scout_role(self, tmp_path: Path, scout_role_yaml: str) -> None:
+ # Falling back to `specialist` would silence the scout the role exists to protect.
+ _write_canonical_skill(
+ tmp_path,
+ dir_name="signals-scout-bar",
+ frontmatter=f"---\nname: signals-scout-bar\ndescription: bar skill\n{scout_role_yaml}\n---\n",
+ body="# Bar\n",
+ )
+ with pytest.raises(CanonicalSkillParseError, match="'scout-role' must be one of"):
+ discover_canonical_skills(tmp_path)
+
+ def test_rejects_scout_role_on_companion_skill(self, tmp_path: Path) -> None:
+ # A companion skill never gets a config, so there is no posture for a role to shape.
+ _write_canonical_skill(
+ tmp_path,
+ dir_name="authoring-scouts",
+ frontmatter="""
+ ---
+ name: authoring-scouts
+ description: companion authoring guide
+ scout-role: operational
+ ---
+ """,
+ body="# Authoring\n",
+ )
+ with pytest.raises(CanonicalSkillParseError, match="Only a signals-scout-\\* skill may declare 'scout-role'"):
+ discover_canonical_skills(tmp_path)
+
def test_parses_bundled_files_under_allowed_subdirs(self, tmp_path: Path) -> None:
# `_ALLOWED_BUNDLE_SUBDIRS` is kept in lockstep with `hogli build:skills` —
# `references/` and `scripts/` only. `assets/` and any other subdir are intentionally
@@ -522,6 +584,13 @@ class TestComputeCanonicalHash:
b = _make_canonical("signals-scout-foo", body="x", config_tags=("ai-observability",))
assert _compute_canonical_hash(a) == _compute_canonical_hash(b)
+ def test_scout_role_does_not_change_hash(self) -> None:
+ # Like tags, the role shapes the config rather than the skill row, so folding it in would
+ # leave every seeded row permanently diverged and freeze content updates.
+ a = _make_canonical("signals-scout-foo", body="x")
+ b = _make_canonical("signals-scout-foo", body="x", role="operational")
+ assert _compute_canonical_hash(a) == _compute_canonical_hash(b)
+
def test_canonical_and_row_hashes_agree_when_content_matches(self) -> None:
"""When a row's content matches the canonical exactly, the two hashing helpers
produce the same digest. This is the round-trip the sync function depends on."""
@@ -989,6 +1058,17 @@ class TestSeedCanonicalSkillsAlias(BaseTest):
assert loaded.version == 1
assert "Signals scout" in loaded.body
+ def test_real_fleet_operational_scout_seeds_enabled_and_exempt(self) -> None:
+ # No mocking, so a dropped frontmatter key fails here and not by a pause weeks later.
+ seed_canonical_skills(self.team)
+ register_missing_configs(self.team.id)
+
+ operational = SignalScoutConfig.all_teams.get(team=self.team, skill_name="signals-scout-inbox-validation")
+ assert operational.enabled is True
+ assert operational.auto_pause_exempt is True
+ specialist = SignalScoutConfig.all_teams.get(team=self.team, skill_name="signals-scout-general")
+ assert specialist.auto_pause_exempt is False
+
def test_real_fleet_scout_tags_land_on_the_seeded_config(self) -> None:
# The whole path a product surface depends on: `scout-tags` in the in-repo SKILL.md →
# the tag column the AI observability tab filters its scout list on. No mocking, so
diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.ts
index 1a25c7394692..3770d7c0cf67 100644
--- a/products/signals/frontend/generated/api.schemas.ts
+++ b/products/signals/frontend/generated/api.schemas.ts
@@ -2559,6 +2559,13 @@ export const ScoutOriginEnumApi = {
Custom: 'custom',
} as const
+export type ScoutRoleEnumApi = (typeof ScoutRoleEnumApi)[keyof typeof ScoutRoleEnumApi]
+
+export const ScoutRoleEnumApi = {
+ Specialist: 'specialist',
+ Operational: 'operational',
+} as const
+
/**
* * `engineering` - Engineering
* * `data` - Data
@@ -2671,6 +2678,8 @@ export interface SignalScoutConfigApi {
display_name?: string
/** Where this scout came from: `canonical` for a scout PostHog ships and maintains (seeded from `products/signals/skills/`), or `custom` for one a team hand-authored on this project. Use it to badge built-in vs custom scouts instead of a hardcoded name list. Defaults to `custom` if the skill is not currently present on the team. */
readonly scout_origin: ScoutOriginEnumApi
+ /** What this scout is to the harness: `specialist` for one that watches a product surface, or `operational` for one PostHog ships to watch the self-driving system itself. An operational scout is exempt from the inactivity sweep and from the enabled-scout cap, and is not a scout a project should delete. Always `specialist` for a custom scout. */
+ readonly scout_role: ScoutRoleEnumApi
/** Who answers for this scout, seed-creator first. Ownership is recorded on the scout's skill rather than on this config, so editing the skill or toggling the scout leaves it unchanged. Reports the scout files suggest these people as reviewers. Prefer this over `created_by`-style fields, which only say who last flipped a switch. Empty when nobody owns the scout, when the owners are no longer members with access to the project, or when the caller is a scout sandbox token: owners are member PII, and a scout reads them through the skill API instead. */
readonly owners: readonly UserBasicApi[]
/** Whether this scout runs on its schedule. Disabled scouts are skipped by the coordinator. Derived from `status`: true for `active` and `pending_pause`, false for the paused statuses. */
diff --git a/products/signals/frontend/generated/api.ts b/products/signals/frontend/generated/api.ts
index 93fd767b5526..3f7183f8fd40 100644
--- a/products/signals/frontend/generated/api.ts
+++ b/products/signals/frontend/generated/api.ts
@@ -1039,7 +1039,7 @@ export const getSignalsScoutConfigDestroyUrl = (projectId: string, id: string) =
}
/**
- * Delete one scout config by its `id`, removing the per-(team, skill) schedule/emit row outright. The point is cleaning up an orphaned config whose skill was archived or deleted — it lingers in `list` with an empty `description`, never runs (the coordinator skips it and the skill can't load), but can't otherwise be removed over the API. Deletion is activity-logged. Note: auto-registration only scans live `signals-scout-*` skills, so a config deleted for one of those is back on the coordinator's next tick. A scout under any other name does not come back on its own: its config stays deleted until you re-register it, and its skill still reads as a scout meanwhile. To retire a live scout, archive its skill (or set `enabled=false` to make it inert) rather than deleting the config.
+ * Delete one scout config by its `id`, removing the per-(team, skill) schedule/emit row outright. The point is cleaning up an orphaned config whose skill was archived or deleted — it lingers in `list` with an empty `description`, never runs (the coordinator skips it and the skill can't load), but can't otherwise be removed over the API. Deletion is activity-logged. Note: auto-registration only scans live `signals-scout-*` skills, so a config deleted for one of those is back on the coordinator's next tick. A scout under any other name does not come back on its own: its config stays deleted until you re-register it, and its skill still reads as a scout meanwhile. To retire a live scout, archive its skill (or set `enabled=false` to make it inert) rather than deleting the config. A scout whose `scout_role` is `operational` cannot be deleted: it is part of the self-driving system rather than the project's own fleet.
* @summary Delete a scout config
*/
export const signalsScoutConfigDestroy = async (
diff --git a/products/signals/frontend/inbox/__mocks__/scoutConfigs.ts b/products/signals/frontend/inbox/__mocks__/scoutConfigs.ts
index 0fe33439d74e..acba425ab198 100644
--- a/products/signals/frontend/inbox/__mocks__/scoutConfigs.ts
+++ b/products/signals/frontend/inbox/__mocks__/scoutConfigs.ts
@@ -33,6 +33,7 @@ const MOCK_SCOUT_OWNERS = [
function makeMockScout(overrides: MockScoutOverrides): SignalScoutConfigApi {
return {
scout_origin: 'canonical',
+ scout_role: 'specialist',
owners: [],
enabled: true,
status: 'active',
@@ -216,6 +217,15 @@ export const mockLargeScoutFleet: SignalScoutConfigApi[] = [
status: 'pending_pause',
pause_reason: 'ignored',
}),
+ makeMockScout({
+ id: 'scout-operational',
+ skill_name: 'signals-scout-inbox-validation',
+ description: 'whether the fixes shipped from this inbox actually held',
+ scout_role: 'operational',
+ auto_pause_exempt: true,
+ run_interval_minutes: 60,
+ last_run_at: '2026-06-10T23:00:00Z',
+ }),
]
function makeMockSuggestion(
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.test.tsx
new file mode 100644
index 000000000000..8ed18260e813
--- /dev/null
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.test.tsx
@@ -0,0 +1,39 @@
+import '@testing-library/jest-dom'
+
+import { cleanup, render, screen } from '@testing-library/react'
+
+import { mockScoutConfigs } from '../../../__mocks__/scoutConfigs'
+import { ScoutExemptionBadge } from './ScoutBadges'
+
+describe('ScoutExemptionBadge', () => {
+ const config = mockScoutConfigs[0]
+
+ afterEach(cleanup)
+
+ it('labels an operational scout in every roster group', () => {
+ // A badge that only showed while "watching" would vanish the week the scout files a
+ // report, which is exactly when someone might switch it off as an ordinary scout.
+ render(<ScoutExemptionBadge config={{ ...config, scout_role: 'operational' }} group="working" />)
+ expect(screen.getByText('Operational')).toBeInTheDocument()
+ })
+
+ it('labels a hand-exempted specialist as quiet by design', () => {
+ render(
+ <ScoutExemptionBadge
+ config={{ ...config, scout_role: 'specialist', auto_pause_exempt: true }}
+ group="watching"
+ />
+ )
+ expect(screen.getByText('Quiet by design')).toBeInTheDocument()
+ })
+
+ it('renders nothing for a scout the sweep still judges', () => {
+ const { container } = render(
+ <ScoutExemptionBadge
+ config={{ ...config, scout_role: 'specialist', auto_pause_exempt: false }}
+ group="watching"
+ />
+ )
+ expect(container).toBeEmptyDOMElement()
+ })
+})
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.tsx
index 8227e5671360..3d7f79365c5e 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.tsx
@@ -7,6 +7,8 @@ import type {
SignalScoutConfigApi as SignalScoutConfig,
} from 'products/signals/frontend/generated/api.schemas'
+import { ScoutGroupKey } from '../../../utils/scoutGroups'
+
/**
* Where the scout stands with the system writers that can pause it: the failure breaker
* (`repeated_failures`) or the inactivity sweep (`no_output` / `ignored`), plus the sweep's
@@ -69,6 +71,38 @@ export function ScoutLifecycleBadge({ config }: { config: SignalScoutConfig }):
return null
}
+/**
+ * Why the inactivity sweep leaves this scout alone, in the terms the exemption came from: the role
+ * PostHog ships it with, or a choice someone made on this project. Nothing renders for a scout the
+ * sweep still judges. The role shows in any group, because it says what the scout is rather
+ * than how its run window went.
+ */
+export function ScoutExemptionBadge({
+ config,
+ group,
+}: {
+ config: SignalScoutConfig
+ group: ScoutGroupKey
+}): JSX.Element | null {
+ if (config.scout_role === 'operational') {
+ return (
+ <Tooltip title="Part of the self-driving system rather than this project's fleet. It checks whether shipped fixes held, so it keeps running and is never paused for being quiet.">
+ <LemonTag type="muted" size="small">
+ Operational
+ </LemonTag>
+ </Tooltip>
+ )
+ }
+ if (config.auto_pause_exempt && group === 'watching') {
+ return (
+ <Tooltip title="Exempt from auto-pause, because this scout is supposed to stay quiet">
+ <LemonTag size="small">Quiet by design</LemonTag>
+ </Tooltip>
+ )
+ }
+ return null
+}
+
/** Canonical (PostHog-maintained) vs Custom (team-authored) scout badge. */
export function ScoutOriginBadge({ origin }: { origin: ScoutOriginEnumApi }): JSX.Element {
return (
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutCadenceLabel.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutCadenceLabel.test.tsx
index d593f1cf9bc3..6d32da4f816d 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutCadenceLabel.test.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutCadenceLabel.test.tsx
@@ -14,6 +14,7 @@ const config: SignalScoutConfigApi = {
skill_name: 'signals-scout-general',
description: 'General scout',
scout_origin: 'canonical',
+ scout_role: 'specialist',
owners: [],
enabled: true,
status: 'active',
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsx
index 950c3976aab0..d2bcbed3c17c 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsx
@@ -17,6 +17,7 @@ const config: SignalScoutConfigApi = {
skill_name: 'signals-scout-general',
description: 'General scout',
scout_origin: 'canonical',
+ scout_role: 'specialist',
owners: [],
enabled: true,
status: 'active',
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsx
index 9d6623d45f2f..d1c43a1048b8 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsx
@@ -12,6 +12,7 @@ import type { SignalScoutConfigApi as SignalScoutConfig } from 'products/signals
import { captureScoutAction } from '../../../inboxAnalytics'
import { scoutFleetLogic } from '../../../logics/scoutFleetLogic'
import { scoutDisplayName, ScoutRollup } from '../../../utils/scoutRunsWindow'
+import { ScoutExemptionBadge } from './ScoutBadges'
import { ScoutEnabledSwitch } from './ScoutConfigControls'
import { ScoutHealthStrip } from './ScoutHealthStrip'
import { LeaveScoutNoteButton } from './ScoutNotesPanel'
@@ -102,6 +103,8 @@ export function ScoutDetailHeader({
<LemonTag size="small" type={config.scout_origin === 'canonical' ? 'muted' : 'highlight'}>
{config.scout_origin === 'canonical' ? 'Canonical' : 'Custom'}
</LemonTag>
+ {/* The page has no roster group, and the role is not a windowed judgment anyway. */}
+ <ScoutExemptionBadge config={config} group="watching" />
<ScoutOwners config={config} />
<span className="flex-1" />
<Tooltip title="Dispatch a run now, outside the schedule. Counts against the project's daily run budget.">
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutNameCell.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutNameCell.tsx
index f9b5bfe9533b..00029e393a8a 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutNameCell.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutNameCell.tsx
@@ -1,4 +1,4 @@
-import { LemonTag, Link, Tooltip } from '@posthog/lemon-ui'
+import { Link } from '@posthog/lemon-ui'
import { cn } from 'lib/utils/css-classes'
import { urls } from 'scenes/urls'
@@ -7,6 +7,7 @@ import type { SignalScoutConfigApi as SignalScoutConfig } from 'products/signals
import { ScoutGroupKey, scoutSubtitle } from '../../../utils/scoutGroups'
import { scoutDisplayName, ScoutRollup } from '../../../utils/scoutRunsWindow'
+import { ScoutExemptionBadge } from './ScoutBadges'
import { ScoutWriteAccessTag } from './ScoutWriteAccessTag'
const SUBTITLE_TONE_CLASS = {
@@ -35,11 +36,7 @@ export function ScoutNameCell({
{scoutDisplayName(config)}
</Link>
<ScoutWriteAccessTag writeScopes={config.write_scopes} emit={config.emit} compact={compact} />
- {config.auto_pause_exempt && group === 'watching' && (
- <Tooltip title="Exempt from auto-pause — this scout is supposed to stay quiet">
- <LemonTag size="small">Quiet by design</LemonTag>
- </Tooltip>
- )}
+ <ScoutExemptionBadge config={config} group={group} />
</div>
{subtitle && (
<span className={cn('line-clamp-1 text-[11.5px]', SUBTITLE_TONE_CLASS[subtitle.tone])}>
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutNextRunLabel.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutNextRunLabel.test.tsx
index b057ad33bc0e..780b57b3f41e 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutNextRunLabel.test.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutNextRunLabel.test.tsx
@@ -16,6 +16,7 @@ const config: SignalScoutConfigApi = {
skill_name: 'signals-scout-general',
description: 'General scout',
scout_origin: 'canonical',
+ scout_role: 'specialist',
owners: [],
enabled: true,
status: 'active',
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutRosterCard.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutRosterCard.tsx
index 1f82d296a1a5..e03e48b310be 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutRosterCard.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutRosterCard.tsx
@@ -1,6 +1,6 @@
import { useActions, useValues } from 'kea'
-import { LemonTag, Link, Tooltip } from '@posthog/lemon-ui'
+import { Link } from '@posthog/lemon-ui'
import { cn } from 'lib/utils/css-classes'
import { teamLogic } from 'scenes/teamLogic'
@@ -10,7 +10,7 @@ import { scoutFleetLogic } from '../../../logics/scoutFleetLogic'
import { nextRunAt, SCOUT_GROUP_LABEL, ScoutRosterRow, scoutSubtitle } from '../../../utils/scoutGroups'
import { scoutDisplayName } from '../../../utils/scoutRunsWindow'
import { inboxCardRowClassName } from '../../cards/inboxCardRowClassName'
-import { ScoutLifecycleBadge } from './ScoutBadges'
+import { ScoutExemptionBadge, ScoutLifecycleBadge } from './ScoutBadges'
import { ScoutCadenceLabel } from './ScoutCadenceLabel'
import { ScoutEnabledSwitch } from './ScoutConfigControls'
import { ScoutCostLine } from './ScoutCostLine'
@@ -71,11 +71,7 @@ export function ScoutRosterCard({ row }: { row: ScoutRosterRow }): JSX.Element {
{scoutDisplayName(config)}
</span>
<ScoutWriteAccessTag writeScopes={config.write_scopes} emit={config.emit} />
- {config.auto_pause_exempt && group === 'watching' && (
- <Tooltip title="Exempt from auto-pause, because this scout is supposed to stay quiet">
- <LemonTag size="small">Quiet by design</LemonTag>
- </Tooltip>
- )}
+ <ScoutExemptionBadge config={config} group={group} />
<ScoutLifecycleBadge config={config} />
</div>
{subtitle && (
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutTags.stories.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutTags.stories.tsx
index 6f082293fc58..bc3b0af8b74a 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutTags.stories.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutTags.stories.tsx
@@ -15,6 +15,7 @@ const config: SignalScoutConfigApi = {
skill_name: 'signals-scout-revenue-watch',
description: 'Watches revenue changes.',
scout_origin: 'custom',
+ scout_role: 'specialist',
owners: [],
enabled: true,
status: 'active',
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.test.tsx
index 00c72c6d7241..b344fc59927b 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.test.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.test.tsx
@@ -13,6 +13,7 @@ const CONFIG: SignalScoutConfigApi = {
skill_name: 'signals-scout-hygiene',
description: 'Dashboard hygiene',
scout_origin: 'custom',
+ scout_role: 'specialist',
owners: [],
enabled: true,
status: 'active',
diff --git a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts
index a5736a7e9462..bc9472f07e34 100644
--- a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts
+++ b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts
@@ -39,6 +39,7 @@ const CREATED_SCOUT: SignalScoutCreateResponseApi = {
skill_name: 'signals-scout-checkout-failures',
description: 'Investigates recurring checkout failures.',
scout_origin: 'custom',
+ scout_role: 'specialist',
owners: [],
enabled: false,
status: 'paused_by_user',
diff --git a/products/signals/frontend/inbox/logics/scoutFleetLogic.test.ts b/products/signals/frontend/inbox/logics/scoutFleetLogic.test.ts
index 5615015ae41d..4058b376111a 100644
--- a/products/signals/frontend/inbox/logics/scoutFleetLogic.test.ts
+++ b/products/signals/frontend/inbox/logics/scoutFleetLogic.test.ts
@@ -59,6 +59,7 @@ const BASE_CONFIG: SignalScoutConfigApi = {
skill_name: 'signals-scout-errors',
description: 'Finds error trends.',
scout_origin: 'canonical',
+ scout_role: 'specialist',
owners: [],
enabled: true,
status: 'active',
diff --git a/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.test.ts b/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.test.ts
index f3743f43e6c0..71beca985c20 100644
--- a/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.test.ts
+++ b/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.test.ts
@@ -96,6 +96,7 @@ const CONFIG: SignalScoutConfigApi = {
skill_name: CANONICAL_ITEM.skill_name,
description: 'Watches web vitals.',
scout_origin: 'canonical',
+ scout_role: 'specialist',
owners: [],
enabled: false,
status: 'active',
diff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yaml
index 0be5b1fa873f..28295b107d86 100644
--- a/products/signals/mcp/tools.yaml
+++ b/products/signals/mcp/tools.yaml
@@ -449,7 +449,8 @@ tools:
the coordinator's next tick. A scout under any other name does not come back on its own: its config stays
deleted until you re-register it with `scout-config-create`, and its skill still reads as a scout meanwhile.
To retire a live scout, archive its skill (or set `enabled=false` via `scout-config-update` to make it
- inert) rather than deleting the config.
+ inert) rather than deleting the config. A scout whose `scout_role` is `operational` cannot be deleted at
+ all: it is part of the self-driving system rather than the project's own fleet.
scout-config-list:
operation: signals_scout_config_list
enabled: true
diff --git a/products/signals/skills/AGENTS.md b/products/signals/skills/AGENTS.md
index f3ec1cf3d158..28d210a87ac5 100644
--- a/products/signals/skills/AGENTS.md
+++ b/products/signals/skills/AGENTS.md
@@ -88,6 +88,11 @@ It is how a canonical scout claims a product surface: AI observability's self-dr
Tags are seeded at creation only — a person who removes one keeps it removed — so adding the key to a scout teams already run leaves their existing configs untagged until someone tags them through the config API.
They sit outside the canonical content hash, since they belong to the config rather than the skill row.
+Frontmatter also carries the optional **`scout-role`** value, which is `specialist` unless a scout says otherwise.
+A scout that watches the self-driving system rather than a product surface declares `scout-role: operational`, and the harness stops treating its quiet as waste: the config seeds enabled and exempt from the inactivity sweep, skips the launch allowlist and the per-team enabled-scout cap, and cannot be deleted through the config API.
+Unlike tags, the role is reconciled onto rows seeded earlier on every coordinator tick, because a silenced operational scout is the failure the role exists to prevent — though a pause a person made is still left standing, and `withheld_skills` still gates the scout.
+Use it only for a scout whose subject is the fleet itself: `signals-scout-inbox-validation`, which re-measures whether merged fixes held, is the one that ships with it.
+
The generalist (`signals-scout-general`) is **report-only** — it authors `SignalReport`s directly and does not `emit_signal`. The **report-channel contract** (when to author a fresh report vs. edit an existing one, the field schema, the safety × actionability status mapping, reviewer routing via `scout-members-list`, and the non-idempotency + pipeline-rewrite caveats) lives in the **harness prompt** (`scout_harness/prompt.py`), which forks on the scout's channel and injects it into every report-channel scout — so it is **not** duplicated as a per-scout reference. The generalist keeps one bundled reference:
- **`references/conventions.md`** — the four-states author/edit classifier, scratchpad key-prefix vocabulary, and cross-project noise patterns.
diff --git a/products/signals/skills/signals-scout-inbox-validation/SKILL.md b/products/signals/skills/signals-scout-inbox-validation/SKILL.md
index 88c0be74c2ce..7e32a963d8b5 100644
--- a/products/signals/skills/signals-scout-inbox-validation/SKILL.md
+++ b/products/signals/skills/signals-scout-inbox-validation/SKILL.md
@@ -13,6 +13,7 @@ compatibility: >
allowed_tools:
- emit_report
- edit_report
+scout-role: operational
metadata:
owner_team: signals
scope: inbox_validation
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index c490e19047b2..dc372ed866c7 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -9783,7 +9783,7 @@
}
},
"scout-config-delete": {
- "description": "Delete one scout config by its `id`, removing the per-scout schedule/emit row outright. Use it to clean up an orphaned config whose skill was archived or deleted — it lingers in `scout-config-list` with an empty description and never runs, but can't otherwise be removed. Deletion is activity-logged. Note: auto-registration only scans live `signals-scout-*` skills, so a config deleted for one of those is back on the coordinator's next tick. A scout under any other name does not come back on its own: its config stays deleted until you re-register it with `scout-config-create`, and its skill still reads as a scout meanwhile. To retire a live scout, archive its skill (or set `enabled=false` via `scout-config-update` to make it inert) rather than deleting the config.",
+ "description": "Delete one scout config by its `id`, removing the per-scout schedule/emit row outright. Use it to clean up an orphaned config whose skill was archived or deleted — it lingers in `scout-config-list` with an empty description and never runs, but can't otherwise be removed. Deletion is activity-logged. Note: auto-registration only scans live `signals-scout-*` skills, so a config deleted for one of those is back on the coordinator's next tick. A scout under any other name does not come back on its own: its config stays deleted until you re-register it with `scout-config-create`, and its skill still reads as a scout meanwhile. To retire a live scout, archive its skill (or set `enabled=false` via `scout-config-update` to make it inert) rather than deleting the config. A scout whose `scout_role` is `operational` cannot be deleted at all: it is part of the self-driving system rather than the project's own fleet.",
"category": "Signals",
"feature": "signals",
"summary": "Delete a scout config",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 5eaf94952eaa..09c1288552b8 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -10355,7 +10355,7 @@
}
},
"scout-config-delete": {
- "description": "Delete one scout config by its `id`, removing the per-scout schedule/emit row outright. Use it to clean up an orphaned config whose skill was archived or deleted — it lingers in `scout-config-list` with an empty description and never runs, but can't otherwise be removed. Deletion is activity-logged. Note: auto-registration only scans live `signals-scout-*` skills, so a config deleted for one of those is back on the coordinator's next tick. A scout under any other name does not come back on its own: its config stays deleted until you re-register it with `scout-config-create`, and its skill still reads as a scout meanwhile. To retire a live scout, archive its skill (or set `enabled=false` via `scout-config-update` to make it inert) rather than deleting the config.",
+ "description": "Delete one scout config by its `id`, removing the per-scout schedule/emit row outright. Use it to clean up an orphaned config whose skill was archived or deleted — it lingers in `scout-config-list` with an empty description and never runs, but can't otherwise be removed. Deletion is activity-logged. Note: auto-registration only scans live `signals-scout-*` skills, so a config deleted for one of those is back on the coordinator's next tick. A scout under any other name does not come back on its own: its config stays deleted until you re-register it with `scout-config-create`, and its skill still reads as a scout meanwhile. To retire a live scout, archive its skill (or set `enabled=false` via `scout-config-update` to make it inert) rather than deleting the config. A scout whose `scout_role` is `operational` cannot be deleted at all: it is part of the self-driving system rather than the project's own fleet.",
"category": "Signals",
"feature": "signals",
"summary": "Delete a scout config",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index fef0deed92ec..68d31c8acb12 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -79846,6 +79846,14 @@ export namespace Schemas {
Custom: 'custom',
} as const;
+ export type ScoutRoleEnum = typeof ScoutRoleEnum[keyof typeof ScoutRoleEnum];
+
+
+ export const ScoutRoleEnum = {
+ Specialist: 'specialist',
+ Operational: 'operational',
+ } as const;
+
/**
* * `active` - Active
* * `pending_pause` - Pending pause
@@ -79901,6 +79909,8 @@ export namespace Schemas {
display_name?: string;
/** Where this scout came from: `canonical` for a scout PostHog ships and maintains (seeded from `products/signals/skills/`), or `custom` for one a team hand-authored on this project. Use it to badge built-in vs custom scouts instead of a hardcoded name list. Defaults to `custom` if the skill is not currently present on the team. */
readonly scout_origin: ScoutOriginEnum;
+ /** What this scout is to the harness: `specialist` for one that watches a product surface, or `operational` for one PostHog ships to watch the self-driving system itself. An operational scout is exempt from the inactivity sweep and from the enabled-scout cap, and is not a scout a project should delete. Always `specialist` for a custom scout. */
+ readonly scout_role: ScoutRoleEnum;
/** Who answers for this scout, seed-creator first. Ownership is recorded on the scout's skill rather than on this config, so editing the skill or toggling the scout leaves it unchanged. Reports the scout files suggest these people as reviewers. Prefer this over `created_by`-style fields, which only say who last flipped a switch. Empty when nobody owns the scout, when the owners are no longer members with access to the project, or when the caller is a scout sandbox token: owners are member PII, and a scout reads them through the skill API instead. */
readonly owners: readonly UserBasic[];
/** Whether this scout runs on its schedule. Disabled scouts are skipped by the coordinator. Derived from `status`: true for `active` and `pending_pause`, false for the paused statuses. */
diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.ts
index ebb4d2792bd4..a34037330bf2 100644
--- a/services/mcp/src/generated/signals/api.ts
+++ b/services/mcp/src/generated/signals/api.ts
@@ -1179,7 +1179,7 @@ export const SignalsScoutConfigUpdateBody = () => zod
.describe('Editable display name, schedule, enablement, and emit posture for one scout config.')
/**
- * Delete one scout config by its `id`, removing the per-(team, skill) schedule/emit row outright. The point is cleaning up an orphaned config whose skill was archived or deleted — it lingers in `list` with an empty `description`, never runs (the coordinator skips it and the skill can't load), but can't otherwise be removed over the API. Deletion is activity-logged. Note: auto-registration only scans live `signals-scout-*` skills, so a config deleted for one of those is back on the coordinator's next tick. A scout under any other name does not come back on its own: its config stays deleted until you re-register it, and its skill still reads as a scout meanwhile. To retire a live scout, archive its skill (or set `enabled=false` to make it inert) rather than deleting the config.
+ * Delete one scout config by its `id`, removing the per-(team, skill) schedule/emit row outright. The point is cleaning up an orphaned config whose skill was archived or deleted — it lingers in `list` with an empty `description`, never runs (the coordinator skips it and the skill can't load), but can't otherwise be removed over the API. Deletion is activity-logged. Note: auto-registration only scans live `signals-scout-*` skills, so a config deleted for one of those is back on the coordinator's next tick. A scout under any other name does not come back on its own: its config stays deleted until you re-register it, and its skill still reads as a scout meanwhile. To retire a live scout, archive its skill (or set `enabled=false` to make it inert) rather than deleting the config. A scout whose `scout_role` is `operational` cannot be deleted: it is part of the self-driving system rather than the project's own fleet.
* @summary Delete a scout config
*/
export const SignalsScoutConfigDestroyParams = () => zod.object({