: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(signals): document report checks, lighthouse audit and the feature-forward rule (#103888)
posthog[bot]58155968314b
diff --git a/products/signals/skills/authoring-scouts/SKILL.md b/products/signals/skills/authoring-scouts/SKILL.mdindex a809ea3f0022..a2b53b869ecc 100644--- a/products/signals/skills/authoring-scouts/SKILL.md+++ b/products/signals/skills/authoring-scouts/SKILL.md@@ -1,16 +1,13 @@---name: authoring-scoutsdescription: >- How to author, edit, and adapt PostHog Signals scouts — the scheduled agents that- scan a project and file what they find. Use to customize a- canonical scout (narrow its scope, retune thresholds, add disqualifiers), tweak a- scout's schedule or dry-run posture, write a new scout for a surface the fleet- doesn't cover, build a measurement scout that records structured output (an- LLM-judge scoring a sample on a schedule — a custom metric no query can compute),- or steer a scout without editing it by leaving it a note. Covers the scout SKILL.md- anatomy, the report contract, the structured-output channel, the dedupe +- scratchpad-memory conventions, scout notes, the per-team skills-store path vs the- canonical in-repo path, and the test loop. Trigger on+ Write, edit, and adapt PostHog Signals scouts: scheduled agents that scan a project+ and report findings. Use to change a canonical scout's scope, thresholds, schedule,+ or dry-run settings; add a scout for an uncovered surface; record structured output+ from scheduled LLM scoring; or give feedback through notes. Covers SKILL.md structure,+ report requirements, follow-up report checks, structured output, duplicate detection,+ scratchpad memory, scout notes, per-team skills-store and canonical repository edits,+ and testing. Trigger on"write/edit/customize a signals scout", "new scout for X", "tune my scout schedule","make a scout that watches <event>", "score/judge/measure X with a scout","structured output from a scout", "scout output to Slack",@@ -88,12 +85,31 @@ Find the closest pattern, then write the body.Follow [`references/scout-anatomy.md`](references/scout-anatomy.md) — it has the frontmatter schema (including the `allowed_tools` report-channel opt-in every scout needs), the canonical body structure (quick close-out → orient → domain discriminator → explore patterns → save-memory → decide → disqualifiers → close-out), the lean-body rule, and copy-ready skeleton templates for both a specialist and the generalist.+**Write the body feature-forward.** The body is a prompt a run reads in full, every run, for as long as the scout lives — so it states what the scout watches and how it decides, and nothing else. Four things do not belong in it:++- **No rollout state.** A preview flag, an early-access gate, a "recently renamed" tool, a port that is happening one scout at a time. It is true this month and misleading next month, and a run cannot tell which. Write the behavior the scout should follow now; if a capability may be absent, say how the run tells, not when it is due.+- **No backlog.** Work that is planned, a field that does not exist yet, a lane somebody means to add. A run cannot act on it, so it only spends tokens and invites the run to wait for something.+- **No project-only facts.** A metric, dashboard, event, id, or reviewer that exists in one project. A canonical scout ships to every project, so a fact from one of them is wrong for almost every run. Text about an optional product says how the run tells whether the project uses it, and never assumes it does.+- **No duplicated harness mechanics.** The report-channel contract, the run gates, and the close-out format come from the harness prompt, which every report-channel scout is given. A copy in the body drifts from the real one and the run then holds two versions of the same rule. Keep the body to your scout's own domain framing.++The same four apply to a bundled reference: it is read at run time too, so it carries no more rollout state or backlog than the body.+Two craft references the whole fleet reasons in terms of — a good scout's **Decide** and **memory** sections are built on them, so read them before writing those sections:- [`references/report-contract.md`](references/report-contract.md) — the report tools (`scout-emit-report` / `scout-edit-report`), the report bar (author 1:1 only for a finding you'd own end-to-end), `suggested_reviewers` routing, the dedup-via-`report_id` discipline (the channel isn't idempotent — reconcile against existing reports via the vanilla `inbox-reports-list` / `inbox-reports-retrieve` before authoring), and the accepted caveat that the pipeline may later rewrite an authored title/summary.This is how your scout decides _what clears the bar_ and _how to file it_.- [`references/dedupe-and-memory.md`](references/dedupe-and-memory.md) — the four-states classifier (net-new / material-update / already-covered / addressed-or-noise), the scratchpad key-prefix vocabulary, and the cross-project noise patterns.This is how your scout avoids re-filing and learns across runs.+- [`references/report-checks.md`](references/report-checks.md) — the follow-up checks a scout attaches to a report so "did the fix hold?" is measured later instead of remembered.+ This is how your scout closes the loop on a finding after somebody acts on it.++A report is backward-looking; a **check** is the opposite direction — an expectation plus a time to test it, written onto a report with `scout-report-check-create`.+Give your scout a checks section when its findings are the kind whose fix shows up in data later.+Three rules belong in the body, and the reference has the rest:++- **List the report's existing checks first** (`scout-report-check-list`), every time. An open check for the same claim makes a second one noise, and a report holds at most five open checks.+- **`metric_threshold` wherever one number settles the claim and an event or action series can carry it.** The coordinator measures it itself, with no scout run.+- **`agent` when no single number settles it, or when the number lives outside events** — a log rate, a fix whose effect shows in which entities fire rather than how many, a claim that needs a stack trace read.The single most important design decision in any scout is its **signal-vs-noise discriminator** — the cheap profile-shape read that separates "worth investigating" from "baseline".For error tracking it's the `count` vs `distinct_users` ratio; for CSP it's reach over raw count.@@ -216,6 +232,12 @@ Confirm the watched event/entity exists and has the shape you assumed, run the *This loop is free and instant — refine the body against what you find, re-run the queries, repeat, until the scout's logic holds up on real data.This is where the real iteration happens.+**A few runtime tools cannot be dogfooded, so validate them in the first real run instead.** Anything that takes a `run_id` only works from inside a run, and a tool the project has not been switched on for fails whoever calls it.+`posthog:scout-lighthouse-audit` is the one to plan around: it loads a page in a real throttled browser and returns the lab metrics, the element the browser chose as the Largest Contentful Paint, where the LCP time went phase by phase, and the ranked savings estimates — which is how a page-performance finding names a cause rather than guessing one.+It needs the run's `run_id`, it is restricted to an allowlist of public pages (the browser signs in to nothing, so a page behind a login would report the login screen's numbers as the page's), it is limited to the projects switched on for it, and it is capped at five audits per run. A rejected call costs nothing, but once the page loads the slot is spent whatever the result, and every error message ends with how many audits the run has left, which tells a rejection apart from an exhausted budget.+So: treat it as available only once a run's own call succeeds, never write a body whose finding depends on it, and keep lab and field evidence labelled apart — one throttled cold load explains a finding, and the field percentile over real users is what establishes there is one.+Then check the first real run's transcript for the call and what it returned, the same way you would check a query you could not run by hand.+Only once you're happy with the body do you spend an actual run.`posthog:scout-run-now {"id": <config_id>}` dispatches one run of the scout immediately, regardless of its schedule (find the `id` via `-config-list`).This is the **initial real run** — the scout executing end-to-end in the harness, writing scratchpad memory and (with the default `emit=true`) writing reports to the inbox.@@ -264,6 +286,8 @@ Keep the two in sync when the scout config / run / scratchpad surfaces change.- 2–4 concrete **explore patterns** with the actual queries/tools to run — starting points, not a rigid checklist.- **Disqualifiers** listing this project's known noise (single-user quirks, dev-env bursts, allowlisted entities).- A **Decide** section calibrated against the report contract — author 1:1 only for a finding the scout would own end-to-end, set `suggested_reviewers`, and write memory instead when a candidate is below the bar.+- A **checks** step where the findings are the kind whose fix shows up in data later — list the report's open checks first, then pick `metric_threshold` or `agent` by whether one number settles the claim.+- A **feature-forward body**: no rollout state, no backlog, no project-only facts, no harness mechanics the prompt already carries.- **Save-memory** guidance using the scratchpad prefixes so the scout gets smarter each run.- A lean body (push depth into `references/`) — every line is a recurring token cost on every run.- A **tight frontmatter `description`** — a sentence or two naming the surface and the shapes it watches.diff --git a/products/signals/skills/authoring-scouts/references/report-checks.md b/products/signals/skills/authoring-scouts/references/report-checks.mdnew file mode 100644index 000000000000..ec1226bc3335--- /dev/null+++ b/products/signals/skills/authoring-scouts/references/report-checks.md@@ -0,0 +1,97 @@+# Report checks++A report says what was true when it was written.+A **check** says what must stay true afterwards, and names a time to test it.+The coordinator runs the due checks and appends each verdict to the report as a `check_result` artefact, so "did the fix hold?" becomes a stored fact instead of something a person has to remember to re-derive.++Checks are written by scout runs and by the report pipeline's research stage.+There is no create surface for a person or a task token: the `inbox-report-checks-*` tools read checks and never write them.++## Look for a duplicate first++Always list the report's checks before you write one:++- Inside a run: `posthog:scout-report-check-list {"run_id": "<your run>", "report_id": "<report>"}`.+- Outside a run: `posthog:inbox-report-checks-list` (read-only, `task:read`).++Two reasons this is a hard step, not a courtesy:++- A report already carrying an **open** check (`pending` or `active`) for the same claim needs no second one. A duplicate measures the same thing twice and puts two verdicts on one report.+- A report holds at most **five open checks**. A duplicate spends one of them.++A resolved report often arrives already covered, because the research stage attaches checks of its own while it authors the report.++## The two kinds++### `metric_threshold`++One bounded query, one comparison, no sandbox and no LLM.+The coordinator measures it in the same tick that collects it, so no scout run is spent.++Config fields:++- `metric_id` — a metric already on the report, when one measures the right thing. Its query is copied onto the check when the check is created.+- `query` — your own bounded Trends query, when no metric on the report fits. Keep `date_from` relative (`-24h`, `-13d`) and leave `date_to` empty, so each run measures the window before itself rather than the window before the check was written; absolute dates are refused. The query must produce exactly one output series — one event or action series, or up to ten combined with exactly one formula — with no breakdown and no compare mode.+- `comparison` — `lte`, `gte`, or `between`, with the `value` (or `bounds`) the measurement must satisfy to pass.+- `baseline_value` — what you measured when you wrote the check, stored for the reader.++Send exactly one of `metric_id` and `query`.++Use this kind **wherever one number settles the claim and an event or action series can carry it**, which covers most volume and error-rate reports.+Two traps:++- **The comparison is the level a reader accepts as "the problem stopped"**, not the baseline itself. A `lte` at the baseline passes on no improvement at all.+- **A `lte` comparison passes on a measurement of zero**, and nothing in this lane notices that the surface simply went quiet. Where zero could equally mean the traffic stopped, make it an `agent` check and name the denominator to read first.++The check aggregates its whole window into one number at run time, so a window longer than the soak mixes pre-fix traffic into the result and can fail a fix that held.+Keep `date_from` equal to the soak.++### `agent`++For a claim no single number settles, or a number that lives outside events — a log rate, a fix whose effect shows in _which_ entities fire rather than how many, a claim that needs a stack trace read.++Config fields:++- `instructions` — what a later run must establish, in your own words. Carry the baseline you measured here: this kind has no `baseline_value` field.+- `probe_hints` — up to five concrete places to look: an issue id, a service name, the query to repeat.+- `skill_name` — the scout that answers the check. Leave it unset and the check goes to the fleet's follow-up scout.++The check is dispatched as a scout run, which closes it with `scout-check-record-result` (`passed`, `failed`, or `errored`, plus an explanation).+A run that ends without recording a result is scored `errored` and retried.++The text in `instructions` and `probe_hints` reaches the run as evidence, not as instructions it obeys.++## Scheduling++- `next_run_at` — when to look first. Allow deploy and soak time. The API refuses a timestamp that is not in the future, so send a near-future time when the window you reasoned about has already passed. Do not drop the field to avoid the arithmetic: an omitted `next_run_at` defaults to seven days out, which is usually long past the soak you wanted.+- `run_interval_minutes` — leave it unset. One look after the soak is the shape of a check. A level worth re-measuring several times a day is an alert, and the alerts product has the notification and deduplication machinery for it. The floor is six hours, a check runs at most ten times, and its horizon is 90 days.+- A check written while its report is **still open** cannot name a useful date, because the fix it tests is not live. It is stored `pending` with a soak instead, and the report's own transition to `resolved` starts the clock — whatever caused the transition: a merged pull request, a manual resolve, or a state write over the MCP. The soak defaults to 24 hours.++## Statuses and what each verdict does++`pending` and `active` are the open states.+`passed`, `failed`, `errored`, `expired`, and `cancelled` are terminal: a terminal check never reschedules, so a claim still worth watching needs a new check.++- **`passed`** re-arms only a recurring check that has runs left. Otherwise the check is done.+- **`failed`** always retires the check.+- **`errored`** retries. Three consecutive errored runs retire the check as misconfigured.+- **`cancelled`** comes from `scout-report-check-cancel`, for a check no longer worth running. Verdicts already recorded stay on the report, and a finished check cannot be cancelled.++A **failed `metric_threshold` check on a resolved report re-surfaces**: the breach is emitted as a signal and the pipeline files a fresh report linked back to the resolved one.+A resolved report is no longer in the inbox, so a verdict left only on its artefact log would reach nobody, and this lane has no scout in it to author anything.+An `agent` check needs no such path, because the run that answers it can file a report itself.++## Reading a report's checks++`inbox-report-checks-list` returns every check on a report, newest first, with `status`, `last_outcome`, `next_run_at`, `run_interval_minutes`, `runs_remaining`, and `expires_at`.+`inbox-report-checks-retrieve` returns one check with its full config.+`query` and `baseline_value` read as null for a caller who cannot read the data they describe.++The verdicts themselves are not on the check row.+They are `check_result` artefacts on the report, so read them through the report's artefact list.++## When to attach nothing++A report can be plainly non-measurable: a documentation change, a process recommendation, a one-off data correction.+Attach no check, and record why in scratchpad memory instead.+Honest unverifiability is worth more than a threshold nobody believes.diff --git a/products/signals/skills/exploring-scouts/SKILL.md b/products/signals/skills/exploring-scouts/SKILL.mdindex 663d7422e4cc..f296ee6d2570 100644--- a/products/signals/skills/exploring-scouts/SKILL.md+++ b/products/signals/skills/exploring-scouts/SKILL.md@@ -6,7 +6,8 @@ description: >scouts they have, how each one is behaving, and whether the fleet is actually working. Coverssurveying the fleet and its schedules, reading recent scout runs and drilling into a singlerun's reasoning, inspecting the durable scratchpad memory the fleet has built up, tracing a- run to the reports it wrote or edited, and assessing a scout's health and performance over time+ run to the reports it wrote or edited, reading the follow-up checks still measuring a report,+ and assessing a scout's health and performance over time(cadence, success rate, report rate, signal-to-noise). Read-only and exploratory — to write ortune a scout, use `authoring-scouts` instead. Trigger on "what are my scouts doing","how is my <x> scout performing", "show me recent scout runs", "why did this scout find/report@@ -261,6 +262,19 @@ The flip side matters when explaining a gap: a run can narrate "authored a reporTo browse the inbox more broadly, use the `inbox-exploration` skill (statuses, suggested reviewers, drilling into a report's underlying signals).The report contract behind each report — the report bar, evidence, actionability, reviewer routing — is documented in the `authoring-scouts` skill (`references/report-contract.md`).+**A report's status is not its whole state: read its checks too.** A **check** is a follow-up measurement a scout or the report pipeline attached to a report — an expectation plus a time to test it — so a report can be resolved and still under measurement.+`inbox-report-checks-list` returns every check on one report, newest first, with its `status` (`pending`, `active`, `passed`, `failed`, `errored`, `expired`, `cancelled`), its `last_outcome`, and its schedule (`next_run_at`, `run_interval_minutes`, `runs_remaining`, `expires_at`); `inbox-report-checks-retrieve` returns one check with its full config.+Read the rows this way:++- **`pending`** — the check is waiting for the report to resolve before its clock starts.+- **`active`** with a future `next_run_at` — a verdict is on its way. Don't re-derive the answer by hand; say when it lands.+- Everything else is terminal. A claim still worth watching needs a new check, which is a write — hand off to `authoring-scouts`.++The verdicts themselves are **not** on the check row: each one is a `check_result` artefact on the report, so read them through the report's artefact list.+`query` and `baseline_value` read as null for a credential that cannot read the data they describe.+A `failed` check on a resolved report usually has a **fresh report** behind it as well (the breach is re-surfaced as a new report linked to the resolved one), so look for that before reporting the relapse as unhandled.+The full mechanics — the two check kinds, the soak window, what each verdict does next — are in the `authoring-scouts` skill (`references/report-checks.md`).+## Workflow: assess health and performance"Is my scout actually working / earning its cost?"diff --git a/products/signals/skills/working-with-scouts/SKILL.md b/products/signals/skills/working-with-scouts/SKILL.mdindex 76da394c23a0..4ab452a526d5 100644--- a/products/signals/skills/working-with-scouts/SKILL.md+++ b/products/signals/skills/working-with-scouts/SKILL.md@@ -1,16 +1,14 @@---name: working-with-scoutsdescription: >- How to get real jobs done with PostHog Signals scouts — the scheduled agents that watch a- project and write reports into the Signals inbox — and how to steer and customize the fleet- over time. Use when a user wants to delegate a watching job ("have a scout keep an eye on X",- "tell me if Y spikes"), wants a recurring judged metric from a scout ("score X on a- schedule", "measure quality of Y"), wants to know which scout covers a surface, asks how to- act on what scouts report, complains the fleet is noisy or quiet, or wants the fleet to get- smarter over time (feedback loops, calibration, promoting one-off steers into policy). The- operating manual for the human–scout working relationship; routes to `authoring-scouts` for- write mechanics, `exploring-scouts` for run observability, and `inbox-exploration` for report- triage. Trigger on "work with my scouts", "get more out of scouts", "have a scout watch X",+ Work with PostHog Signals scouts: scheduled agents that monitor a project and write+ reports into the Signals inbox. Use to assign monitoring work, schedule quality scoring,+ find which scout covers a surface, act on reports, reduce noise, investigate missing+ findings, or improve the fleet through feedback and calibration. Also covers follow-up+ checks that verify whether a reported problem stays fixed. Use `authoring-scouts` for+ edits, `exploring-scouts` for run observability, and `inbox-exploration` for report triage.+ Trigger on "work with my scouts", "get more out of scouts", "have a scout watch X",+ "tell me if Y spikes", "score X on a schedule", "measure quality of Y","what do I do with this scout report", "calibrate/review my scout fleet".metadata:owner_team: signals@@ -101,6 +99,12 @@ Report triage mechanics live in `inbox-exploration`; what matters here is how acA reviewer correction is the strongest routing evidence the fleet gets: it reaches the scouts that filed or edited the report and the scouts whose `reviewer:` memory names a removed login (capped at twenty targets per correction, so on a very busy report a few can miss it), so fixing a misrouted report in place teaches the fleet who owns the surface.The forwarded note carries GitHub logins and is written only when the corrector holds skill-editor access on the canonical project, so a correction made without that access, or one that only adds or removes a `user_uuid` reviewer with no linked GitHub account, stays on the report and is not forwarded.The discussion and rating paths demand the full notes-write authorization (skill-editor access plus the `signal_scout:write` / `llm_skill:write` key scopes), so a note typed by someone without it is not forwarded: a discussion question still lives on the report's thread, but a rating note survives only in the analytics event, so if it must reach the scout, have someone authorized leave it as a scout note.+- **Resolving a report is not the end of it — a check measures whether the fix held.** A **check** is a follow-up measurement a scout (or the report pipeline) attaches to a report: one expectation, and a time to test it. Resolving the report starts its clock, and after a soak window — 24 hours by default, longer for a fix that reaches users slowly, like a mobile release or a cached client bundle — it re-measures, and the verdict lands on the report. So "did that actually work?" becomes a stored fact instead of something somebody has to remember to go and re-derive.+ Three things this changes in how you work:+ - **Read a resolved report's checks before you call it done.** `posthog:inbox-report-checks-list` shows each check's `status` and `last_outcome`. A check still open means a verdict is coming, so there is no need to re-measure by hand. Reading the rows is `exploring-scouts`' job.+ - **A failed check means the fix did not hold**, and the relapse is filed as a fresh report linked back to the resolved one rather than reopening it — a resolved report has left the inbox, so nothing there would be read. Treat that new report as the live item.+ - **Resolve honestly, and resolve on the merge.** A check dated from a premature resolve measures the window before the fix shipped and can fail a fix that worked.+ Checks are written only by scout runs and by the pipeline; there is no create surface for a person, so if a resolved report should be re-measured and carries no check, the lever is the scout — a note asking it to attach one, or a skill edit via `authoring-scouts`.- **Reports route to people.** A scout that can name a plausible owner sets `suggested_reviewers`, and the inbox floats those reports to the top of that person's view.A reviewer is a PostHog user: a scout routes by `user_uuid` (any org member, no GitHub account needed) or by `github_login` (matched against the member's linked GitHub identity), and `is_suggested_reviewer` flips for the viewer on either match.If reports for a surface keep landing unrouted or misrouted, that's fixable: correct the reviewers on the report itself (the correction is forwarded as above), leave a fleet-wide routing note (`posthog:scout-notes-create` with no `skill_name`, "route billing-adjacent reports to Dana"), or steer the scout (note or skill edit) toward the right owner for the area. A `pipeline:report-research` note steers only the reports the pipeline builds from clustered signals; a scout that authors reports directly sets `suggested_reviewers` itself and never reads that audience.@@ -225,3 +229,4 @@ Every few weeks (or when someone says "are the scouts even worth it?"), run a ca| "Write / edit / retune a scout" | `authoring-scouts` || "Why did the scout stop flagging X?" | Scratchpad first (`noise:` / `addressed:` / `dedupe:` / `allowlist:`), then notes, then config || "What did this scout change?" | "Auditing what a scout changed" above: the run window, then `advanced-activity-logs-list` |+| "Did that fix actually hold?" | `posthog:inbox-report-checks-list` on the resolved report; mechanics in `authoring-scouts` |