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.

fix(signals): verify exception activity before error-tracking close-out (#115865)

posthog[bot]7ced914d947f
diff --git a/products/signals/skills/signals-scout-error-tracking/SKILL.md b/products/signals/skills/signals-scout-error-tracking/SKILL.md
index 6cb689e2f06d..08063205a94e 100644
--- a/products/signals/skills/signals-scout-error-tracking/SKILL.md
+++ b/products/signals/skills/signals-scout-error-tracking/SKILL.md
@@ -41,12 +41,36 @@ If a history reader is unavailable or access is denied, stop using that reader f
A scheduled run can start with a `<precheck_result>` block. The block means that at least one `$exception` event arrived in the last 7 days, so error tracking is in use. When the block is present, skip the `not-in-use` check. The block holds no count, so the baseline close-out still applies.
-If `$exception` is absent from `top_events` or its `count` is at baseline (no fresh 24h activity, `recent_24h_count` ≪ `count / 7`), error tracking probably isn't where the signal is today. Cheap scratchpad entry + close out:
+`top_events` holds only the project's top-ranked events.
+A quiet but active `$exception` stream can fall outside that list, so absence from `top_events` does not prove that error tracking is inactive.
-- key: `not-in-use:error_tracking:team{team_id}` (if `$exception` is absent entirely) **or** `pattern:error_tracking:baseline-team{team_id}` (if it fires at a steady baseline with no fresh burst)
+If `$exception` is in `top_events` at baseline (no fresh 24h activity, `recent_24h_count` ≪ `count / 7`), error tracking probably isn't where the signal is today. Cheap scratchpad entry + close out empty:
+
+- key: `pattern:error_tracking:baseline-team{team_id}`
- content: `"$exception baseline ~{count}/day, no fresh 24h burst at {timestamp}"`
-Close out empty. Re-running with the same key idempotently refreshes the timestamp; the next run reads the entry cold and short-circuits.
+If `$exception` is absent from `top_events`, run one bounded activity check before you decide anything:
+
+```sql
+SELECT count() AS exceptions_7d,
+ countIf(timestamp >= now() - INTERVAL 1 DAY) AS exceptions_24h
+FROM events
+WHERE event = '$exception'
+ AND timestamp >= now() - INTERVAL 7 DAY
+ AND timestamp <= now() + INTERVAL 1 DAY
+```
+
+If `execute-sql` is unavailable or the query fails, use `query-error-tracking-issues-list` (`status=active`, sorted by `last_seen_at`) as the check. An active issue seen in the last 7 days is activity.
+
+| Check result | Action |
+| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Exceptions or active issues found | The stream is active. Use these counts in place of the missing profile row and continue the investigation. Do not write `not-in-use`. |
+| Zero exceptions and no active issue | Write key `not-in-use:error_tracking:team{team_id}`, content `"$exception absent, activity check found 0 in 7d at {timestamp}"`. Close out empty. |
+| No check could run | Activity is unknown. Do not write or refresh `not-in-use`. State the unavailable check in the close-out summary, and continue with any other available reader. |
+
+A `not-in-use:error_tracking:*` entry from an earlier run does not stop this run.
+Run the activity check again before you close out on it.
+If the check finds activity, remove the entry with `scout-scratchpad-forget` and continue.
## How a run works
@@ -158,6 +182,7 @@ Harness-level:
## When to stop
- `$exception` row in profile is at baseline → close out empty.
+- `$exception` absent from profile and this run's activity check finds zero → `not-in-use` entry, close out empty.
- A candidate matches a scratchpad entry with `noise:` / `addressed:` / `dedupe:` key prefix, or an existing inbox report → edit-or-skip with a one-line note.
- You've validated some hypotheses and filed reports for what's solid → close out, even if there's more you could look at. Fewer, better reports.