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.

chore(signals): fix anomaly-scout skill doc inconsistencies from review (#62041)

Andrew Maguired7094a079e54
diff --git a/products/signals/skills/signals-scout-anomaly-detection/SKILL.md b/products/signals/skills/signals-scout-anomaly-detection/SKILL.md
index 039081a40f6e..b496790244b7 100644
--- a/products/signals/skills/signals-scout-anomaly-detection/SKILL.md
+++ b/products/signals/skills/signals-scout-anomaly-detection/SKILL.md
@@ -84,8 +84,10 @@ For each, pull the latest complete bucket and score it against its stored baseli
the baseline as you go). Fetch fresh data with:
- `insight-query` (`insightId`, `output_format=json`) — runs one saved insight. **It returns the insight's own date range (often just `-7d`) — too short to baseline, so always widen it with `filters_override` (e.g. `{"date_from": "-63d"}`) or fall back to `execute-sql`.**
-- `dashboard-insights-run` (`id`, `refresh=blocking`, `filters_override`) — runs every tile
- on a dashboard at once; efficient for sweeping a whole high-value dashboard.
+- `dashboard-insights-run` (`id`, `output_format=json`, `refresh=blocking`, `filters_override`)
+ — runs every tile on a dashboard at once; efficient for sweeping a whole high-value
+ dashboard. Pass `output_format=json` — the default `optimized` returns prose summaries, not
+ the raw bucket series the z-score needs.
- `execute-sql` — when you need a clean hourly/daily series with a long trailing baseline in
one query (the most reliable path for the z-score; recipes in `anomaly-methods.md`). Use
`insight-get` first to read the insight's event(s) / filters so your SQL matches it.
diff --git a/products/signals/skills/signals-scout-anomaly-detection/references/anomaly-methods.md b/products/signals/skills/signals-scout-anomaly-detection/references/anomaly-methods.md
index cbd91dc14d87..78bf20eb01ea 100644
--- a/products/signals/skills/signals-scout-anomaly-detection/references/anomaly-methods.md
+++ b/products/signals/skills/signals-scout-anomaly-detection/references/anomaly-methods.md
@@ -117,7 +117,7 @@ Then in your reasoning: take the most recent `day` as `x`, filter the rest to th
compute median + MAD over those, and score. (Compute the robust stats in your head / from the
rows — keep the SQL simple and do the small stats on the returned series.)
-**Hourly series for a high-volume metric** (last 21 days, hourly, for hour-of-week baseline):
+**Hourly series for a high-volume metric** (last 21 days, hourly, for same-hour-of-day baseline):
```sql
SELECT toStartOfHour(timestamp) AS hour,
@@ -132,7 +132,12 @@ GROUP BY hour, dow, hod
ORDER BY hour DESC
```
-Score the latest complete `hour` against prior rows sharing its `(dow, hod)`.
+Score the latest complete `hour` against prior rows sharing its `hod` (same-hour-of-day) —
+~14–28 comparable points over 21 days, so the ≥ 12 baseline floor is reachable. To upgrade to
+a full hour-of-week baseline (rows sharing both `dow` and `hod`), **first widen the `WHERE
+timestamp >= ...` window to ~8+ weeks** — at 21 days `(dow, hod)` yields only ~3 points per
+bucket, far below the floor. (`dow` is already selected above, so only the window needs to
+change.)
**Tips**
diff --git a/products/signals/skills/signals-scout-anomaly-detection/references/emit-contract.md b/products/signals/skills/signals-scout-anomaly-detection/references/emit-contract.md
index ecaaa1238fe5..2aee4c536753 100644
--- a/products/signals/skills/signals-scout-anomaly-detection/references/emit-contract.md
+++ b/products/signals/skills/signals-scout-anomaly-detection/references/emit-contract.md
@@ -65,15 +65,20 @@ the baseline median, the z-score, and the time window in the summaries.
## Dedupe keys
-Stable strings the inbox groups on. Use `insight:<short_id>` and a metric-anomaly key like
-`metric_anomaly:<short_id>:<date>` so a recurrence on a later day is a new finding that cites
-the prior one rather than silently colliding. Add `dashboard:<id>` when relevant. Include 1–2.
+Stable strings stored on the signal for traceability and grouping context — they are recorded
+in the signal's `extra`, **not** enforced as idempotency keys by `emit_signal` (grouping is
+semantic). Your own dedupe is the scratchpad / run-history check before emitting. Use
+`insight:<short_id>` and a metric-anomaly key like `metric_anomaly:<short_id>:<date>` so a
+recurrence on a later day reads as a new finding citing the prior one. Add `dashboard:<id>`
+when relevant. Include 1–2.
## finding_id (not a dedupe key)
A stable, human-readable trace id tying the signal to its run — e.g.
-`anomaly-revenue-over-time-ym0K91uz-2026-06-07`. It is **not** used for idempotency:
-`emit_signal` dedupes on its own `document_id` and your `dedupe_keys`, never on `finding_id`.
+`anomaly-revenue-over-time-ym0K91uz-2026-06-07`. It is **not** used for idempotency: the
+pipeline assigns every signal a fresh random `document_id` and dedupes on that, never on
+`finding_id` — and never on your `dedupe_keys` either (those are stored in `extra` for the
+inbox to group on _after_ ingest, they don't make a repeat emit idempotent).
**Re-calling emit with the same `finding_id` writes a second signal — never retry an emit that
may already have succeeded.** A recurrence on a later day is a new finding citing the prior id.