: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
feat(reviewhog): put issue description first in finding comments (#93907)
Alex Lebedev7cba4577c23e
diff --git a/products/review_hog/DECISIONS.md b/products/review_hog/DECISIONS.mdindex 4d75be7e795c..d1e51d66788a 100644--- a/products/review_hog/DECISIONS.md+++ b/products/review_hog/DECISIONS.md@@ -236,6 +236,18 @@ read `FINAL_REPORT.md` there first (config glossary + coverage matrix + ranking)400). Watch the next dogfood resolution run for drift after a long in-sandbox investigation, which the one-shotcannot reproduce.+### ✅ BUILT 2026-09-03 — comment layout back to description-first (reverses the 2026-07-17 validation-first order)++User call: the issue description reads first, the validator's verdict second.+Reading order is now claim (title) → what the issue is (description) → why it's real (validation) → fix / AI prompt.+Applied in both renderers (`_format_issue_comment` in `publish_review.py`, `_render_off_diff_section` in `prepare_validation_markdown.py`); the order tests in both suites flipped with it.+Template-level and reversible, same as the original move.++- **Follow-up from review (2026-09-11).** The validator prompt, the `argumentation` field description, and the+ regenerated `issue_validation/schema.json` now describe the description as sitting _above_ the verdict, and keep+ the "bullets stand on their own" rule on its order-independent reason (a reader can expand them alone, and later+ pipeline steps read them without the description).+### ✅ BUILT 2026-08-27 — reviewer tier by PR origin and Signals priority (agent PRs review cheaper; branch-only inbox reviews retired; resolver on Opus 5)- **What.** The reviewer's effort is no longer one fleet-wide pin. Each `ReviewReport` is placed in a **reviewdiff --git a/products/review_hog/backend/reviewer/models/issue_validation.py b/products/review_hog/backend/reviewer/models/issue_validation.pyindex 013524731345..aa0d39321746 100644--- a/products/review_hog/backend/reviewer/models/issue_validation.py+++ b/products/review_hog/backend/reviewer/models/issue_validation.py@@ -12,8 +12,9 @@ class IssueValidation(BaseModel):description=("Your verification delta as labeled markdown bullets, never a restatement of the issue"" description (the full description always travels with your verdict, so restating it only"- " buries your evidence). Your bullets may be read first, right under the finding title, so"- " they must stand on their own as evidence for that titled claim. Bullets: '- **Checked:**'"+ " buries your evidence). Your bullets must stand on their own as evidence for that titled"+ " claim: a reader can expand them without the description, and later pipeline steps read"+ " them without it. Bullets: '- **Checked:**'"" what you investigated (files, call sites, types, guards); '- **Found:**' the decisive"" evidence, with file:line anchors; '- **Impact:**' the confirmed consequence (for a"" dismissal, why it does not meet the bar); '- **Priority:**' only when setting"diff --git a/products/review_hog/backend/reviewer/prompts/issue_validation/prompt.jinja b/products/review_hog/backend/reviewer/prompts/issue_validation/prompt.jinjaindex 503fc30622ba..7614449f7249 100644--- a/products/review_hog/backend/reviewer/prompts/issue_validation/prompt.jinja+++ b/products/review_hog/backend/reviewer/prompts/issue_validation/prompt.jinja@@ -13,7 +13,7 @@ Investigate the codebase, then either validate (keep) or dismiss (drop) the suggIf your investigation shows the reviewer assigned the wrong severity, correct it with `adjusted_priority` (`must_fix` / `should_fix` / `consider`): raise it when the impact is worse than flagged, lower it when it is milder. Leave `adjusted_priority` null to keep the reviewer's priority — only override on real evidence, not by default. Lowering a finding to `consider` keeps it on record and marks it the lowest priority; whether it reaches the pull request then depends on the author's urgency threshold, so use it to down-rank a real-but-minor issue rather than dismissing it outright.-Write `argumentation` as your verification delta, structured as labeled markdown bullets — `- **Checked:**` (what you investigated: files, call sites, types, guards), `- **Found:**` (the decisive evidence, with file:line anchors), `- **Impact:**` (the confirmed consequence; for a dismissal, why it does not meet the bar), and `- **Priority:**` (only when you set `adjusted_priority`). Repeat a label when you have several distinct points. Do NOT restate the issue description: the full description always travels with your verdict (in the published comment it sits collapsed just below), so restating it only buries your evidence. Your bullets may be the first thing a reader expands, right under the finding title — write them to stand on their own as evidence for that titled claim. This constrains shape, not content — keep every fact needed to justify the verdict.+Write `argumentation` as your verification delta, structured as labeled markdown bullets — `- **Checked:**` (what you investigated: files, call sites, types, guards), `- **Found:**` (the decisive evidence, with file:line anchors), `- **Impact:**` (the confirmed consequence; for a dismissal, why it does not meet the bar), and `- **Priority:**` (only when you set `adjusted_priority`). Repeat a label when you have several distinct points. Do NOT restate the issue description: the full description always travels with your verdict (in the published comment it sits collapsed just above), so restating it only buries your evidence. Your bullets must still stand on their own as evidence for the titled claim: a reader can expand them without opening the description, and later pipeline steps read them without it. This constrains shape, not content — keep every fact needed to justify the verdict.Write the prose inside those bullets in Simplified Technical English, following the `writing-simplified-technical-english` skill: one meaning per word, active voice, simple tenses, one idea per sentence. Keep file:line anchors and code identifiers exactly as they appear in the code.diff --git a/products/review_hog/backend/reviewer/prompts/issue_validation/schema.json b/products/review_hog/backend/reviewer/prompts/issue_validation/schema.jsonindex b00215afe068..d0b6eed72424 100644--- a/products/review_hog/backend/reviewer/prompts/issue_validation/schema.json+++ b/products/review_hog/backend/reviewer/prompts/issue_validation/schema.json@@ -18,7 +18,7 @@"type": "boolean"},"argumentation": {- "description": "Your verification delta as labeled markdown bullets, never a restatement of the issue description (the full description always travels with your verdict, so restating it only buries your evidence). Your bullets may be read first, right under the finding title, so they must stand on their own as evidence for that titled claim. Bullets: '- **Checked:**' what you investigated (files, call sites, types, guards); '- **Found:**' the decisive evidence, with file:line anchors; '- **Impact:**' the confirmed consequence (for a dismissal, why it does not meet the bar); '- **Priority:**' only when setting adjusted_priority, the reason. Repeat a label for several distinct points. Keep every fact needed to justify the verdict; cut only restatement.",+ "description": "Your verification delta as labeled markdown bullets, never a restatement of the issue description (the full description always travels with your verdict, so restating it only buries your evidence). Your bullets must stand on their own as evidence for that titled claim: a reader can expand them without the description, and later pipeline steps read them without it. Bullets: '- **Checked:**' what you investigated (files, call sites, types, guards); '- **Found:**' the decisive evidence, with file:line anchors; '- **Impact:**' the confirmed consequence (for a dismissal, why it does not meet the bar); '- **Priority:**' only when setting adjusted_priority, the reason. Repeat a label for several distinct points. Keep every fact needed to justify the verdict; cut only restatement.","title": "Argumentation","type": "string"},diff --git a/products/review_hog/backend/reviewer/tests/test_prepare_validation_markdown.py b/products/review_hog/backend/reviewer/tests/test_prepare_validation_markdown.pyindex 27a2793d5fb0..d7d054aff18b 100644--- a/products/review_hog/backend/reviewer/tests/test_prepare_validation_markdown.py+++ b/products/review_hog/backend/reviewer/tests/test_prepare_validation_markdown.py@@ -132,11 +132,11 @@ def test_other_findings_section_membership(assert ("Membership marker finding" in body) is expected_in_section-def test_off_diff_finding_sections_lead_with_validation() -> None:+def test_off_diff_finding_sections_lead_with_description() -> None:# The off-diff section must render its collapsed blocks in the same deliberate reading order as- # the inline comment (verdict first, then description, then fix). The two renderers are separate+ # the inline comment (description first, then verdict, then fix). The two renderers are separate# templates, so the inline-comment order test can't catch _render_off_diff_section flipping back- # to description-first.+ # to validation-first.issue = Issue(id="1-1-1",title="Off-diff finding",@@ -157,6 +157,6 @@ def test_off_diff_finding_sections_lead_with_validation() -> None:positions = [body.index(f"<summary><strong>{label}</strong></summary>")- for label in ("Why we think it's a valid issue", "Issue description", "Suggested fix")+ for label in ("Issue description", "Why we think it's a valid issue", "Suggested fix")]assert positions == sorted(positions)diff --git a/products/review_hog/backend/reviewer/tests/test_publish_review.py b/products/review_hog/backend/reviewer/tests/test_publish_review.pyindex bbe590f10c28..53618d74b855 100644--- a/products/review_hog/backend/reviewer/tests/test_publish_review.py+++ b/products/review_hog/backend/reviewer/tests/test_publish_review.py@@ -407,11 +407,11 @@ class TestFormatIssueComment:# Alt text is the raw enum value, so the priority still reads when the badge image can't load.assert f"![{alt}]" in body- def test_layout_is_title_then_badges_then_collapsed_sections_validation_first(self) -> None:+ def test_layout_is_title_then_badges_then_collapsed_sections_description_first(self) -> None:# Title leads, badges tag it just beneath, and all four sections stay folded — with the- # validator's verdict first (the deliberate reading order: claim → why it's real → detail).+ # issue description first (the deliberate reading order: claim → what it is → why it's real).# Catches a badge/title reorder, a re-added `Priority | Lines` meta, a section surfaced inline- # instead of collapsed, or a template refactor flipping the order back to description-first.+ # instead of collapsed, or a template refactor flipping the order back to validation-first.finding = _finding()body = _format_issue_comment(finding, _verdict())@@ -419,8 +419,8 @@ class TestFormatIssueComment:positions = [body.index(f"<summary><strong>{label}</strong></summary>")for label in (- "Why we think it's a valid issue","Issue description",+ "Why we think it's a valid issue","Suggested fix","Prompt to fix with AI (copy-paste)",)diff --git a/products/review_hog/backend/reviewer/tools/prepare_validation_markdown.py b/products/review_hog/backend/reviewer/tools/prepare_validation_markdown.pyindex a3282d328528..5f0e3b21c9b9 100644--- a/products/review_hog/backend/reviewer/tools/prepare_validation_markdown.py+++ b/products/review_hog/backend/reviewer/tools/prepare_validation_markdown.py@@ -123,18 +123,18 @@ def _render_off_diff_section(findings: list[tuple[Issue, IssueValidation]]) -> l" | ".join(meta),"","<details>",- "<summary><strong>Why we think it's a valid issue</strong></summary>",+ "<summary><strong>Issue description</strong></summary>","<br>","",- validation.argumentation,+ issue.issue,"","</details>","","<details>",- "<summary><strong>Issue description</strong></summary>",+ "<summary><strong>Why we think it's a valid issue</strong></summary>","<br>","",- issue.issue,+ validation.argumentation,"","</details>","",diff --git a/products/review_hog/backend/reviewer/tools/publish_review.py b/products/review_hog/backend/reviewer/tools/publish_review.pyindex 5deddb70401e..5bb8e2563821 100644--- a/products/review_hog/backend/reviewer/tools/publish_review.py+++ b/products/review_hog/backend/reviewer/tools/publish_review.py@@ -259,9 +259,9 @@ def _format_issue_comment(finding: ReviewIssueFinding, verdict: ValidationVerdic"""Format a finding + its verdict as an inline comment body.Leads with the title, then a line of colored severity/category badges (replacing the old- `Priority | Category | Lines` text meta); four collapsed sections follow, the validator's verdict- first — it is the human-facing evidence, so the reading order is claim (title) → why it's real- (validation) → description / fix / AI prompt for whoever wants more. Line refs are omitted from+ `Priority | Category | Lines` text meta); four collapsed sections follow, the issue description+ first — the reading order is claim (title) → what the issue is (description) → why it's real+ (validation) → fix / AI prompt for whoever wants more. Line refs are omitted fromthe top — the comment is anchored inline and the lines live in the AI prompt."""priority = effective_priority(finding.priority, verdict.adjusted_priority)@@ -272,18 +272,18 @@ def _format_issue_comment(finding: ReviewIssueFinding, verdict: ValidationVerdic_finding_badge_line(priority, verdict.category),"","<details>",- "<summary><strong>Why we think it's a valid issue</strong></summary>",+ "<summary><strong>Issue description</strong></summary>","<br>","",- verdict.argumentation,+ finding.body,"","</details>","","<details>",- "<summary><strong>Issue description</strong></summary>",+ "<summary><strong>Why we think it's a valid issue</strong></summary>","<br>","",- finding.body,+ verdict.argumentation,"","</details>","",