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): name the recovery and cap exceptions on edit_report (#95077)

posthog[bot]0204583cd6dc
diff --git a/products/signals/backend/scout_harness/prompt.py b/products/signals/backend/scout_harness/prompt.py
index cf336510287b..df2ab8539395 100644
--- a/products/signals/backend/scout_harness/prompt.py
+++ b/products/signals/backend/scout_harness/prompt.py
@@ -418,12 +418,27 @@ _REPORT_NOT_IDEMPOTENT_EMIT_ONLY = (
"actually succeeded the first time silently doubles the report." + _RETRY_TAIL
)
+# The two additive channels on an edit, stated once and shared by both edit-capable personas.
+# An emit-only prompt names neither, because the scout has no edit scope.
+_EDIT_EVIDENCE_VS_NOTE = (
+ "Use `append_evidence` for a new observation a reader can check: each item is a "
+ "`{description, source_id}` pair that lands in the report's evidence rail as a bound signal "
+ "attributed to you, so the report's signal count and weight grow with it. Use `append_note` for "
+ "commentary that reads the report rather than adding to what it rests on, such as the owning team "
+ "already knowing, or a deploy having fixed it. Both add rather than replace, and both work on a "
+ "report you didn't author, so send both in one call when an observation needs a reading alongside "
+ "it. Two cases carry numbers and still take the note channel. A recovery is one: signal count and "
+ "weight only grow, and both feed the inbox ranking, so evidence that an issue is over would rank "
+ "the report as stronger. A report already at its evidence cap is the other: the append is refused "
+ "there, and the note is what still lands."
+)
+
_AUTHORING_VS_EDITING_REPORT_BOTH = f"""# Authoring vs. editing: search the inbox first
`scout-emit-report` is NOT idempotent: calling it twice authors two reports, and there is no dedupe matcher on this channel. Duplicate reports are the main failure mode here, so the discipline is **search, then decide**:
{_REPORT_SEARCH_BULLET}
-- **Edit when it already exists *and is still live*.** If a report covers the issue, prefer `scout-edit-report`: use `append_evidence` for a new observation a reader can check, and use `append_note` for commentary. Rewrite `title`/`summary` only on a report you own. One living report beats three near-duplicates fragmenting the inbox. But `edit_report` can't change a report's status, so appending to a `resolved` / `suppressed` / `failed` report buries a real relapse under a closed item: when the match is no longer live, treat the relapse as genuinely new, author a fresh report, and repoint your `report:` pointer at it.
+- **Edit when it already exists *and is still live*.** If a report covers the issue, prefer `scout-edit-report`. {_EDIT_EVIDENCE_VS_NOTE} Rewrite `title`/`summary` only on a report you own. One living report beats three near-duplicates fragmenting the inbox. But `edit_report` can't change a report's status, so appending to a `resolved` / `suppressed` / `failed` report buries a real relapse under a closed item: when the match is no longer live, treat the relapse as genuinely new, author a fresh report, and repoint your `report:` pointer at it.
- **Author only when it's genuinely new.** A materially new issue, a known one with new evidence that changes the verdict, or a relapse whose prior report is no longer live. {_REPORT_NOT_IDEMPOTENT_BOTH}"""
_AUTHORING_REPORT_EMIT_ONLY = f"""# Authoring reports: search the inbox first
@@ -439,7 +454,7 @@ _EDITING_REPORT_EDIT_ONLY = f"""# Editing existing reports
This run updates reports that already exist; it can't author new ones. Find the report your evidence bears on, then keep it current:
- **Find it.** {_INBOX_SEARCH_RECIPE} Status matters twice over here: appending to a dismissed or closed report buries your evidence under an item nobody is watching. Reuse the `report:<domain>:<entity>` scratchpad entry from a prior run when you have one. {_DISMISSAL_CONTEXT}
-- **Append, or rewrite.** Use `append_evidence` for a new observation a reader can check. Use `append_note` for commentary. Both work on any report, even one you didn't author. Rewrite `title`/`summary` only on a report you own, and only when the framing is genuinely stale; lead the summary with the verdict (see *Writing the summary*).
+- **Append, or rewrite.** Prefer appending. {_EDIT_EVIDENCE_VS_NOTE} Rewrite `title`/`summary` only on a report you own, and only when the framing is genuinely stale; lead the summary with the verdict (see *Writing the summary*).
- **Route an unrouted report.** If a report surfaced assigned to no one, set `suggested_reviewers` to route it to an owner: each reviewer an object, `{{github_login}}` (a bare lowercase login, no `@`) or `{{user_uuid}}` (the server resolves it for you), never a bare string. If the owner isn't named in the report, call `scout-members-list` for this project's members, each carrying a resolved `github_login` (the org-scoped `org-member-get-github-login` / `org-members-list` tools aren't available in a scout run). This replaces the report's reviewer list and re-runs autostart, so a report that already has a repo and priority but lacked a qualifying reviewer can now open a draft PR. Only set a reviewer you're confident owns the area; an empty list is a no-op.
- **Don't retry blindly.** `edit_report` is NOT idempotent. A retried `append_note` adds a second note. A retried `append_evidence` adds duplicate signals and increases the report counters again. If unsure whether an edit landed, re-read the report rather than re-sending."""
diff --git a/products/signals/skills/authoring-scouts/references/dedupe-and-memory.md b/products/signals/skills/authoring-scouts/references/dedupe-and-memory.md
index 2bc4c3c10362..7cf059555d74 100644
--- a/products/signals/skills/authoring-scouts/references/dedupe-and-memory.md
+++ b/products/signals/skills/authoring-scouts/references/dedupe-and-memory.md
@@ -10,7 +10,7 @@ Every scout classifies each candidate finding against prior runs, the inbox, and
Bake this classifier into the scout's Decide section:
1. **Net new** — no prior run mentions the topic, no inbox report and no scratchpad entry covers it. → Author a report via `emit_report` if it clears the report bar (see [`report-contract.md`](report-contract.md)).
-2. **Material update on an existing live report** — a live report already covers the topic (one this scout authored last run, or a pipeline report), but there's new evidence (a different corroborating source, a fresh deploy correlation, contradicting data, a meaningful escalation in scope). → **`edit_report` it** — use `append_evidence` for the new observation, or rewrite `title`/`summary` on a report the scout authored.
+2. **Material update on an existing live report** — a live report already covers the topic (one this scout authored last run, or a pipeline report), but there's new evidence (a different corroborating source, a fresh deploy correlation, contradicting data, a meaningful escalation in scope). → **`edit_report` it** — use `append_evidence` for the new observation, `append_note` for a reading of it, or rewrite `title`/`summary` on a report the scout authored.
Don't mint a near-duplicate.
**Live reports only:** `edit_report` never changes a report's status, so if the prior report is suppressed or resolved and the issue is genuinely back, author a **fresh** report (citing the prior `report_id` in the summary) rather than editing a closed one nobody will see.
3. **Same fact already covered** — an existing report already captures the same evidence shape, nothing has changed. → Skip.
diff --git a/products/signals/skills/authoring-scouts/references/report-contract.md b/products/signals/skills/authoring-scouts/references/report-contract.md
index a60843d751c1..6d60b59dfcd8 100644
--- a/products/signals/skills/authoring-scouts/references/report-contract.md
+++ b/products/signals/skills/authoring-scouts/references/report-contract.md
@@ -231,7 +231,7 @@ The fleet's reviewer map should compound over time.
## `edit_report` — update an existing report
-Rewrite `title`/`summary`, append a note, set `suggested_reviewers`, and/or replace `charts` / `suggested_prompts` on a report that already exists.
+Rewrite `title`/`summary`, append evidence or a note, set `suggested_reviewers`, and/or replace `charts` / `suggested_prompts` on a report that already exists.
Pass `run_id` (the current run) and `report_id`, plus at least one of `title`, `summary`, `append_note`, `append_evidence`, `suggested_reviewers`, `charts`, `suggested_prompts`.
An edit that supplies content (`title`, `summary`, `charts`, `suggested_prompts`, `append_note`, `append_evidence`, or a reviewer `reason`) passes the same safety judge as `emit_report`; an unsafe edit is rejected whole and the report keeps what it had.
@@ -240,7 +240,11 @@ That makes it the right tool when a later run learns something about a report th
Rules of good behavior:
- Use **`append_evidence`** for a new observation that a reader can check.
-- Use **`append_note`** for commentary.
+ It takes the same `{description, source_id}` items as `emit_report`, and each one lands in the report's evidence rail as a bound signal, so the report's `signal_count` and `total_weight` grow with it.
+- Use **`append_note`** for commentary — a reading of the report that adds nothing to check, such as the owning team already knowing, or a deploy having fixed it.
+ Send both in one call when an observation needs a reading alongside it.
+- **A recovery is a note, not evidence.** `signal_count` and `total_weight` only grow, and both feed the inbox ranking, so evidence that an issue is over would rank the report as stronger.
+- **At the cap, the note is the channel that still lands.** Emit plus every append share the report's **50** evidence rows, and the grouping pipeline can raise the count too, so a long-lived report can fill up. An append past the cap is rejected and the report keeps what it had.
- Prefer these additive fields over rewriting `title`/`summary` on a report you didn't author.
A note is additive and audit-friendly (it carries your scout as the author); a rewrite silently overwrites a human- or pipeline-authored headline.
- **Don't fight an in-flight pipeline.** A report the summary/research workflow is mid-run on can have its fields overwritten under you.
diff --git a/products/signals/skills/authoring-scouts/references/scout-patterns.md b/products/signals/skills/authoring-scouts/references/scout-patterns.md
index fdfba4b7f1d5..4307179eea31 100644
--- a/products/signals/skills/authoring-scouts/references/scout-patterns.md
+++ b/products/signals/skills/authoring-scouts/references/scout-patterns.md
@@ -391,7 +391,7 @@ So the trigger for this pattern is any of: **a judgment with more than one axis*
Persist a **state transition** (an item that changed axis since last run) or a capped set of near-misses, and roll the rest into one aggregate backlog entry.
- **Close the loop on what you filed — and know what closing it can and cannot do.** A "ready to pick up" report is wrong the moment someone picks it up, and it costs a person duplicating work already underway.
Re-check each `report:` entry every run and `edit_report` once the item is assigned, PR-linked, or closed — but note that `edit_report` mutates `title`, `summary`, `append_note`, `append_evidence`, `suggested_reviewers`, `charts`, and `suggested_prompts` **only**.
- It cannot change status or actionability, so an appended note does not retire the report.
+ It cannot change status or actionability, so an appended note or evidence row does not retire the report.
Rewrite the **title and summary** so the stale framing is gone from the surface a human scans, and leave the status change to a person.
- **Routing the outcome is part of the design.** On the report channel a queue scout can hand work straight to a draft PR: `actionability: immediately_actionable` + `repository` + a `priority` makes the report **eligible** to autostart one.
Eligible is not automatic — the team's autostart toggle, its priority threshold, the org's self-driving quota, and resolving a runner identity each gate it independently, so a correctly-filed report can sit still for reasons that have nothing to do with the scout.
diff --git a/products/signals/skills/signals-scout-anomaly-detection/references/report-contract.md b/products/signals/skills/signals-scout-anomaly-detection/references/report-contract.md
index 6517cf6d6c52..c8840267c12a 100644
--- a/products/signals/skills/signals-scout-anomaly-detection/references/report-contract.md
+++ b/products/signals/skills/signals-scout-anomaly-detection/references/report-contract.md
@@ -139,15 +139,19 @@ A recurrence or escalation of an insight's anomaly you already reported is an **
report**. Find the live report (the `report:` pointer's `report_id` → `inbox-reports-retrieve`,
or `inbox-reports-list` by the insight), then:
-- **`append_evidence`** with the new observation — additive, audit-friendly, and the right move on any
- report (even a pipeline-authored one). Build a **fresh notebook** for the new window and link
- it in the note (one notebook per window — never append a new anomaly to a prior notebook).
+- **`append_evidence`** with the new window's numbers — additive, audit-friendly, and the right move on
+ any report (even a pipeline-authored one). Each item lands in the report's evidence rail as a bound
+ signal, so the report's signal count and weight grow with the recurrence. Build a **fresh notebook**
+ for the new window and link it in the description (one notebook per window — never append a new
+ anomaly to a prior notebook).
+- **`append_note`** for commentary the numbers don't carry — the owning team already knows, or a deploy
+ explains the move. Send it in the same call as the evidence when both apply.
- **Rewrite `title`/`summary`** only on a report you authored, and only when the framing is
genuinely stale.
`edit_report` is preflight-gated like `emit_report`, but it **raises** when the scout is gated
(dry-run `emit=false`, un-approved AI processing, or a disabled source) rather than returning a
-`skipped_reason` — the note is never appended. So if you built a fresh recurrence notebook and
+`skipped_reason` — nothing is appended. So if you built a fresh recurrence notebook and
the `edit_report` call is blocked (or otherwise doesn't commit), **delete that notebook with
`notebooks-destroy`** — same orphan-cleanup rule as a non-surfacing author. Equivalently, defer
building the notebook until the edit is about to commit.
diff --git a/products/signals/skills/signals-scout-feature-flags/SKILL.md b/products/signals/skills/signals-scout-feature-flags/SKILL.md
index 02908e59c3f7..42f8570f075d 100644
--- a/products/signals/skills/signals-scout-feature-flags/SKILL.md
+++ b/products/signals/skills/signals-scout-feature-flags/SKILL.md
@@ -194,7 +194,7 @@ By run #5 you should know the project's high-volume flags, their baselines and r
For a candidate that clears the bar, the call is **edit an existing report, author a new one, remember, or skip** — use judgment, these are the rails:
- **Search the inbox first.** The `report:feature-flags:<key>` scratchpad pointer is the reliable path (it holds the `report_id` — `inbox-reports-retrieve` it directly); with no pointer, `inbox-reports-list` by the specific flag key (`ordering=-updated_at`), not a broad word like `flag`.
-- **Edit** (`scout-edit-report`) when a still-live report already covers the flag **and the situation materially changed** — the issue recovered, the flag was reconfigured or its rollout changed, the scope or severity shifted (a cliff deepened, a ghost's reach jumped, a distribution shift widened), intent was confirmed, or a defined refresh cadence (e.g. daily) has elapsed. Add the fresh numbers with `append_evidence`, or rewrite the title/summary on a report you authored. **Don't edit just because the issue persists unchanged** — a cliff still down at the same level, a ghost still hot at the same volume, a debt bundle that only grew slightly is monitoring, not news. Re-appending the same measurement every three-hour run grows the audit trail without moving the decision forward; keep tracking it in `pattern:` memory and leave the report untouched, so its history records changes rather than ticks. `edit-report` can't change status, so if the matched report is `resolved` / `suppressed` / `failed`, don't append (it won't resurface) — author a fresh report for the relapse and repoint the `report:` key.
+- **Edit** (`scout-edit-report`) when a still-live report already covers the flag **and the situation materially changed** — the issue recovered, the flag was reconfigured or its rollout changed, the scope or severity shifted (a cliff deepened, a ghost's reach jumped, a distribution shift widened), intent was confirmed, or a defined refresh cadence (e.g. daily) has elapsed. Add the fresh numbers with `append_evidence` when the problem deepened or widened. Add a recovery or a confirmed intent with `append_note`, because the evidence counters only grow and would rank a recovered report as stronger. Rewrite the title/summary on a report you authored. **Don't edit just because the issue persists unchanged** — a cliff still down at the same level, a ghost still hot at the same volume, a debt bundle that only grew slightly is monitoring, not news. Re-appending the same measurement every three-hour run grows the audit trail without moving the decision forward; keep tracking it in `pattern:` memory and leave the report untouched, so its history records changes rather than ticks. `edit-report` can't change status, so if the matched report is `resolved` / `suppressed` / `failed`, don't append (it won't resurface) — author a fresh report for the relapse and repoint the `report:` key.
- **Author** (`scout-emit-report`) only when nothing live covers it. A good report names the flag key and id, quantifies the contradiction (baseline vs current calls, response mix before/after, ghost volume and reach), passes the volume gates, and dates the onset. Attach the flag's `$feature_flag_called` series via `charts` — the cliff or response-mix shift, dated — so the contradiction with the configured state is visible; prefer a trends node (it zero-fills empty days), since a SQL series without a date spine ends at the cliff instead of drawing the drop to zero. Set `priority` (P0–P4) + `priority_explanation` — it's the report's importance in the inbox, your call to make. Set `suggested_reviewers` via `scout-members-list` (objects — a `{github_login}` or `{user_uuid}`, not bare strings; cache under `reviewer:feature-flags:<key>`); left empty the report reaches no one. Then choose the actionability + repo together:
- Most flag findings are an investigation a human confirms, not a one-line change → `actionability=requires_human_input` and `repository=NO_REPO` (NO_REPO is what stops `priority`+reviewers from spawning a pointless repo-selection sandbox).
- When the fix is an obvious code change (e.g. a ghost flag whose dead check just needs removing) → `actionability=immediately_actionable` with `repository="owner/repo"` (or omit `repository` to let the selector pick) to open a draft PR.
diff --git a/products/signals/skills/signals-scout-general/references/conventions.md b/products/signals/skills/signals-scout-general/references/conventions.md
index 9cfdbaad730f..b586d8c81474 100644
--- a/products/signals/skills/signals-scout-general/references/conventions.md
+++ b/products/signals/skills/signals-scout-general/references/conventions.md
@@ -15,8 +15,8 @@ before you author a report (the harness prompt carries the report-channel contra
(one you authored last run, or a pipeline report), but you have new evidence: a
different source corroborating, a fresh deploy correlation, contradicting data, a
meaningful escalation in scope. → **`edit-report` it** — `append_evidence` with the
- fresh evidence, or rewrite `title`/`summary` on a report you authored. Don't mint
- a near-duplicate.
+ fresh observation, `append_note` with a reading of it, or rewrite `title`/`summary`
+ on a report you authored. Don't mint a near-duplicate.
3. **Same fact already covered** — an existing report already captures the same
evidence shape, nothing has changed. → Skip. Optionally rewrite an existing
diff --git a/products/signals/skills/signals-scout-web-analytics/SKILL.md b/products/signals/skills/signals-scout-web-analytics/SKILL.md
index e651549e3aae..16a3b3ebda2b 100644
--- a/products/signals/skills/signals-scout-web-analytics/SKILL.md
+++ b/products/signals/skills/signals-scout-web-analytics/SKILL.md
@@ -252,7 +252,7 @@ By run #5 you should know the weekday rhythm, the per-channel baselines, the sen
For each candidate, the call is **edit an existing report, author a new one, remember, or skip** — use judgment, these are the rails:
- **Search the inbox first.** The `report:web-analytics:<segment-slug>` scratchpad pointer is the reliable path (it holds the `report_id` — `inbox-reports-retrieve` it directly); with no pointer, `inbox-reports-list` by the segment's specific terms (the channel name, path, referrer domain, or campaign — `ordering=-updated_at`), never a broad word like `traffic`. A segment with a live report and no material change is a **skip**.
-- **Edit** (`scout-edit-report`) when a still-live report already covers the same segment problem — the channel still diverging, the tagged share still depressed, the 404 spike still running. Add the fresh window's numbers with `append_evidence` (the 24h value against both aligned windows, deepening or recovering), or rewrite the title/summary on a report you authored. This is the default when a match exists — a divergence persisting across runs is one report across weeks, not one per run. `edit-report` can't change status, so if the matched report is `resolved` / `suppressed` / `failed`, don't append (it won't resurface) — author a fresh report for the relapse and repoint the `report:` key.
+- **Edit** (`scout-edit-report`) when a still-live report already covers the same segment problem — the channel still diverging, the tagged share still depressed, the 404 spike still running. Add the fresh window's numbers with `append_evidence` (the 24h value against both aligned windows) while the divergence deepens or holds. Add a recovery with `append_note`, because the evidence counters only grow. Rewrite the title/summary on a report you authored. This is the default when a match exists — a divergence persisting across runs is one report across weeks, not one per run. `edit-report` can't change status, so if the matched report is `resolved` / `suppressed` / `failed`, don't append (it won't resurface) — author a fresh report for the relapse and repoint the `report:` key.
- **Author** (`scout-emit-report`) only when nothing live covers it — one report per segment divergence, never one per query row. A **report-worthy finding** (confidence ≥ 0.8): names the segment (channel, path, referrer, campaign), quantifies the step against both aligned windows, shows the aggregate held (that's what makes it yours), dates the onset, and names the moving part inside the segment — with the numbers in the `evidence`. Below that bar, write memory instead. The divergence-on-steady-aggregate shape is the argument, so show it — attach the segment's daily series (with the aggregate alongside) via `charts`. The fix for a web-analytics finding almost always lives in the team's site, campaign tooling, or marketing stack — territory you can't open a PR against — so default to `actionability=requires_human_input` and `repository=NO_REPO` (NO_REPO is what stops `priority`+reviewers from spawning a pointless repo-selection sandbox).
Because you default to a human handoff, the handoff must be explicit in the summary: who acts (the site, marketing, or campaign owner — name the surface), the exact change or check to make, and a success criterion — the metric, the target value or return-to-baseline level, and the re-measure window.
A report that says "review the page" without those three is below the bar; hold it back and gather the missing piece instead.
diff --git a/products/signals/skills/signals-scout-web-vitals/SKILL.md b/products/signals/skills/signals-scout-web-vitals/SKILL.md
index e8f2fb14e826..9899470376cf 100644
--- a/products/signals/skills/signals-scout-web-vitals/SKILL.md
+++ b/products/signals/skills/signals-scout-web-vitals/SKILL.md
@@ -431,7 +431,9 @@ For each candidate, the call is **edit an existing report, author a new one, rem
- **Edit** (`scout-edit-report`) when a still-live report already covers the same
page+metric problem — the page still standing in `poor`, the regression still holding,
the p75 deepening or recovering. Add the fresh window's numbers with `append_evidence` (p75, band,
- sample count), or rewrite the title/summary on a report you authored. This is the
+ sample count) while the page stays slow. Add a recovery with `append_note`, because the evidence
+ counters only grow and would rank a recovered report as stronger. Rewrite the title/summary on a
+ report you authored. This is the
default when a match exists — a chronically slow page is one report across weeks, not
one per run. `edit-report` can't change status, so if the matched report is `resolved` /
`suppressed` / `failed`, don't append (it won't resurface) — and a `ready` report whose