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): steer report scouts to resolve reviewer github logins (#66880)

Andrew Maguire23f2dd6ed4b9
diff --git a/products/signals/backend/scout_harness/prompt.py b/products/signals/backend/scout_harness/prompt.py
index cf12db4959bf..428ab1c81157 100644
--- a/products/signals/backend/scout_harness/prompt.py
+++ b/products/signals/backend/scout_harness/prompt.py
@@ -332,6 +332,13 @@ unactioned.
recent authors on the relevant surface, the team that owns the product) to name
the right GitHub logins. Treat "I couldn't find an owner" as a last resort, not
a default.
+- **Resolve the GitHub login — never guess it.** Entries must be bare, lowercase
+ GitHub logins, and the inbox routes by matching them exactly, so a guessed,
+ mis-cased, or display-name handle reaches no one. The owner you identify is
+ usually a PostHog member, not a handle: call `org-member-get-github-login` with
+ their user UUID (from `org-members-list`, or `@me`) to turn that member into
+ their linked GitHub login. If you can't resolve a confident login, leave the
+ field empty rather than inventing one.
- **Set `priority` + `priority_explanation`** when the issue is concrete and you
can justify the urgency — autostart needs a priority to consider a draft PR.
- **Set `repository`** (`owner/repo`) when you know where a fix would land — pass
diff --git a/products/signals/backend/test/test_scout_harness.py b/products/signals/backend/test/test_scout_harness.py
index 1a534fb441d8..aa6cfdf455bd 100644
--- a/products/signals/backend/test/test_scout_harness.py
+++ b/products/signals/backend/test/test_scout_harness.py
@@ -217,6 +217,9 @@ class TestPromptBuilder(BaseTest):
assert "inbox-reports-list" in prompt
assert "Suggested reviewers route the report" in prompt
assert "suggested_reviewers" in prompt
+ # Reviewer routing only works with a real GitHub login, so the prompt must point the scout
+ # at the resolver tool rather than letting it guess a handle.
+ assert "org-member-get-github-login" in prompt
# The report channel teaches that the `report:` scratchpad entry is a pointer
# into the inbox, not a copy of the report — the inbox stays the source of
# truth, so the scout retrieves the live report before editing. Dropping this
@@ -262,6 +265,8 @@ class TestPromptBuilder(BaseTest):
assert "Editing existing reports" in prompt
assert "Suggested reviewers route the report" not in prompt
assert "Writing the report" not in prompt
+ # The reviewer-resolution guidance rides the author-time section, so it drops with it.
+ assert "org-member-get-github-login" not in prompt
# Orchestration tests run as plain pytest functions because the async runner uses
diff --git a/products/signals/skills/authoring-signals-scouts/references/report-contract.md b/products/signals/skills/authoring-signals-scouts/references/report-contract.md
index 94df17c2fa64..2d334810792e 100644
--- a/products/signals/skills/authoring-signals-scouts/references/report-contract.md
+++ b/products/signals/skills/authoring-signals-scouts/references/report-contract.md
@@ -116,12 +116,12 @@ resolve it, cheapest source first:
login directly: CODEOWNERS entries are often **team** slugs (`@your-org/team-name`) and `git log`
gives a name + email — both must be resolved to an **individual** GitHub login before you write
the reviewer (a team slug or an email won't match any user).
-4. **`org-members-list`** — only where the run has organization scope. It needs
- `organization_member:read`, which **headless scout runs scoped to a single team don't have**, so
- the tool is typically **absent from a scout's toolset**; don't build a scout's reviewer recipe
- around it. Where it _is_ available it confirms a person exists and gives their canonical name +
- account email (useful to **disambiguate or spell** a name) — but it still does **not** return a
- GitHub login, so treat it as a corroboration aid, never as the source of the handle.
+4. **`org-member-get-github-login`** — the canonical login resolver, available to every scout run
+ (it needs only `organization_member:read`, which scout tokens carry). Once you've identified the
+ owning **person** — by name/email via `org-members-list`, or `@me` for the current user — pass
+ their PostHog user UUID to this tool to get their linked GitHub login (it returns null when the
+ member has no GitHub identity linked). This is the one step that actually hands you a usable
+ handle, so prefer it over guessing when steps 1–3 only give you a person rather than a login.
**If you can't resolve a confident login, leave `suggested_reviewers` empty** — the report still
surfaces for a human to grab. **Never guess a handle**: a wrong login mis-assigns the report (or