: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(review_hog): name it PostHog Review everywhere, add posthog-review label (#115261)
Julian Bez54589605f0bd
diff --git a/.agents/skills/reviewing-with-coderabbit/SKILL.md b/.agents/skills/reviewing-with-coderabbit/SKILL.mdindex 905534a03dce..40d5eadb800d 100644--- a/.agents/skills/reviewing-with-coderabbit/SKILL.md+++ b/.agents/skills/reviewing-with-coderabbit/SKILL.md@@ -1,7 +1,7 @@---name: reviewing-with-coderabbitdescription: >- Disabled. CodeRabbit is retired on this repository in favor of PostHog Review (`.github/review-hog.yml`),+ Disabled. CodeRabbit is retired on this repository in favor of PostHog Review,so there is no local CodeRabbit pass to run before `gh pr create`.When invoked, or when a prompt or template still mentions a CodeRabbit CLI pass, do nothing and continuethe task. Not for a person's own request to review a branch. Trigger terms: coderabbit, cr review,@@ -11,8 +11,8 @@ description: ># Reviewing with CodeRabbit (disabled)This skill is switched off.-PostHog Review (ReviewHog) reviews pull requests automatically in repositories that commit `.github/review-hog.yml`, for the authors and events that file allows.-An eligible person can also add the `reviewhog` label to request a review.+PostHog Review reviews pull requests automatically in the repositories a project added in its Code review settings, for the authors its rules select.+An eligible person can also add the `posthog-review` label to request a review.When this skill is invoked, or an instruction asks for a CodeRabbit CLI pass:diff --git a/.coderabbit.yaml b/.coderabbit.yamlindex 916bf59888b2..b657a7a7d4eb 100644--- a/.coderabbit.yaml+++ b/.coderabbit.yaml@@ -46,8 +46,8 @@ reviews:review_details: falseauto_review:- # CodeRabbit is retired on this repository in favor of PostHog Review- # (.github/review-hog.yml). The rest of this file is kept so a deliberate+ # CodeRabbit is retired on this repository in favor of PostHog Review.+ # The rest of this file is kept so a deliberate# re-enable restores the tuned setup rather than the vendor defaults.enabled: falsediff --git a/docs/internal/sandboxes-setup-guide.md b/docs/internal/sandboxes-setup-guide.mdindex 8ef12768915a..270fc58752e8 100644--- a/docs/internal/sandboxes-setup-guide.md+++ b/docs/internal/sandboxes-setup-guide.md@@ -238,7 +238,7 @@ access. A parent project's flag does not enable its child environments, even thotheir settings and reviews under the shared parent project.Newly enabled projects get every ReviewHog part: manual Full and Flash reviews, automatic Flash reviews,-the `reviewhog` label trigger, resolution, Inbox reviews, the tiered review models, and the Stamphog+the `posthog-review` label trigger, resolution, Inbox reviews, the tiered review models, and the StamphogInbox switch.Each project needs a GitHub App integration covering the repository; review skills seed automatically.Automatic reviews and the label trigger also need the project to claim the repository in the Code reviewdiff --git a/frontend/src/layout/panel-layout/sidebarProductMeta.ts b/frontend/src/layout/panel-layout/sidebarProductMeta.tsindex 573b3e399b22..8167dcc84fe4 100644--- a/frontend/src/layout/panel-layout/sidebarProductMeta.ts+++ b/frontend/src/layout/panel-layout/sidebarProductMeta.ts@@ -70,6 +70,7 @@ export const SIDEBAR_PRODUCTS_WITHOUT_DOCS = new Set<string>(['Broadcasts','Business intelligence','Business knowledge',+ 'Code review','Engineering analytics','Identity matching','Product tours',diff --git a/frontend/src/layout/today/todayRecentFilters.ts b/frontend/src/layout/today/todayRecentFilters.tsindex 0aacbed21d09..9aade72f6327 100644--- a/frontend/src/layout/today/todayRecentFilters.ts+++ b/frontend/src/layout/today/todayRecentFilters.ts@@ -67,7 +67,7 @@ const SOURCE_LABELS: Record<string, string> = {task_analysis: 'Task analysis',hogdesk: 'HogDesk',mcp_analytics: 'MCP analytics',- review_hog: 'ReviewHog',+ review_hog: 'PostHog Review',}export function recentSourceLabel(source: string): string {diff --git a/frontend/src/products.tsx b/frontend/src/products.tsxindex 85e856c638e2..adfd6ae6f48b 100644--- a/frontend/src/products.tsx+++ b/frontend/src/products.tsx@@ -1082,7 +1082,6 @@ export const productConfiguration: Record<string, any> = {projectBased: true,description: 'Automated code reviews of your pull requests, and your review agent settings.',iconType: 'code_review',- docsHref: 'https://posthog.com/docs/posthog-desktop/code-review',},ScoutTrials: { name: 'Scout trials', projectBased: true },Inbox: {diff --git a/products/review_hog/ARCHITECTURE.md b/products/review_hog/ARCHITECTURE.mdindex bf8c651a5479..8f4192de141c 100644--- a/products/review_hog/ARCHITECTURE.md+++ b/products/review_hog/ARCHITECTURE.md@@ -2,10 +2,15 @@## Terms-The UI and the text ReviewHog posts use the user-facing names. Code, API values, and stored data use the internal names.+**PostHog Review** is the product name on every outward surface: GitHub comments, MCP tools, API docs, and UI prose.+**Code review** is the name of the in-app page and its nav entry only.+**ReviewHog** is the internal codename. Code, logs, metric names, keys, and developer docs use it.+The `posthog-review` label starts a review. The legacy `reviewhog` label still works as an alias.++The UI and the text PostHog Review posts use the user-facing names. Code, API values, and stored data use the internal names.- **Standard** (internal name **Flash**, `flash`): the automatic review every push gets. A fixed set of reviewers on a lower-cost model. It never pushes to the branch.-- **Deep** (internal name **Full**, `full`): the review someone asks for with the Review button, the `reviewhog` label, or an Inbox report. It uses the requester's perspectives, validator, and threshold.+- **Deep** (internal name **Full**, `full`): the review someone asks for with the Review button, the `posthog-review` label, or an Inbox report. It uses the requester's perspectives, validator, and threshold.- **Resolve**: the stage after a Deep review that fixes review comments on the PR branch, only when the PR owner opted in (`resolve_comments`).- **Inbox review**: a Deep review of a PR the PostHog agent opened for an Inbox report. The report's assigned reviewer counts as the PR owner.- **Perspective**: one angle a Deep review reads the code from, such as logic and correctness. Each one is a review skill.@@ -177,8 +182,7 @@ The full roadmap — every open thread with its reasoning, the loop design, thethe experiment backlog — is in [DECISIONS.md](./DECISIONS.md) (start at its "🎯 NEXT" section) and `eval/`(`RUN_LOG.md`, `POTENTIAL_EXPERIMENTS.md`, `experiments/`).-**Before public release:** settle the "ReviewHog Alpha" published-comment wording (see-[Known issues](#known-issues--tech-debt)), and land the three BLOCKING resolution-stage hardening TODOs above+**Before public release:** land the three BLOCKING resolution-stage hardening TODOs above(structural comment rendering + author-permission gate + pre-push restricted-paths enforcement). Enabling anotherproject for manual review does not clear these requirements for public or untrusted use.@@ -445,7 +449,7 @@ pr_metadata.head_branch` is threaded (as explicit kwargs, alongside `team_id` /runs go `idle` at finalize; `progress_payload` labels the deferred window "finalizing".10. **Publish** — `publish_review` (GitHub REST via the gated egress transport, **DB-driven**) reads the body from`ReviewReport.report_markdown` and the inline comments from the valid finding/verdict rows (`load_valid_findings`),- posts a standalone "ReviewHog Alpha 🦔" feedback comment, then a PR review (`event="COMMENT"`, **pinned to the+ posts a PR review (`event="COMMENT"`, **pinned to thereviewed `head_sha`** via `commit_id`) with inline comments for `is_valid` `MUST_FIX`/`SHOULD_FIX` findings thatland on a line present in the current diff (`CONSIDER` dropped). It posts whenever there's ≥1 valid publishablefinding — if all are off-diff (no inline comments resolve) the body still posts, carrying them in the@@ -880,7 +884,7 @@ See [DECISIONS.md](./DECISIONS.md) for the "reuse the leaf, own the model" bound4. Set the project rule (automatic Flash for everyone, for listed people, or opt-in only) and the bot rule.**Triggers.** Six entry points feed the same per-PR `ReviewPRQueueWorkflow`: the `run_review` CLI (manual / eval), the-`reviewhog` **label** on a PR in a repository that a project reviews (the GitHub App's own `labeled` delivery), a **UI**+`posthog-review` **label** (or the legacy `reviewhog` label) on a PR in a repository that a project reviews (the GitHub App's own `labeled` delivery), a **UI**"Review this PR" field in the Code review scene (any installation-accessible PR; its split button's `run_mode`also carries the review-without-resolving, resolve-only, and **Flash** variants; Flash pins resolution off), an **inbox** trigger (a`TaskRun` receiver auto-reviews self-driving Signals implementations once their PR exists — a pushed branch without@@ -892,15 +896,15 @@ The automatic trigger consumes signed GitHub `pull_request` deliveries through `It accepts `opened`, `synchronize`, and `ready_for_review` for open PRs whose head and base belong to the delivery's repository, including drafts.A draft is skipped (`draft_skipped`) when the PR owner turned `review_drafts` off. Its first automatic review then comes from `ready_for_review`, and `automatic_reviewed_head_sha` keeps a head that was already reviewed as a draft from a second review.A PR with the `skip-agent-review` label gets no automatic review (`label_skipped`). The task checks the payload labels, and the turn checks the labels its fetch reads from GitHub again, because `gh pr create --label` adds labels after the `opened` delivery.-The turn ends before the status comment, so a skip leaves nothing on the PR. Removing the label does not start a review; apply the `reviewhog` label for one.+The turn ends before the status comment, so a skip leaves nothing on the PR. Removing the label does not start a review; apply the `posthog-review` label for one.The label, the `@posthog review` comment, and the UI button ignore both the switch and the skip label.The webhook handler reads only the cached ownership summary, so the task checks ownership again.Enabling the setting performs no backfill; existing PRs become eligible on their next push.The turn rechecks ownership and the rules before starting. Flash publishes every kept finding (it records `consider` as the turn's threshold) and never starts resolution.**No Flash after Full:** once a PR has a published Full review, automatic dispatch skips it (`full_review_published`), the turn's recheck refuses it, and a manual Flash request answers 409 `flash_after_full`.-The same `review_hog_authored_prs` consumer (the name is the dedup key, so it stays) routes by action through `facade/github.py::accept_pull_request_event` (`backend/pull_request_events.py`): `labeled` with the `reviewhog` label queues `process_label_event`.-That task finds the owning project and accepts a person or `stamphog[bot]` (Stamphog's hand-off) as the labeler; another bot's label gets an explaining comment and is removed with the app token.-The review runs as the PR owner, else as the user who connected the installation (`Integration.created_by`) with default settings and no resolution; the workflow removes the label when the run ends, and a running resolution leaves the label for a later retry.+The same `review_hog_authored_prs` consumer (the name is the dedup key, so it stays) routes by action through `facade/github.py::accept_pull_request_event` (`backend/pull_request_events.py`): `labeled` with the `posthog-review` or legacy `reviewhog` label queues `process_label_event`.+That task finds the owning project and accepts a person or `stamphog[bot]` (Stamphog's hand-off) as the labeler; another bot's label gets an explaining comment, and the app token removes the label that the event named.+The review runs as the PR owner, else as the user who connected the installation (`Integration.created_by`) with default settings and no resolution; the workflow removes both labels when the run ends, and a running resolution leaves the label for a later retry.Counters: `posthog_review_hog_authored_pr_review_total` and `posthog_review_hog_label_review_total`, keyed by outcome.`facade/github.py::owning_team_id(installation_id, repository)` answers the same ownership question for other products, for example a PR comment command dispatcher.The UI and MCP paths are one surface: the viewset carries the grantable `review_hog` scope (`review_hog:read` for list /@@ -996,10 +1000,6 @@ The list selects running candidates by their latest report update, so newer stalretrigger correctly 409s. Accepted: typical turns run a few minutes, the label self-corrects on the nextverdict, and the busy-guard still prevents double runs. If turns ever grow, add a periodic DB liveness beatinside `resolve_threads_activity` (Temporal's Heartbeater pings Temporal only, never the DB the UI reads).-- **Alpha maturity** — the published comment still says "ReviewHog Alpha" and asks users to reply- "valid"/"invalid" (`reviewer/tools/publish_review.py`, the `post_promo` block). Publish is now live- per-run (the trigger endpoint posts with `publish=true`), so settle the prod wording before real users- see it.- **TODO (BLOCKING public release): resolution-stage injection hardening.** Structural(JSON) comment rendering in the resolution prompt, the author-permission gate, and pre-push restricted-pathsenforcement in the signed-commit tooling are NOT built; only the prompt floors + the post-push deliverydiff --git a/products/review_hog/CONTEXT.md b/products/review_hog/CONTEXT.mdindex 01f0e519406a..843327bae1eb 100644--- a/products/review_hog/CONTEXT.md+++ b/products/review_hog/CONTEXT.md@@ -2,6 +2,7 @@Vocabulary settled while working on the product. Pure vocabulary — no spec, no implementation detail beyond what a term needs to be unambiguous.+- **PostHog Review / Code review / ReviewHog** — three names for one product. **PostHog Review** is the product name on every outward surface (GitHub, MCP, API docs, UI prose). **Code review** is the in-app page and nav name only. **ReviewHog** is the internal codename for code, logs, and developer docs. The `posthog-review` label starts a review, and the legacy `reviewhog` label still works.- **Finding body** — the reviewer's description of a problem (`Issue.issue`, persisted as `ReviewIssueFinding.body`). Dual-audience text: it is rendered verbatim in the published comment AND consumed by three downstream LLM stages (the validator's `ISSUE` payload, dedup's fresh/prior finding payloads, and future turns' covered-findings block).- **Validator argumentation** — the validator's why-valid / why-dismissed reasoning (`IssueValidation.argumentation`). For a _valid_ finding it is presentation-only (humans + the copy-paste fix prompt); its only pipeline consumer is dedup's `prior_ruling`, and only when the finding was _dismissed_.- **Published copy** — what humans read on GitHub (inline comment sections, report body) and in the Code review UI. Today it is byte-identical to the pipeline payload; nothing requires that.diff --git a/products/review_hog/backend/api/blind_spots.py b/products/review_hog/backend/api/blind_spots.pyindex c1d2c909a78f..a34e94cfd111 100644--- a/products/review_hog/backend/api/blind_spots.py+++ b/products/review_hog/backend/api/blind_spots.py@@ -53,7 +53,7 @@ class ReviewBlindSpotsConfigSelectSerializer(serializers.Serializer):class ReviewBlindSpotsConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):- """Per-user selection of ReviewHog's single active blind-spots skill for a project.+ """Per-user selection of the single active blind-spots skill for PostHog Review for a project.A blind-spots skill is any team `review-hog-blind-spots-*` `LLMSkill` (canonical or custom —handled identically at run time): the final per-chunk sweep that reads the perspective wave'sdiff --git a/products/review_hog/backend/api/perspectives.py b/products/review_hog/backend/api/perspectives.pyindex b6933425a9d3..e23d4eecc9f0 100644--- a/products/review_hog/backend/api/perspectives.py+++ b/products/review_hog/backend/api/perspectives.py@@ -46,7 +46,7 @@ class ReviewPerspectiveConfigUpdateSerializer(serializers.Serializer):class ReviewPerspectiveConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):- """Per-user enablement of ReviewHog's review perspectives for a project.+ """Per-user enablement of PostHog Review's review perspectives for a project.A perspective is any team `review-hog-perspective-*` `LLMSkill` (canonical or custom — handledidentically at run time). The skill itself is team-level; this surface only controls **which**diff --git a/products/review_hog/backend/api/project_settings.py b/products/review_hog/backend/api/project_settings.pyindex 1f243604ea54..516f31e844a4 100644--- a/products/review_hog/backend/api/project_settings.py+++ b/products/review_hog/backend/api/project_settings.py@@ -194,7 +194,7 @@ def _entry_data(entry: OverviewEntry) -> dict[str, Any]:class ReviewProjectSettingsViewSet(ReviewHogProjectViewSetMixin, viewsets.GenericViewSet):- """The project-wide ReviewHog rule and the repository overview.+ """The project-wide PostHog Review rule and the repository overview.Project members can read everything here. Only project admins can change the rule and its lists,and every change goes to the activity log.@@ -230,7 +230,7 @@ class ReviewProjectSettingsViewSet(ReviewHogProjectViewSetMixin, viewsets.Generi@extend_schema(methods=["GET"],responses={200: OpenApiResponse(response=ReviewProjectSettingsSerializer)},- summary="Get the project's ReviewHog rule",+ summary="Get the project's code review rule",description="The project rule for automatic Standard reviews, bot pull requests, the Deep review defaults, ""and the connected GitHub installations.",)@@ -242,7 +242,7 @@ class ReviewProjectSettingsViewSet(ReviewHogProjectViewSetMixin, viewsets.Generi400: OpenApiResponse(description="Invalid field value."),403: OpenApiResponse(description="Only project admins can change the rule."),},- summary="Update the project's ReviewHog rule",+ summary="Update the project's code review rule",description="Partially update the project rule. Only the provided fields change. Project admins only.",)@action(detail=False, methods=["GET", "PATCH"], url_path="project_settings", url_name="project_settings")diff --git a/products/review_hog/backend/api/resolution.py b/products/review_hog/backend/api/resolution.pyindex a7ec9f4f9779..05ba03b46ee2 100644--- a/products/review_hog/backend/api/resolution.py+++ b/products/review_hog/backend/api/resolution.py@@ -53,7 +53,7 @@ class ReviewResolutionConfigSelectSerializer(serializers.Serializer):class ReviewResolutionConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):- """Per-user selection of ReviewHog's single active resolution-criteria skill for a project.+ """Per-user selection of the single active resolution-criteria skill for PostHog Review for a project.A resolution skill is any team `review-hog-resolution-*` `LLMSkill` (canonical or custom —handled identically at run time): the bar the resolution stage applies to each unresolveddiff --git a/products/review_hog/backend/api/reviews.py b/products/review_hog/backend/api/reviews.pyindex 8724419f7b77..f07dbdb6a787 100644--- a/products/review_hog/backend/api/reviews.py+++ b/products/review_hog/backend/api/reviews.py@@ -1037,7 +1037,7 @@ class EffectiveTeamScopedKeyPermission(BasePermission):class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):- """Recent ReviewHog reviews on this project.+ """Recent code reviews on this project.Read-only meta for the Code review tab's "recent reviews" block: what was reviewed, how manyvalid findings at each effective priority, the reviewed PR's facts, and the pipeline shape of@@ -1088,7 +1088,7 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet),},summary="List recent reviews",- description="Recent ReviewHog reviews on this project: actively running reviews first (with the "+ description="Recent code reviews on this project: actively running reviews first (with the ""in-flight turn's stage), then the most recent completed ones — at most `limit` rows (default 5), ""plus `has_more` for whether a larger `limit` would reveal more. By default only the requesting ""user's reviews; `scope=everyone` lists every review on the project.",@@ -1143,7 +1143,7 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet),},summary="List reviews as a paginated table",- description="ReviewHog reviews on this project as a paginated table: reviews with a completed turn "+ description="Code reviews on this project as a paginated table: reviews with a completed turn ""plus reviews with a run in flight, ordered by last activity, so a review that starts or finishes ""moves to the top. Pages with `limit` and `offset`; `count` is the total across pages. Filters by ""`repository`, `review_mode`, `status`, and `published`. `running_count` counts the running reviews "@@ -1267,7 +1267,7 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet429: OpenApiResponse(description="GitHub rate-limited the App's token; retry after the Retry-After delay."),},summary="Start a review of a pull request",- description="Start a ReviewHog review of any pull request the project's GitHub App installation can "+ description="Start a PostHog Review run on any pull request the project's GitHub App installation can ""access, and publish it back to the PR. The run appears under the requesting user's recent reviews. ""A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency ""threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull "@@ -1343,7 +1343,7 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet400: OpenApiResponse(description="Not a GitHub pull request URL, or an invalid parameter."),},summary="Look up a pull request's review status",- description="Where a pull request's ReviewHog runs stand: `state`, the latest completed review turn, and "+ description="Where a pull request's review runs stand: `state`, the latest completed review turn, and ""the latest Resolve run. Works for any pull request on the project, also ones the caller did not ""trigger. Pass the `requested_at` and `head_sha` the trigger returned, and the `run_mode` it was called ""with, to get `request_outcome`, which says when that request is done.",@@ -1382,7 +1382,7 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet404: OpenApiResponse(description="No such review on this project, or no such completed turn."),},summary="Retrieve one review's detail",- description="One completed ReviewHog review on this project, with one turn's validated findings, "+ description="One completed code review on this project, with one turn's validated findings, ""the findings the validator dismissed (and why), and the review body published to GitHub. The ""latest completed turn by default; `run_index` reads an older one. `in_progress`, `progress`, and ""the resolution fields describe the report now, whatever the turn. Project-wide, so reviews listed "diff --git a/products/review_hog/backend/api/settings.py b/products/review_hog/backend/api/settings.pyindex 1f4077e2442b..7a19ffa1a562 100644--- a/products/review_hog/backend/api/settings.py+++ b/products/review_hog/backend/api/settings.py@@ -68,7 +68,7 @@ class ReviewUserSettingsSerializer(serializers.Serializer):required=False,help_text="Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets ""its first automatic review when it is marked ready for review. Applies to automatic reviews only: the "- "reviewhog label, an @posthog review comment, and the Review button still review drafts.",+ "posthog-review label, an @posthog review comment, and the Review button still review drafts.",)resolve_comments = serializers.BooleanField(required=False,@@ -91,7 +91,7 @@ class ReviewUserSettingsSerializer(serializers.Serializer):review_inbox_prs = serializers.BooleanField(required=False,help_text="Review the pull requests the agent opens for Inbox reports assigned to the user: "- "ReviewHog reviews each one and posts its findings to the pull request. Off by default.",+ "PostHog Review reviews each one and posts its findings to the pull request. Off by default.",)stamphog_review_inbox_prs = serializers.BooleanField(required=False,@@ -131,7 +131,7 @@ class ReviewUserSettingsSerializer(serializers.Serializer):class ReviewUserSettingsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):- """The requesting user's ReviewHog preferences for a project.+ """The requesting user's PostHog Review preferences for a project.Sibling of the perspective/validator/blind-spots config viewsets: skills control *how* a reviewruns, these preferences control *what gets reviewed* and *how strict publishing is*. Only the@@ -169,11 +169,11 @@ class ReviewUserSettingsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet)methods=["GET"],responses={200: OpenApiResponse(- response=ReviewUserSettingsSerializer, description="The requesting user's ReviewHog preferences."+ response=ReviewUserSettingsSerializer, description="The requesting user's code review preferences."),},- summary="Get the user's ReviewHog settings",- description="Fetch the requesting user's effective ReviewHog preferences for this project, and where "+ summary="Get the user's code review settings",+ description="Fetch the requesting user's effective code review preferences for this project, and where ""each value comes from.",)@extend_schema(@@ -183,8 +183,8 @@ class ReviewUserSettingsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet)200: OpenApiResponse(response=ReviewUserSettingsSerializer, description="The updated settings."),400: OpenApiResponse(description="Invalid field value (e.g. unknown urgency threshold)."),},- summary="Update the user's ReviewHog settings",- description="Partially update the requesting user's ReviewHog preferences for this project. Only the "+ summary="Update the user's code review settings",+ description="Partially update the requesting user's code review preferences for this project. Only the ""provided fields change. A value equal to the inherited one clears the user's own value.",)# Not named `settings` — that would shadow DRF's `APIView.settings` (its APISettings object).diff --git a/products/review_hog/backend/api/validators.py b/products/review_hog/backend/api/validators.pyindex 41e48703f632..d255f09e6020 100644--- a/products/review_hog/backend/api/validators.py+++ b/products/review_hog/backend/api/validators.py@@ -53,7 +53,7 @@ class ReviewValidatorConfigSelectSerializer(serializers.Serializer):class ReviewValidatorConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):- """Per-user selection of ReviewHog's single active review validator for a project.+ """Per-user selection of the single active review validator for PostHog Review for a project.A validator is any team `review-hog-validation-*` `LLMSkill` (canonical or custom — handledidentically at run time). The skill itself is team-level; this surface only controls **whichdiff --git a/products/review_hog/backend/label_reviews.py b/products/review_hog/backend/label_reviews.pyindex 3bfad5a5cec7..ee9b9846e0ae 100644--- a/products/review_hog/backend/label_reviews.py+++ b/products/review_hog/backend/label_reviews.py@@ -1,4 +1,5 @@-"""The label trigger: the `reviewhog` label on a pull request starts a Full review.+"""The label trigger: the `posthog-review` label (or the legacy `reviewhog` label) on a pull request starts a+Full review.The PostHog GitHub App's own `labeled` delivery starts it, so the trigger works in every repository theapp is installed on and a project owns (`ownership.py`). One label add is one review: pushes do not@@ -24,7 +25,7 @@ from posthog.otel_metrics import OtelInstrumentFactoryfrom products.review_hog.backend.automatic_reviews import connector_user_idfrom products.review_hog.backend.ownership import RepositoryOwnership, RepositoryReffrom products.review_hog.backend.pr_owner import PullRequestOwnerResolver-from products.review_hog.backend.pull_request_events import REVIEWHOG_LABEL+from products.review_hog.backend.pull_request_events import REVIEW_LABEL, REVIEW_LABELSfrom products.review_hog.backend.reviewer.persistence import lift_review_tier_for_joined_triggerfrom products.review_hog.backend.reviewer.tools.github_client import (GitHubAPIError,@@ -40,8 +41,8 @@ _otel = OtelInstrumentFactory("review_hog")STAMPHOG_BOT_LOGIN = "stamphog[bot]"BOT_LABEL_COMMENT = (- f"ReviewHog reviews start only when a person adds the `{REVIEWHOG_LABEL}` label, so this label from a bot "- "was removed. Add it again yourself to start a review."+ f"PostHog Review starts a review only when a person adds the `{REVIEW_LABEL}` label. A bot added it here, "+ "so the label was removed. Add the label yourself to start a review.")LabelReviewOutcome = Literal[@@ -106,17 +107,19 @@ class LabelReview:def _refuse_bot_label(self, integration: Integration) -> None:# The label goes first: a failed call retries the task, and the comment must post only once.token = self._github(integration).get_access_token()- try:- github_api_request(- "DELETE",- f"/repos/{self.repository}/issues/{self.pr_number}/labels/{REVIEWHOG_LABEL}",- token=token,- installation_id=self.installation_id,- endpoint="/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}",- )- except GitHubAPIError as error:- if error.status != 404:- raise+ # The task does not carry the label name, so a queued task works on old and new workers alike.+ for label in sorted(REVIEW_LABELS):+ try:+ github_api_request(+ "DELETE",+ f"/repos/{self.repository}/issues/{self.pr_number}/labels/{label}",+ token=token,+ installation_id=self.installation_id,+ endpoint="/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}",+ )+ except GitHubAPIError as error:+ if error.status != 404:+ raise# A POST can succeed on GitHub and still fail here, so a retry checks for the earlier comment.if self._bot_label_comment_posted(token):returndiff --git a/products/review_hog/backend/pull_request_events.py b/products/review_hog/backend/pull_request_events.pyindex 0f11c1b00e3e..fe16a6d6e0ef 100644--- a/products/review_hog/backend/pull_request_events.py+++ b/products/review_hog/backend/pull_request_events.py@@ -1,7 +1,7 @@"""GitHub `pull_request` deliveries of the PostHog GitHub App, routed by action.- `opened` / `synchronize` / `ready_for_review`: an automatic review (`automatic_reviews.py`).-- `labeled` with the `reviewhog` label: a label review (`label_reviews.py`).+- `labeled` with the `posthog-review` label (or the legacy `reviewhog` label): a label review (`label_reviews.py`).The webhook handler runs inside the request, so this module only parses the payload, reads thecached ownership summary, and queues a Celery task. The task checks ownership and the rules again.@@ -13,7 +13,9 @@ from posthog.dataclasses import frozenfrom products.review_hog.backend.ownership import OwnedRepositoryPrefilter, RepositoryRef-REVIEWHOG_LABEL = "reviewhog"+REVIEW_LABEL = "posthog-review"+LEGACY_REVIEW_LABEL = "reviewhog"+REVIEW_LABELS = frozenset({REVIEW_LABEL, LEGACY_REVIEW_LABEL})# Authors and automation apply this label to opt a pull request out of automatic reviews.SKIP_AGENT_REVIEW_LABEL = "skip-agent-review"AUTOMATIC_REVIEW_ACTIONS = frozenset({"opened", "synchronize", "ready_for_review"})@@ -115,7 +117,7 @@ class PullRequestEvent:@propertydef is_label_request(self) -> bool:- return self.action == "labeled" and (self.label_name or "").lower() == REVIEWHOG_LABEL+ return self.action == "labeled" and (self.label_name or "").lower() in REVIEW_LABELSdef accept_pull_request_event(payload: Mapping[str, object]) -> None:diff --git a/products/review_hog/backend/reviewer/constants.py b/products/review_hog/backend/reviewer/constants.pyindex 3ead8e6cbfd3..e7d5a5fd8e59 100644--- a/products/review_hog/backend/reviewer/constants.py+++ b/products/review_hog/backend/reviewer/constants.py@@ -153,7 +153,7 @@ SINGLE_AGENT_SOURCE = "flash-single-agent"# Hidden marker stamped on every ReviewHog inline finding comment (publish_review._format_issue_comment)# so the resolution stage can recognize its own threads by content. Installation bot logins vary per# deployment, so there is no stable login to match on; this marker is the reliable signal. Same-# HTML-comment style as the review-body / promo / status markers, invisible in rendered markdown.+# HTML-comment style as the review-body and status markers, invisible in rendered markdown.REVIEW_HOG_FINDING_MARKER = "<!-- reviewhog:finding -->"# A long list would bury the turn's own outcome, so the status comment shows this many of the findings otherdiff --git a/products/review_hog/backend/reviewer/prompts/issue_deduplicator/prompt.jinja b/products/review_hog/backend/reviewer/prompts/issue_deduplicator/prompt.jinjaindex 72b15a7acdbe..fa65a0eb5394 100644--- a/products/review_hog/backend/reviewer/prompts/issue_deduplicator/prompt.jinja+++ b/products/review_hog/backend/reviewer/prompts/issue_deduplicator/prompt.jinja@@ -3,7 +3,7 @@<pr_issue_deduplication_instructions>You are deduplicating the findings from this pull-request review. You are given:- `issues_to_deduplicate`: the fresh findings to prune.-- `prior_findings`: findings an earlier ReviewHog review turn already produced and ruled on for this+- `prior_findings`: findings an earlier PostHog Review turn already produced and ruled on for thisPR, each carrying a `prior_ruling` (validated as real, or dismissed with the validator'sreasoning). These never made it onto the PR as comments, but they ARE existing coverage: a freshfinding that raises the same concrete problem as a prior finding is a duplicate — drop it, whatever@@ -12,10 +12,10 @@ You are deduplicating the findings from this pull-request review. You are given:so a fresh finding with the same concrete problem is its duplicate.- `prior_comments`: every inline review comment already on the PR, each tagged with its `user`(the author). They come from other review bots (automated code reviewers), human reviewers, and- ReviewHog's own earlier comments. **Use the author to read what a comment is**: a code-review bot's+ PostHog Review's own earlier comments. **Use the author to read what a comment is**: a code-review bot'scomment is usually a formal finding, so a bot already raising your finding's problem is strongevidence it's a duplicate; a human's comment may be a question, nit, or discussion, so a human- remark near your finding is weaker evidence. No reviewer is privileged or excluded (ReviewHog's own+ remark near your finding is weaker evidence. No reviewer is privileged or excluded (PostHog Review's owncomments included) — the test is always whether the *same concrete problem* is already raised.**What makes two things duplicates**diff --git a/products/review_hog/backend/reviewer/prompts/issues_review/prompt.jinja b/products/review_hog/backend/reviewer/prompts/issues_review/prompt.jinjaindex b755cd07da44..21f3a8358df0 100644--- a/products/review_hog/backend/reviewer/prompts/issues_review/prompt.jinja+++ b/products/review_hog/backend/reviewer/prompts/issues_review/prompt.jinja@@ -35,7 +35,7 @@ Inline comments the pull request's author wrote, quoted verbatim — untrusted t{% if DIG_DEEPER %}Other review perspectives have ALREADY examined this same chunk in this review and reported the problems below. Your job now is to go DEEPER and surface real, high-value issues they MISSED — genuinely NEW problems, not restatements or minor rewordings of these. Do not re-report anything already covered here or in the inline comments above; if you find nothing new, return an empty issues list rather than padding.{% else %}-ReviewHog already surfaced these problems on this chunk's files in earlier reviews of this PR (some are low-priority and were never posted as inline comments, so they won't appear above). They are ALREADY COVERED: do not spend investigation time re-deriving them, and do not report them again. Surface only problems that are NOT already covered here or in the inline comments above.+PostHog Review already surfaced these problems on this chunk's files in earlier reviews of this PR (some are low-priority and were never posted as inline comments, so they won't appear above). They are ALREADY COVERED: do not spend investigation time re-deriving them, and do not report them again. Surface only problems that are NOT already covered here or in the inline comments above.{% endif %}{{COVERED_FINDINGS|safe}}diff --git a/products/review_hog/backend/reviewer/tests/test_publish_review.py b/products/review_hog/backend/reviewer/tests/test_publish_review.pyindex 4002c0e55409..50bea37cc834 100644--- a/products/review_hog/backend/reviewer/tests/test_publish_review.py+++ b/products/review_hog/backend/reviewer/tests/test_publish_review.py@@ -36,15 +36,12 @@ _SHOULD_FIX_PUBLISHED = published_priorities_for(IssuePriority.SHOULD_FIX)def _wire_readbacks(mock_paginated: MagicMock,reviews: list[dict[str, Any]] | None = None,- issue_comments: list[dict[str, Any]] | None = None,) -> None:- """Route the two idempotency readbacks: prior reviews (marker scan) and issue comments (promo scan)."""+ """Route the idempotency readback of prior reviews (marker scan)."""def paginated(path: str, **kwargs: Any):if path.endswith("/reviews"):return iter(reviews or [])- if "/issues/" in path:- return iter(issue_comments or [])raise AssertionError(f"Unexpected paginated path: {path}")mock_paginated.side_effect = paginated@@ -57,11 +54,6 @@ def _review_posts(mock_request: MagicMock) -> list[dict[str, Any]]:]-def _promo_posts(mock_request: MagicMock) -> list[dict[str, Any]]:- """The JSON payloads of every `POST .../issues/{n}/comments` the code issued."""- return [c.kwargs["json"] for c in mock_request.call_args_list if c.args[0] == "POST" and "/issues/" in c.args[1]]--def _commit_probes(mock_request: MagicMock) -> list[str]:"""The paths of every `GET .../commits/{sha}` pin probe the code issued."""return [c.args[1] for c in mock_request.call_args_list if c.args[0] == "GET" and "/commits/" in c.args[1]]@@ -84,9 +76,7 @@ class TestPostGithubReview:comments,token="install-token",head_sha="deadbeef",- post_promo=True,marker="m",- promo_marker="pm",)# The installation token (not an env PAT) authenticates every call.@@ -113,9 +103,7 @@ class TestPostGithubReview:comments,token="install-token",head_sha="",- post_promo=False,marker="m",- promo_marker="pm",)(payload,) = _review_posts(mock_request)@@ -125,9 +113,7 @@ class TestPostGithubReview:def test_no_head_sha_posts_without_commit_pin(self, mock_request: MagicMock, mock_paginated: MagicMock) -> None:_wire_readbacks(mock_paginated)- _post_github_review(- "o", "r", 1, "body", [], token="t", head_sha="", post_promo=True, marker="m", promo_marker="pm"- )+ _post_github_review("o", "r", 1, "body", [], token="t", head_sha="", marker="m")assert _commit_probes(mock_request) == [](payload,) = _review_posts(mock_request)@@ -146,29 +132,11 @@ class TestPostGithubReview:mock_request.side_effect = request# Must not raise — a stale/unreachable reviewed commit should still post the review unpinned.- _post_github_review(- "o", "r", 1, "body", [], token="t", head_sha="deadbeef", post_promo=False, marker="m", promo_marker="pm"- )+ _post_github_review("o", "r", 1, "body", [], token="t", head_sha="deadbeef", marker="m")(payload,) = _review_posts(mock_request)assert "commit_id" not in payload- def test_promo_comment_only_posted_when_requested(self, mock_request: MagicMock, mock_paginated: MagicMock) -> None:- _wire_readbacks(mock_paginated)-- _post_github_review(- "o", "r", 1, "body", [], token="t", head_sha="s", post_promo=False, marker="m", promo_marker="pm"- )- assert _promo_posts(mock_request) == []-- mock_request.reset_mock()- _post_github_review(- "o", "r", 1, "body", [], token="t", head_sha="s", post_promo=True, marker="m", promo_marker="pm"- )- (promo,) = _promo_posts(mock_request)- # The idempotency marker rides inside the posted comment body.- assert "pm" in promo["body"]-@parameterized.expand([("server_error", GitHubAPIError("GitHub API POST returned 500: boom", status=500)),@@ -191,9 +159,7 @@ class TestPostGithubReview:mock_request.side_effect = requestwith pytest.raises(type(error)):- _post_github_review(- "o", "r", 1, "body", comments, token="t", head_sha="", post_promo=False, marker="m", promo_marker="pm"- )+ _post_github_review("o", "r", 1, "body", comments, token="t", head_sha="", marker="m")(payload,) = _review_posts(mock_request) # exactly one attempt — no body-only fallback postassert payload["comments"] == comments@@ -228,9 +194,7 @@ class TestPostGithubReview:comments,token="t",head_sha="",- post_promo=False,marker="m",- promo_marker="pm",inline_body="m",)@@ -261,9 +225,7 @@ class TestPostGithubReview:comments,token="t",head_sha="",- post_promo=False,marker="m",- promo_marker="pm",inline_body="m",)_first, second = _review_posts(mock_request)@@ -300,16 +262,14 @@ class TestPostGithubReview:self, mock_request: MagicMock, mock_paginated: MagicMock) -> None:# Post-then-crash idempotency: an app-bot review already carrying this run's marker means we- # posted but didn't record the watermark, so the retry must post neither a second review nor- # the promo. (Only bot reviews count — a pasted marker in a human review must not match.)+ # posted but didn't record the watermark, so the retry must not post a second review.+ # (Only bot reviews count — a pasted marker in a human review must not match.)_wire_readbacks(mock_paginated,reviews=[{"body": "an earlier review\n\nmarker-xyz", "user": {"login": "posthog[bot]", "type": "Bot"}}],)- _post_github_review(- "o", "r", 1, "body", [], token="t", head_sha="s", post_promo=True, marker="marker-xyz", promo_marker="pm"- )+ _post_github_review("o", "r", 1, "body", [], token="t", head_sha="s", marker="marker-xyz")mock_request.assert_not_called()@@ -394,7 +354,6 @@ class TestPublishReviewGate:pr_files=pr_files,token="t",head_sha="sha",- post_promo=False,published_priorities=_SHOULD_FIX_PUBLISHED,)@@ -426,7 +385,6 @@ class TestPublishReviewGate:pr_files=[],token="t",head_sha="sha",- post_promo=False,published_priorities=_SHOULD_FIX_PUBLISHED,)@@ -467,7 +425,6 @@ class TestPublishReviewGate:pr_files=[],token="t",head_sha="sha",- post_promo=False,published_priorities=_SHOULD_FIX_PUBLISHED,)diff --git a/products/review_hog/backend/reviewer/tools/publish_review.py b/products/review_hog/backend/reviewer/tools/publish_review.pyindex 240036da62a8..c5d7bfcfb170 100644--- a/products/review_hog/backend/reviewer/tools/publish_review.py+++ b/products/review_hog/backend/reviewer/tools/publish_review.py@@ -90,7 +90,7 @@ def publish_persisted_review(The DB-driven publish path shared by the workflow's publish activity and the standalone`publish_review` management command — no recompute, no sandbox. Skips if this exact head was- already published (so a re-trigger / re-run can't double-post or re-fire the one-time promo),+ already published (so a re-trigger / re-run can't double-post),rebuilds the inline comments from this run's valid findings against the snapshot diff, and recordsthe published-head watermark only on a real post (a no-op turn must not block a later publish atthe same head). `urgency_threshold` gates which findings publish and is snapshotted on the report@@ -116,8 +116,6 @@ def publish_persisted_review(pr_files=pr_files,token=token,head_sha=head_sha,- # The alpha promo comment is posted once per report (first real publish), not every turn.- post_promo=report.published_head_sha is None,published_priorities=published_priorities_for(urgency_threshold),installation_id=installation_id,review_mode=review_mode,@@ -181,11 +179,6 @@ def _review_marker(report_id: str, head_sha: str, review_mode: str | None = Nonereturn f"<!-- reviewhog:published:{report_id}:{head_sha}{suffix} -->"-def _promo_marker(report_id: str) -> str:- """A hidden marker (HTML comment) embedded in the promo comment — posted once per report."""- return f"<!-- reviewhog:promo:{report_id} -->"--def publish_review(*,owner: str,@@ -197,7 +190,6 @@ def publish_review(pr_files: list[PRFile],token: str,head_sha: str,- post_promo: bool,published_priorities: set[IssuePriority],installation_id: str | None = None,review_mode: str = REVIEW_MODE_FULL,@@ -208,9 +200,7 @@ def publish_review(from this turn's valid finding/verdict rows (`run_index`-scoped, so a prior turn's findings arenever replayed), positioned against the PR's diff. `token` is the team's GitHub App installationtoken; `head_sha` pins the review to the exact reviewed commit so a force-push between review and- post can't misattribute comments. `post_promo` posts the one-time "PostHog Review alpha" feedback- comment (the caller passes it only on the first publish for the report, so it isn't re-posted- every turn). Reads the DB, so callers run it off the event loop.+ post can't misattribute comments. Reads the DB, so callers run it off the event loop.`posted` is False when there was nothing publishable — the caller records the published-headwatermark only on a real post, so a no-op turn doesn't block a later turn (with a valid finding)@@ -252,9 +242,7 @@ def publish_review(comments,token=token,head_sha=head_sha,- post_promo=post_promo,marker=marker,- promo_marker=_promo_marker(report_id),installation_id=installation_id,inline_body=inline_body,legacy_marker=_review_marker(report_id, head_sha),@@ -369,31 +357,6 @@ def _review_already_posted(return False-def _promo_already_posted(- owner: str, repo: str, pr_number: int, promo_marker: str, *, token: str, installation_id: str | None-) -> bool:- """True if the promo comment is already on the PR (posted on an attempt that later failed).-- The promo posts before the review, so a transient review-creation failure retries the whole- activity with `published_head_sha` still unset — without this check the retry would post the- promo a second time. Failure stakes invert versus the review readback: a duplicate promo is- spam while a missing one is harmless, so an unreadable comment list counts as already posted.- """- try:- return any(- promo_marker in (comment.get("body") or "")- for comment in github_api_get_paginated(- f"/repos/{owner}/{repo}/issues/{pr_number}/comments",- token=token,- installation_id=installation_id,- endpoint="/repos/{owner}/{repo}/issues/{issue_number}/comments",- )- )- except (GitHubAPIError, GitHubRateLimitError) as e:- logger.warning(f"Could not read issue comments to check promo idempotency: {e}. Skipping the promo.")- return True--def _code_span(text: str) -> str:"""`text` as a Markdown code span whose fence is longer than any backtick run inside it."""longest_run = max((len(run) for run in re.findall(r"`+", text)), default=0)@@ -437,9 +400,7 @@ def _post_github_review(*,token: str,head_sha: str,- post_promo: bool,marker: str,- promo_marker: str,installation_id: str | None = None,inline_body: str | None = None,legacy_marker: str | None = None,@@ -468,23 +429,6 @@ def _post_github_review(logger.info(f"Review for {owner}/{repo}#{pr_number} at {head_sha[:12]} already on PR (marker found); skipping")return None- if post_promo and not _promo_already_posted(- owner, repo, pr_number, promo_marker, token=token, installation_id=installation_id- ):- github_api_request(- "POST",- f"/repos/{owner}/{repo}/issues/{pr_number}/comments",- token=token,- installation_id=installation_id,- endpoint="/repos/{owner}/{repo}/issues/{issue_number}/comments",- json={- "body": "PostHog Review alpha \U0001f994 "- "If you find any issues helpful - "- 'please reply "valid", "invalid", etc., '- f"for evaluation purposes \U0001f64f\n\n{promo_marker}"- },- )-# Pin the review to the exact commit we reviewed; without it GitHub posts against the PR's latest# head, so a force-push between review and post would misplace the inline comments. Best-effort:# the probe isolates an unresolvable commit (stale/unreachable head) from a comment-positioningdiff --git a/products/review_hog/backend/temporal/activities.py b/products/review_hog/backend/temporal/activities.pyindex f0cca50ccaa1..3d438d65f525 100644--- a/products/review_hog/backend/temporal/activities.py+++ b/products/review_hog/backend/temporal/activities.py@@ -38,7 +38,7 @@ from products.review_hog.backend.automatic_reviews import automatic_flash_allowefrom products.review_hog.backend.models import ReviewProjectSettings, ReviewReport, ReviewUserSettingsfrom products.review_hog.backend.pr_owner import PullRequestOwnerResolverfrom products.review_hog.backend.preferences import ReviewPreferences-from products.review_hog.backend.pull_request_events import has_skip_agent_review_label+from products.review_hog.backend.pull_request_events import REVIEW_LABELS, has_skip_agent_review_labelfrom products.review_hog.backend.review_request_rules import ResolutionGate, ReviewRequestRefusal, full_review_publishedfrom products.review_hog.backend.reviewer.constants import (ALREADY_RAISED_SHOWN,@@ -1898,24 +1898,27 @@ async def publish_review_activity(input: PublishInput) -> PublishResult:def _remove_trigger_label(input: RemoveTriggerLabelInput) -> None:token, installation_id = _installation_auth(input.team_id, f"{input.owner}/{input.repo}")- try:- github_api_request(- "DELETE",- f"/repos/{input.owner}/{input.repo}/issues/{input.pr_number}/labels/reviewhog",- token=token,- endpoint="/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}",- installation_id=installation_id,- )- except GitHubAPIError as error:- if error.status != 404:- raise+ # The run does not know which label started it, and a label added during the run joins it, so the+ # run removes every review label.+ for label in sorted(REVIEW_LABELS):+ try:+ github_api_request(+ "DELETE",+ f"/repos/{input.owner}/{input.repo}/issues/{input.pr_number}/labels/{label}",+ token=token,+ endpoint="/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}",+ installation_id=installation_id,+ )+ except GitHubAPIError as error:+ if error.status != 404:+ raise@activity.defn@scoped_temporal()@close_db_connectionsasync def remove_trigger_label_activity(input: RemoveTriggerLabelInput) -> None:- """Remove the label that started a label-triggered review, if it is still present."""+ """Remove the review labels that started a label-triggered review, if they are still present."""await database_sync_to_async(_remove_trigger_label, thread_sensitive=False)(input)diff --git a/products/review_hog/backend/tests/test_automatic_reviews.py b/products/review_hog/backend/tests/test_automatic_reviews.pyindex 4c6a4512b88b..2c53da996595 100644--- a/products/review_hog/backend/tests/test_automatic_reviews.py+++ b/products/review_hog/backend/tests/test_automatic_reviews.py@@ -82,7 +82,7 @@ def _payload(def _label_payload(- *, label: str = "reviewhog", sender: str = "OctoCat", sender_type: str = "User", login: str = "OctoCat"+ *, label: str = "posthog-review", sender: str = "OctoCat", sender_type: str = "User", login: str = "OctoCat") -> dict[str, object]:return {**_payload(action="labeled", login=login),@@ -220,16 +220,17 @@ class TestAuthoredPRWebhook(SimpleTestCase):@parameterized.expand([- ("person_adds_the_label", "reviewhog", "OctoCat", "User", True),- ("label_name_ignores_case", "ReviewHog", "OctoCat", "User", True),+ ("person_adds_the_label", "posthog-review", "OctoCat", "User", True),+ ("person_adds_the_legacy_label", "reviewhog", "OctoCat", "User", True),+ ("label_name_ignores_case", "PostHog-Review", "OctoCat", "User", True),# The task explains the refusal on the pull request and removes the label.- ("bot_adds_the_label", "reviewhog", "renovate[bot]", "Bot", True),+ ("bot_adds_the_label", "posthog-review", "renovate[bot]", "Bot", True),("another_label", "bug", "OctoCat", "User", False),])@patch(_QUEUE)@patch(_LABEL_QUEUE)- def test_the_reviewhog_label_queues_a_label_review(+ def test_a_review_label_queues_a_label_review(self,_name: str,label: str,@@ -509,9 +510,15 @@ class TestLabelReviewTask(BaseTest):trigger_source="label",)- @parameterized.expand([("another_bot", "renovate[bot]", False), ("stamphog_hands_off", "stamphog[bot]", True)])- def test_only_stamphog_may_label_as_a_bot(self, _name: str, sender: str, starts: bool) -> None:- self._run(_label_payload(sender=sender, sender_type="Bot"))+ @parameterized.expand(+ [+ ("another_bot", "posthog-review", "renovate[bot]", False),+ ("another_bot_legacy_label", "reviewhog", "renovate[bot]", False),+ ("stamphog_hands_off", "posthog-review", "stamphog[bot]", True),+ ]+ )+ def test_only_stamphog_may_label_as_a_bot(self, _name: str, label: str, sender: str, starts: bool) -> None:+ self._run(_label_payload(label=label, sender=sender, sender_type="Bot"))assert self.start.called == startscalls = [(call.args[0], call.args[1]) for call in self.github.call_args_list]@@ -519,6 +526,7 @@ class TestLabelReviewTask(BaseTest):assert calls == []else:assert calls == [+ ("DELETE", "/repos/PostHog/posthog/issues/42/labels/posthog-review"),("DELETE", "/repos/PostHog/posthog/issues/42/labels/reviewhog"),("POST", "/repos/PostHog/posthog/issues/42/comments"),]@@ -527,7 +535,14 @@ class TestLabelReviewTask(BaseTest):queued = self._queued_event(_label_payload(sender="renovate[bot]", sender_type="Bot"))gone = GitHubAPIError("gone", status=404)# The second POST fails after GitHub stored the comment, so the third run finds it and skips.- self.github.side_effect = [GitHubAPIError("boom", status=502), gone, GitHubAPIError("boom", status=502), gone]+ self.github.side_effect = [+ GitHubAPIError("boom", status=502),+ gone,+ gone,+ GitHubAPIError("boom", status=502),+ gone,+ gone,+ ]posted = {"body": BOT_LABEL_COMMENT, "user": {"login": "posthog[bot]", "type": "Bot"}}self.github_comments.side_effect = [[], [posted]]@@ -537,7 +552,7 @@ class TestLabelReviewTask(BaseTest):process_label_event.run(**queued)calls = [call.args[0] for call in self.github.call_args_list]- assert calls == ["DELETE", "DELETE", "POST", "DELETE"]+ assert calls == ["DELETE", "DELETE", "DELETE", "POST", "DELETE", "DELETE"]self.start.assert_not_called()@parameterized.expand(diff --git a/products/review_hog/backend/tests/test_installation_auth.py b/products/review_hog/backend/tests/test_installation_auth.pyindex 13b88b3a53e9..3aae48d2f49f 100644--- a/products/review_hog/backend/tests/test_installation_auth.py+++ b/products/review_hog/backend/tests/test_installation_auth.py@@ -56,16 +56,13 @@ class TestInstallationAuth(BaseTest):class TestRemoveTriggerLabel:@patch("products.review_hog.backend.temporal.activities._installation_auth", return_value=("tok", "inst"))@patch("products.review_hog.backend.temporal.activities.github_api_request")- def test_deletes_the_reviewhog_label(self, request: MagicMock, _auth: MagicMock) -> None:+ def test_deletes_every_review_label(self, request: MagicMock, _auth: MagicMock) -> None:_remove_trigger_label(RemoveTriggerLabelInput(team_id=1, owner="PostHog", repo="posthog", pr_number=7))- request.assert_called_once_with(- "DELETE",- "/repos/PostHog/posthog/issues/7/labels/reviewhog",- token="tok",- endpoint="/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}",- installation_id="inst",- )+ assert [call.args for call in request.call_args_list] == [+ ("DELETE", "/repos/PostHog/posthog/issues/7/labels/posthog-review"),+ ("DELETE", "/repos/PostHog/posthog/issues/7/labels/reviewhog"),+ ]@patch("products.review_hog.backend.temporal.activities._installation_auth", return_value=("tok", "inst"))@patch(diff --git a/products/review_hog/backend/tests/test_publish_idempotency.py b/products/review_hog/backend/tests/test_publish_idempotency.pyindex bc82051208af..5b517605636b 100644--- a/products/review_hog/backend/tests/test_publish_idempotency.py+++ b/products/review_hog/backend/tests/test_publish_idempotency.py@@ -22,8 +22,6 @@ from products.review_hog.backend.reviewer.persistence import upsert_review_reporfrom products.review_hog.backend.reviewer.tools.github_client import GitHubAPIErrorfrom products.review_hog.backend.reviewer.tools.publish_review import (PublishOutcome,- _promo_already_posted,- _promo_marker,_review_already_posted,_review_marker,)@@ -56,11 +54,6 @@ def _review_posted(marker: str, reviews: list[dict[str, Any]], *, boom: bool = Freturn _review_already_posted("o", "r", 1, marker, token="t", installation_id=None)-def _promo_posted(marker: str, comments: list[dict[str, Any]], *, boom: bool = False) -> bool:- with patch(_PAGINATED, side_effect=_paginated(comments, boom=boom)):- return _promo_already_posted("o", "r", 1, marker, token="t", installation_id=None)--def test_review_already_posted_detects_our_own_markered_review() -> None:# Post-then-crash backstop: a review we posted (an app-bot review) carries this run's marker, so# a retry recognizes it and skips. A review without the marker (another turn/author) must not@@ -124,20 +117,6 @@ def test_legacy_markers_only_suppress_reviews_in_the_same_mode(posted_mode: str,) is (posted_mode == requested_mode)-def test_promo_already_posted_detects_the_markered_comment() -> None:- # The promo posts before the review, so a retry after a transient review failure re-enters- # with published_head_sha still unset — the marker is what stops a second promo comment.- marker = _promo_marker("rep-1")- assert _promo_posted(marker, [{"body": f"promo text\n\n{marker}"}]) is True- assert _promo_posted(marker, [{"body": "unrelated comment"}, {"body": None}]) is False---def test_promo_already_posted_skips_when_readback_fails() -> None:- # Inverted stakes vs the review readback: a duplicate promo is spam while a missing one is- # harmless, so an unreadable comment list counts as already posted.- assert _promo_posted(_promo_marker("rep-1"), [], boom=True) is True--def _publish_input(team_id: int, report_id: str, head_sha: str) -> PublishInput:return PublishInput(team_id=team_id,@@ -227,12 +206,11 @@ class TestPublishIdempotency(BaseTest):@patch(_PUBLISH)@patch(_SNAPSHOT, return_value=None)@patch(_AUTH, return_value=("tok", "9876543"))- def test_first_publish_posts_promo_and_records_watermark(self, _auth, _snapshot, mock_publish) -> None:+ def test_first_publish_records_watermark(self, _auth, _snapshot, mock_publish) -> None:mock_publish.return_value = PublishOutcome(posted=True)report_id = self._report()_publish(_publish_input(self.team.id, report_id, "sha1"))assert mock_publish.call_count == 1- assert mock_publish.call_args.kwargs["post_promo"] is True# The resolved installation id must reach the GitHub calls — dropping it silently turns the# publish identity-blind (no egress budget accounting).assert mock_publish.call_args.kwargs["installation_id"] == "9876543"@@ -260,12 +238,11 @@ class TestPublishIdempotency(BaseTest):@patch(_PUBLISH)@patch(_SNAPSHOT, return_value=None)@patch(_AUTH, return_value=("tok", None))- def test_new_head_publishes_without_promo(self, _auth, _snapshot, mock_publish) -> None:+ def test_new_head_publishes(self, _auth, _snapshot, mock_publish) -> None:mock_publish.return_value = PublishOutcome(posted=True)report_id = self._report(published_head_sha="oldsha")_publish(_publish_input(self.team.id, report_id, "sha2"))assert mock_publish.call_count == 1- assert mock_publish.call_args.kwargs["post_promo"] is Falseassert ReviewReport.objects.for_team(self.team.id).get(id=report_id).published_head_sha == "sha2"@patch(_PUBLISH)diff --git a/products/review_hog/frontend/generated/api.schemas.ts b/products/review_hog/frontend/generated/api.schemas.tsindex 08046cc12fcb..5d121aeb18db 100644--- a/products/review_hog/frontend/generated/api.schemas.ts+++ b/products/review_hog/frontend/generated/api.schemas.ts@@ -1543,7 +1543,7 @@ export interface ReviewUserSettingsApi {* * `flash` - On everywhere* * `off` - Off everywhere */default_review_mode?: DefaultReviewModeEnumApi- /** Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets its first automatic review when it is marked ready for review. Applies to automatic reviews only: the reviewhog label, an @posthog review comment, and the Review button still review drafts. */+ /** Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets its first automatic review when it is marked ready for review. Applies to automatic reviews only: the posthog-review label, an @posthog review comment, and the Review button still review drafts. */review_drafts?: boolean/** After a Deep review of the user's pull requests is published, run the resolution stage: triage the unresolved review threads, implement the worth-and-safe fixes on the PR branch, and reply on every thread. Off by default. Personal only: no project default applies. */resolve_comments?: boolean@@ -1555,7 +1555,7 @@ export interface ReviewUserSettingsApi {urgency_threshold?: UrgencyThresholdEnumApi/** Show a fun image in the review comment when a Deep review of the user's pull requests finds nothing to raise. Without the user's own value the project default applies. */celebrate_clean_reviews?: boolean- /** Review the pull requests the agent opens for Inbox reports assigned to the user: ReviewHog reviews each one and posts its findings to the pull request. Off by default. */+ /** Review the pull requests the agent opens for Inbox reports assigned to the user: PostHog Review reviews each one and posts its findings to the pull request. Off by default. */review_inbox_prs?: boolean/** Also have hosted Stamphog review those same Inbox pull requests: an approve-first review that posts a real GitHub approval when the change passes, and a comment when it doesn't. Only takes effect when the project has a synced, enabled Stamphog repository (see stamphog_connected). */stamphog_review_inbox_prs?: boolean@@ -1574,7 +1574,7 @@ export interface PatchedReviewUserSettingsApi {* * `flash` - On everywhere* * `off` - Off everywhere */default_review_mode?: DefaultReviewModeEnumApi- /** Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets its first automatic review when it is marked ready for review. Applies to automatic reviews only: the reviewhog label, an @posthog review comment, and the Review button still review drafts. */+ /** Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets its first automatic review when it is marked ready for review. Applies to automatic reviews only: the posthog-review label, an @posthog review comment, and the Review button still review drafts. */review_drafts?: boolean/** After a Deep review of the user's pull requests is published, run the resolution stage: triage the unresolved review threads, implement the worth-and-safe fixes on the PR branch, and reply on every thread. Off by default. Personal only: no project default applies. */resolve_comments?: boolean@@ -1586,7 +1586,7 @@ export interface PatchedReviewUserSettingsApi {urgency_threshold?: UrgencyThresholdEnumApi/** Show a fun image in the review comment when a Deep review of the user's pull requests finds nothing to raise. Without the user's own value the project default applies. */celebrate_clean_reviews?: boolean- /** Review the pull requests the agent opens for Inbox reports assigned to the user: ReviewHog reviews each one and posts its findings to the pull request. Off by default. */+ /** Review the pull requests the agent opens for Inbox reports assigned to the user: PostHog Review reviews each one and posts its findings to the pull request. Off by default. */review_inbox_prs?: boolean/** Also have hosted Stamphog review those same Inbox pull requests: an approve-first review that posts a real GitHub approval when the change passes, and a comment when it doesn't. Only takes effect when the project has a synced, enabled Stamphog repository (see stamphog_connected). */stamphog_review_inbox_prs?: booleandiff --git a/products/review_hog/frontend/generated/api.ts b/products/review_hog/frontend/generated/api.tsindex 5c5397459db7..95214cb72e3b 100644--- a/products/review_hog/frontend/generated/api.ts+++ b/products/review_hog/frontend/generated/api.ts@@ -233,7 +233,7 @@ export const getReviewHogProjectSettingsRetrieveUrl = (projectId: string) => {/*** The project rule for automatic Standard reviews, bot pull requests, the Deep review defaults, and the connected GitHub installations.- * @summary Get the project's ReviewHog rule+ * @summary Get the project's code review rule*/export const reviewHogProjectSettingsRetrieve = async (projectId: string,@@ -251,7 +251,7 @@ export const getReviewHogProjectSettingsPartialUpdateUrl = (projectId: string) =/*** Partially update the project rule. Only the provided fields change. Project admins only.- * @summary Update the project's ReviewHog rule+ * @summary Update the project's code review rule*/export const reviewHogProjectSettingsPartialUpdate = async (projectId: string,@@ -559,7 +559,7 @@ export const getReviewHogReviewsListUrl = (projectId: string, params?: ReviewHog}/**- * Recent ReviewHog reviews on this project: actively running reviews first (with the in-flight turn's stage), then the most recent completed ones — at most `limit` rows (default 5), plus `has_more` for whether a larger `limit` would reveal more. By default only the requesting user's reviews; `scope=everyone` lists every review on the project.+ * Recent code reviews on this project: actively running reviews first (with the in-flight turn's stage), then the most recent completed ones — at most `limit` rows (default 5), plus `has_more` for whether a larger `limit` would reveal more. By default only the requesting user's reviews; `scope=everyone` lists every review on the project.* @summary List recent reviews*/export const reviewHogReviewsList = async (@@ -594,7 +594,7 @@ export const getReviewHogReviewsRetrieveUrl = (}/**- * One completed ReviewHog review on this project, with one turn's validated findings, the findings the validator dismissed (and why), and the review body published to GitHub. The latest completed turn by default; `run_index` reads an older one. `in_progress`, `progress`, and the resolution fields describe the report now, whatever the turn. Project-wide, so reviews listed under `scope=everyone` can be opened too.+ * One completed code review on this project, with one turn's validated findings, the findings the validator dismissed (and why), and the review body published to GitHub. The latest completed turn by default; `run_index` reads an older one. `in_progress`, `progress`, and the resolution fields describe the report now, whatever the turn. Project-wide, so reviews listed under `scope=everyone` can be opened too.* @summary Retrieve one review's detail*/export const reviewHogReviewsRetrieve = async (@@ -663,7 +663,7 @@ export const getReviewHogReviewsPrStatusRetrieveUrl = (}/**- * Where a pull request's ReviewHog runs stand: `state`, the latest completed review turn, and the latest Resolve run. Works for any pull request on the project, also ones the caller did not trigger. Pass the `requested_at` and `head_sha` the trigger returned, and the `run_mode` it was called with, to get `request_outcome`, which says when that request is done.+ * Where a pull request's review runs stand: `state`, the latest completed review turn, and the latest Resolve run. Works for any pull request on the project, also ones the caller did not trigger. Pass the `requested_at` and `head_sha` the trigger returned, and the `run_mode` it was called with, to get `request_outcome`, which says when that request is done.* @summary Look up a pull request's review status*/export const reviewHogReviewsPrStatusRetrieve = async (@@ -697,7 +697,7 @@ export const getReviewHogReviewsTableRetrieveUrl = (}/**- * ReviewHog reviews on this project as a paginated table: reviews with a completed turn plus reviews with a run in flight, ordered by last activity, so a review that starts or finishes moves to the top. Pages with `limit` and `offset`; `count` is the total across pages. Filters by `repository`, `review_mode`, `status`, and `published`. `running_count` counts the running reviews under every filter except `status`. By default only the requesting user's reviews; `scope=everyone` lists every review on the project.+ * Code reviews on this project as a paginated table: reviews with a completed turn plus reviews with a run in flight, ordered by last activity, so a review that starts or finishes moves to the top. Pages with `limit` and `offset`; `count` is the total across pages. Filters by `repository`, `review_mode`, `status`, and `published`. `running_count` counts the running reviews under every filter except `status`. By default only the requesting user's reviews; `scope=everyone` lists every review on the project.* @summary List reviews as a paginated table*/export const reviewHogReviewsTableRetrieve = async (@@ -716,7 +716,7 @@ export const getReviewHogReviewsTriggerCreateUrl = (projectId: string) => {}/**- * Start a ReviewHog review of any pull request the project's GitHub App installation can access, and publish it back to the PR. The run appears under the requesting user's recent reviews. A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: 'review' is a Deep review that chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously. A PR whose current commit already has a published review in the requested mode returns 'already_reviewed' without starting a run (resolve_only skips that check, because settling threads on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and whether resolution will run, while the run executes in the worker.+ * Start a PostHog Review run on any pull request the project's GitHub App installation can access, and publish it back to the PR. The run appears under the requesting user's recent reviews. A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: 'review' is a Deep review that chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously. A PR whose current commit already has a published review in the requested mode returns 'already_reviewed' without starting a run (resolve_only skips that check, because settling threads on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and whether resolution will run, while the run executes in the worker.* @summary Start a review of a pull request*/export const reviewHogReviewsTriggerCreate = async (@@ -737,8 +737,8 @@ export const getReviewHogSettingsRetrieveUrl = (projectId: string) => {}/**- * Fetch the requesting user's effective ReviewHog preferences for this project, and where each value comes from.- * @summary Get the user's ReviewHog settings+ * Fetch the requesting user's effective code review preferences for this project, and where each value comes from.+ * @summary Get the user's code review settings*/export const reviewHogSettingsRetrieve = async (projectId: string,@@ -755,8 +755,8 @@ export const getReviewHogSettingsPartialUpdateUrl = (projectId: string) => {}/**- * Partially update the requesting user's ReviewHog preferences for this project. Only the provided fields change. A value equal to the inherited one clears the user's own value.- * @summary Update the user's ReviewHog settings+ * Partially update the requesting user's code review preferences for this project. Only the provided fields change. A value equal to the inherited one clears the user's own value.+ * @summary Update the user's code review settings*/export const reviewHogSettingsPartialUpdate = async (projectId: string,diff --git a/products/review_hog/frontend/generated/api.zod.ts b/products/review_hog/frontend/generated/api.zod.tsindex 29007b352c3e..4bd0238ef7af 100644--- a/products/review_hog/frontend/generated/api.zod.ts+++ b/products/review_hog/frontend/generated/api.zod.ts@@ -68,7 +68,7 @@ export const ReviewHogPerspectivesPartialUpdateBody = /* @__PURE__ */ zod.object/*** Partially update the project rule. Only the provided fields change. Project admins only.- * @summary Update the project's ReviewHog rule+ * @summary Update the project's code review rule*/export const ReviewHogProjectSettingsPartialUpdateBody = /* @__PURE__ */ zod.object({flash_for: zod@@ -213,7 +213,7 @@ export const ReviewHogResolutionPartialUpdateBody = /* @__PURE__ */ zod.object({})/**- * Start a ReviewHog review of any pull request the project's GitHub App installation can access, and publish it back to the PR. The run appears under the requesting user's recent reviews. A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: 'review' is a Deep review that chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously. A PR whose current commit already has a published review in the requested mode returns 'already_reviewed' without starting a run (resolve_only skips that check, because settling threads on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and whether resolution will run, while the run executes in the worker.+ * Start a PostHog Review run on any pull request the project's GitHub App installation can access, and publish it back to the PR. The run appears under the requesting user's recent reviews. A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: 'review' is a Deep review that chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously. A PR whose current commit already has a published review in the requested mode returns 'already_reviewed' without starting a run (resolve_only skips that check, because settling threads on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and whether resolution will run, while the run executes in the worker.* @summary Start a review of a pull request*/export const reviewHogReviewsTriggerCreateBodyRunModeDefault = `review`@@ -236,8 +236,8 @@ export const ReviewHogReviewsTriggerCreateBody = /* @__PURE__ */ zod.object({})/**- * Partially update the requesting user's ReviewHog preferences for this project. Only the provided fields change. A value equal to the inherited one clears the user's own value.- * @summary Update the user's ReviewHog settings+ * Partially update the requesting user's code review preferences for this project. Only the provided fields change. A value equal to the inherited one clears the user's own value.+ * @summary Update the user's code review settings*/export const ReviewHogSettingsPartialUpdateBody = /* @__PURE__ */ zod.object({default_review_mode: zod@@ -251,7 +251,7 @@ export const ReviewHogSettingsPartialUpdateBody = /* @__PURE__ */ zod.object({.boolean().optional().describe(- "Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets its first automatic review when it is marked ready for review. Applies to automatic reviews only: the reviewhog label, an @posthog review comment, and the Review button still review drafts."+ "Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets its first automatic review when it is marked ready for review. Applies to automatic reviews only: the posthog-review label, an @posthog review comment, and the Review button still review drafts."),resolve_comments: zod.boolean()@@ -276,7 +276,7 @@ export const ReviewHogSettingsPartialUpdateBody = /* @__PURE__ */ zod.object({.boolean().optional().describe(- 'Review the pull requests the agent opens for Inbox reports assigned to the user: ReviewHog reviews each one and posts its findings to the pull request. Off by default.'+ 'Review the pull requests the agent opens for Inbox reports assigned to the user: PostHog Review reviews each one and posts its findings to the pull request. Off by default.'),stamphog_review_inbox_prs: zod.boolean()diff --git a/products/review_hog/frontend/settings/DeepArea.tsx b/products/review_hog/frontend/settings/DeepArea.tsxindex 5f9b2ae993d9..a264b5b606cb 100644--- a/products/review_hog/frontend/settings/DeepArea.tsx+++ b/products/review_hog/frontend/settings/DeepArea.tsx@@ -7,10 +7,10 @@ export function DeepArea(): JSX.Element {<section className="flex flex-col gap-3 border-t border-primary pt-6"><AreaHeader title="Deep" subtitle="only when someone asks"><p className="m-0 text-sm">- Deep is a longer review for changes that need extra care: the Review button, the reviewhog label, or- an Inbox report assigned to you. It adds the perspectives, quality bar and threshold you pick here,- and can fix review comments on your branch if you turn Resolve on. It takes longer and costs several- times more than Standard.+ Deep is a longer review for changes that need extra care: the Review button, the posthog-review+ label, or an Inbox report assigned to you. It adds the perspectives, quality bar and threshold you+ pick here, and can fix review comments on your branch if you turn Resolve on. It takes longer and+ costs several times more than Standard.</p><p className="m-0 text-xs text-secondary">Everything in this area applies only to Deep reviews. A review someone else starts on your PR usesdiff --git a/products/review_hog/manifest.tsx b/products/review_hog/manifest.tsxindex b058fdb9da0f..ae6438738edc 100644--- a/products/review_hog/manifest.tsx+++ b/products/review_hog/manifest.tsx@@ -13,7 +13,6 @@ export const manifest: ProductManifest = {projectBased: true,description: 'Automated code reviews of your pull requests, and your review agent settings.',iconType: 'code_review',- docsHref: 'https://posthog.com/docs/posthog-desktop/code-review',},},routes: {diff --git a/products/review_hog/mcp/tools.yaml b/products/review_hog/mcp/tools.yamlindex 93324c679ac1..1e3d7f91a0b9 100644--- a/products/review_hog/mcp/tools.yaml+++ b/products/review_hog/mcp/tools.yaml@@ -2,7 +2,7 @@# List operations without an entry: pnpm --filter=@posthog/mcp run scaffold-yaml -- --candidates --product review_hog# Add one: pnpm --filter=@posthog/mcp run scaffold-yaml -- --add <operationId> --product review_hog# To keep an operation off on purpose, set enabled: false and give a disabled_reason.-category: ReviewHog+category: PostHog Reviewfeature: review_hogurl_prefix: /code-reviewui_apps: {}@@ -16,10 +16,10 @@ tools:readOnly: truedestructive: falseidempotent: true- title: Get a ReviewHog review+ title: Get a code reviewdescription: >- Fetch one ReviewHog review by `id` (from `review-hog-reviews-list` or the trigger's `report_id`). It returns- the last completed turn: its validated `findings` (each with file, line ranges, priority, and the suggested+ Fetch one code review by `id` (from `review-hog-reviews-list` or the trigger's `report_id`). It returns the+ last completed turn: its validated `findings` (each with file, line ranges, priority, and the suggestedfix), the `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR.While a re-review runs, the findings are still the previous turn's. A first review that is still running hasno detail yet, so poll `review-hog-reviews-list` until it completes.@@ -34,10 +34,10 @@ tools:destructive: falseidempotent: truelist: true- title: List ReviewHog reviews+ title: List code reviewsdescription: >- List recent ReviewHog reviews on this project. Use it to poll a review's status. Running reviews come first,- each with `in_progress: true` and a `progress` object (the running turn's `review_stage` plus `done`/`total`+ List recent code reviews on this project. Use it to poll a review's status. Running reviews come first, each+ with `in_progress: true` and a `progress` object (the running turn's `review_stage` plus `done`/`total`counters). Completed reviews follow, newest first, with their finding counts by priority (`must_fix_count`,`should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id` opens the fullreview with `review-hog-reviews-get`. The default `scope=mine` covers reviews you ran plus reviews of pull@@ -52,9 +52,9 @@ tools:readOnly: truedestructive: falseidempotent: true- title: Get a pull request's ReviewHog status+ title: Get a pull request's review statusdescription: >- Look up where a pull request's ReviewHog runs stand, by `pr_url`. Works for any PR on the project, also ones+ Look up where a pull request's review runs stand, by `pr_url`. Works for any PR on the project, also onesyou did not trigger. `state` is `not_reviewed`, `queued`, `reviewing`, `resolving`, `idle`, or `unknown`.`latest_review` sums up the latest completed turn (its `id`, `run_index`, `review_mode`, `head_sha` andfinding counts by priority), and `latest_resolution` the latest Resolve run. The loop for a run you started:@@ -74,9 +74,9 @@ tools:readOnly: falsedestructive: falseidempotent: false- title: Trigger a ReviewHog review+ title: Trigger a code reviewdescription: >- Start a ReviewHog run on a pull request. Pass the PR as `pr_url` (e.g.+ Start a PostHog Review run on a pull request. Pass the PR as `pr_url` (e.g.`https://github.com/PostHog/posthog/pull/123`). The repository must be accessible to the project's GitHubApp installation. `run_mode` picks the variant: `review` (the default) is a Deep review, published to thePR, followed by the Resolve stage; `review_only` is a Deep review without Resolve; `flash` is a Standarddiff --git a/products/stamphog/AGENTS.md b/products/stamphog/AGENTS.mdindex 170991476c95..07454cf2f42b 100644--- a/products/stamphog/AGENTS.md+++ b/products/stamphog/AGENTS.md@@ -171,7 +171,7 @@ narrow:- These runs bypass the review-mode and author-write-permission gates: the reviewers' toggle isthe gate, and the App's machine user is not a collaborator (the permission lookup would alwaysdeny). `review_mode` keeps governing human PRs only.-- A refused or escalated verdict hands the PR to ReviewHog (`post_verdict` adds the `reviewhog`+- A refused or escalated verdict hands the PR to ReviewHog (`post_verdict` adds the `posthog-review`label) **only** for these runs. A human author reads their own refusal and decides what comes next.A self-driving PR has no such author, and its refusal otherwise sits unread until Inbox triage.In ALL mode an unconditional handoff also fires a second bot review on every PR the repo opens.diff --git a/products/stamphog/backend/logic/github_client.py b/products/stamphog/backend/logic/github_client.pyindex 11a4989c710b..4e366bceacc5 100644--- a/products/stamphog/backend/logic/github_client.py+++ b/products/stamphog/backend/logic/github_client.py@@ -1354,7 +1354,7 @@ class StamphogGitHubClient:"""Add a label to a PR (``POST .../issues/{number}/labels``).A 404 (repo not found) or 422 (label does not exist on the repo) is swallowed, so a vendored- stamphog in another repo never raises over a label — e.g. ``reviewhog`` — that isn't set up+ stamphog in another repo never raises over a label — e.g. ``posthog-review`` — that isn't set upthere. Any other non-success raises ``StamphogGitHubError``; see ``post_verdict`` for how theReviewHog handoff caller treats that as best-effort."""diff --git a/products/stamphog/backend/temporal/constants.py b/products/stamphog/backend/temporal/constants.pyindex 3291a60b8293..42a4dad150a0 100644--- a/products/stamphog/backend/temporal/constants.py+++ b/products/stamphog/backend/temporal/constants.py@@ -41,7 +41,7 @@ STAMPHOG_BOT_REVIEW_MAX_POLLS = 10 # ~300s budget at 30s per poll, matching the# The GitHub label Stamphog adds to hand a refused/escalated PR to ReviewHog. ReviewHog's `labeled`# webhook consumer starts a review for it (stamphog[bot] is the one bot it accepts as a labeler).# Kept here so the activity references the same scalar ReviewHog gates on.-STAMPHOG_REVIEWHOG_LABEL = "reviewhog"+STAMPHOG_REVIEWHOG_LABEL = "posthog-review"# The owners-yaml resolver package, expected by the engine as a sibling of its own dir# (gates.py resolves `../owners` for the hogli-resolver ownership format). This stays a sibling of# the engine dir although the monorepo source moved to packages/owners-yaml, because downstream reposdiff --git a/products/stamphog/backend/tests/test_integration.py b/products/stamphog/backend/tests/test_integration.pyindex b8ff63e4df86..8b31ddc860cc 100644--- a/products/stamphog/backend/tests/test_integration.py+++ b/products/stamphog/backend/tests/test_integration.py@@ -283,7 +283,7 @@ def test_signed_webhook_drives_review_and_posts_approval(team, stamphog_chain: Sassert len(additions) == 1assert [r["reaction_id"] for r in removals] == [additions[0]["id"]]- # An APPROVED verdict never hands off to ReviewHog — the reviewhog label is a refusal-only signal.+ # An APPROVED verdict never hands off to ReviewHog — the posthog-review label is a refusal-only signal.assert [w for w in recorder.github_writes if w["kind"] == "add_label"] == []@@ -1811,7 +1811,7 @@ def test_refused_verdict_hands_off_to_reviewhog_only_when_self_driving(run.refresh_from_db()assert run.verdict == ReviewVerdict.REFUSEDlabel_adds = [w for w in stamphog_chain.recorder.github_writes if w["kind"] == "add_label"]- expected = [{"kind": "add_label", "repo": REPO, "number": 101, "labels": ["reviewhog"]}]+ expected = [{"kind": "add_label", "repo": REPO, "number": 101, "labels": ["posthog-review"]}]assert label_adds == (expected if expect_handoff else [])@@ -1873,7 +1873,7 @@ def test_superseded_refusal_does_not_hand_off_to_reviewhog(team, stamphog_chain:# The ReviewHog handoff runs AFTER the conditional terminal save, so a refusal that loses the save# to a supersession (a synchronize/re-review delivery landing between the head guard and the save)# must not trigger ReviewHog for the stale refusal — a newer run may approve the same head. The run- # returns skipped_superseded and the reviewhog label is never added. The run carries inbox+ # returns skipped_superseded and the posthog-review label is never added. The run carries inbox# provenance so the supersession is what blocks the handoff, not the self-driving-only condition.repo_config = _repo_config(team.id)head_sha = "sha-refused-superseded"diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 9627b3c86a4a..2c4b775a5bf4 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -11021,11 +11021,11 @@"feature_flag": "notebook-generated-widgets"},"review-hog-reviews-get": {- "description": "Fetch one ReviewHog review by `id` (from `review-hog-reviews-list` or the trigger's `report_id`). It returns the last completed turn: its validated `findings` (each with file, line ranges, priority, and the suggested fix), the `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR. While a re-review runs, the findings are still the previous turn's. A first review that is still running has no detail yet, so poll `review-hog-reviews-list` until it completes.",- "category": "ReviewHog",+ "description": "Fetch one code review by `id` (from `review-hog-reviews-list` or the trigger's `report_id`). It returns the last completed turn: its validated `findings` (each with file, line ranges, priority, and the suggested fix), the `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR. While a re-review runs, the findings are still the previous turn's. A first review that is still running has no detail yet, so poll `review-hog-reviews-list` until it completes.",+ "category": "PostHog Review","feature": "review_hog",- "summary": "Get a ReviewHog review",- "title": "Get a ReviewHog review",+ "summary": "Get a code review",+ "title": "Get a code review","required_scopes": ["review_hog:read"],"annotations": {"destructiveHint": false,@@ -11036,11 +11036,11 @@"feature_flag": "review-hog"},"review-hog-reviews-list": {- "description": "List recent ReviewHog reviews on this project. Use it to poll a review's status. Running reviews come first, each with `in_progress: true` and a `progress` object (the running turn's `review_stage` plus `done`/`total` counters). Completed reviews follow, newest first, with their finding counts by priority (`must_fix_count`, `should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id` opens the full review with `review-hog-reviews-get`. The default `scope=mine` covers reviews you ran plus reviews of pull requests you authored. Pass `scope=everyone` for every review on the project, and `limit` to widen the page.",- "category": "ReviewHog",+ "description": "List recent code reviews on this project. Use it to poll a review's status. Running reviews come first, each with `in_progress: true` and a `progress` object (the running turn's `review_stage` plus `done`/`total` counters). Completed reviews follow, newest first, with their finding counts by priority (`must_fix_count`, `should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id` opens the full review with `review-hog-reviews-get`. The default `scope=mine` covers reviews you ran plus reviews of pull requests you authored. Pass `scope=everyone` for every review on the project, and `limit` to widen the page.",+ "category": "PostHog Review","feature": "review_hog",- "summary": "List ReviewHog reviews",- "title": "List ReviewHog reviews",+ "summary": "List code reviews",+ "title": "List code reviews","required_scopes": ["review_hog:read"],"annotations": {"destructiveHint": false,@@ -11051,11 +11051,11 @@"feature_flag": "review-hog"},"review-hog-reviews-pr-status": {- "description": "Look up where a pull request's ReviewHog runs stand, by `pr_url`. Works for any PR on the project, also ones you did not trigger. `state` is `not_reviewed`, `queued`, `reviewing`, `resolving`, `idle`, or `unknown`. `latest_review` sums up the latest completed turn (its `id`, `run_index`, `review_mode`, `head_sha` and finding counts by priority), and `latest_resolution` the latest Resolve run. The loop for a run you started: call `review-hog-reviews-trigger`, keep the `requested_at` it returns and the `run_mode` you sent, and poll this tool with them (a minute apart is enough) until `request_outcome.status` is not `pending`. On `completed`, call `review-hog-reviews-get` with `request_outcome.review_id` and `run_index` for the findings; a Deep turn also answers a Standard request. `skipped` and `failed` carry a `reason`, for example `flash_after_full`, `review_failed`, or `no_matching_run` (nothing ran for the request and nothing is queued, so trigger again). `unknown` means the run state could not be read: retry later.",- "category": "ReviewHog",+ "description": "Look up where a pull request's review runs stand, by `pr_url`. Works for any PR on the project, also ones you did not trigger. `state` is `not_reviewed`, `queued`, `reviewing`, `resolving`, `idle`, or `unknown`. `latest_review` sums up the latest completed turn (its `id`, `run_index`, `review_mode`, `head_sha` and finding counts by priority), and `latest_resolution` the latest Resolve run. The loop for a run you started: call `review-hog-reviews-trigger`, keep the `requested_at` it returns and the `run_mode` you sent, and poll this tool with them (a minute apart is enough) until `request_outcome.status` is not `pending`. On `completed`, call `review-hog-reviews-get` with `request_outcome.review_id` and `run_index` for the findings; a Deep turn also answers a Standard request. `skipped` and `failed` carry a `reason`, for example `flash_after_full`, `review_failed`, or `no_matching_run` (nothing ran for the request and nothing is queued, so trigger again). `unknown` means the run state could not be read: retry later.",+ "category": "PostHog Review","feature": "review_hog",- "summary": "Get a pull request's ReviewHog status",- "title": "Get a pull request's ReviewHog status",+ "summary": "Get a pull request's review status",+ "title": "Get a pull request's review status","required_scopes": ["review_hog:read"],"annotations": {"destructiveHint": false,@@ -11066,11 +11066,11 @@"feature_flag": "review-hog"},"review-hog-reviews-trigger": {- "description": "Start a ReviewHog run on a pull request. Pass the PR as `pr_url` (e.g. `https://github.com/PostHog/posthog/pull/123`). The repository must be accessible to the project's GitHub App installation. `run_mode` picks the variant: `review` (the default) is a Deep review, published to the PR, followed by the Resolve stage; `review_only` is a Deep review without Resolve; `flash` is a Standard review on a lower-cost model that never resolves; `resolve_only` skips the review and only works the PR's existing unresolved review threads. Resolve runs only when the pull request owner opted in to resolving comments, not the requester. The owner is the PR author, or the Inbox reviewer for a PR the PostHog app opened. The response's `resolve_will_run` says whether Resolve will run, and `resolve_skip_reason` says why not. IMPORTANT: Resolve writes to the PR itself. It may push signed fix commits to the PR's branch, reply to review threads, and resolve bot-authored threads. Nothing is deleted and the commits are plain appends, but the actions are public to everyone on the PR. Non-blocking: returns `status` `started`, with `repository`, `pr_number`, the `head_sha` the request targets, `review_mode`, `requested_at`, and `report_id` (null on the PR's first run; find it later with `review-hog-reviews-list`). If the PR's current commit already has a published review in the requested mode, it returns `already_reviewed` without starting a run (`resolve_only` skips that check). A request while a review runs is queued on that PR's run and returns `joined_running_review`. Refusals: 409 with `code` `flash_after_full` (the PR has a Deep review, so ask for `review` instead) or `resolution_not_opted_in` (`resolve_only` on a PR whose owner did not opt in); 409 without a code while Resolve runs on the PR, or while a review runs for a `resolve_only` request. To wait for the result, poll `review-hog-reviews-pr-status` with `pr_url`, `requested_at` and `head_sha` from this response and the `run_mode` you sent, until `request_outcome.status` is not `pending` (`unknown` means retry later), then read the findings with `review-hog-reviews-get` using its `review_id` and `run_index`. An `already_reviewed` response needs no polling.",- "category": "ReviewHog",+ "description": "Start a PostHog Review run on a pull request. Pass the PR as `pr_url` (e.g. `https://github.com/PostHog/posthog/pull/123`). The repository must be accessible to the project's GitHub App installation. `run_mode` picks the variant: `review` (the default) is a Deep review, published to the PR, followed by the Resolve stage; `review_only` is a Deep review without Resolve; `flash` is a Standard review on a lower-cost model that never resolves; `resolve_only` skips the review and only works the PR's existing unresolved review threads. Resolve runs only when the pull request owner opted in to resolving comments, not the requester. The owner is the PR author, or the Inbox reviewer for a PR the PostHog app opened. The response's `resolve_will_run` says whether Resolve will run, and `resolve_skip_reason` says why not. IMPORTANT: Resolve writes to the PR itself. It may push signed fix commits to the PR's branch, reply to review threads, and resolve bot-authored threads. Nothing is deleted and the commits are plain appends, but the actions are public to everyone on the PR. Non-blocking: returns `status` `started`, with `repository`, `pr_number`, the `head_sha` the request targets, `review_mode`, `requested_at`, and `report_id` (null on the PR's first run; find it later with `review-hog-reviews-list`). If the PR's current commit already has a published review in the requested mode, it returns `already_reviewed` without starting a run (`resolve_only` skips that check). A request while a review runs is queued on that PR's run and returns `joined_running_review`. Refusals: 409 with `code` `flash_after_full` (the PR has a Deep review, so ask for `review` instead) or `resolution_not_opted_in` (`resolve_only` on a PR whose owner did not opt in); 409 without a code while Resolve runs on the PR, or while a review runs for a `resolve_only` request. To wait for the result, poll `review-hog-reviews-pr-status` with `pr_url`, `requested_at` and `head_sha` from this response and the `run_mode` you sent, until `request_outcome.status` is not `pending` (`unknown` means retry later), then read the findings with `review-hog-reviews-get` using its `review_id` and `run_index`. An `already_reviewed` response needs no polling.",+ "category": "PostHog Review","feature": "review_hog",- "summary": "Trigger a ReviewHog review",- "title": "Trigger a ReviewHog review",+ "summary": "Trigger a code review",+ "title": "Trigger a code review","required_scopes": ["review_hog:write"],"annotations": {"destructiveHint": false,diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex d0550d884305..7c8c0528ff62 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -11626,11 +11626,11 @@"feature_flag": "notebook-generated-widgets"},"review-hog-reviews-get": {- "description": "Fetch one ReviewHog review by `id` (from `review-hog-reviews-list` or the trigger's `report_id`). It returns the last completed turn: its validated `findings` (each with file, line ranges, priority, and the suggested fix), the `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR. While a re-review runs, the findings are still the previous turn's. A first review that is still running has no detail yet, so poll `review-hog-reviews-list` until it completes.",- "category": "ReviewHog",+ "description": "Fetch one code review by `id` (from `review-hog-reviews-list` or the trigger's `report_id`). It returns the last completed turn: its validated `findings` (each with file, line ranges, priority, and the suggested fix), the `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR. While a re-review runs, the findings are still the previous turn's. A first review that is still running has no detail yet, so poll `review-hog-reviews-list` until it completes.",+ "category": "PostHog Review","feature": "review_hog",- "summary": "Get a ReviewHog review",- "title": "Get a ReviewHog review",+ "summary": "Get a code review",+ "title": "Get a code review","required_scopes": ["review_hog:read"],"annotations": {"destructiveHint": false,@@ -11641,11 +11641,11 @@"feature_flag": "review-hog"},"review-hog-reviews-list": {- "description": "List recent ReviewHog reviews on this project. Use it to poll a review's status. Running reviews come first, each with `in_progress: true` and a `progress` object (the running turn's `review_stage` plus `done`/`total` counters). Completed reviews follow, newest first, with their finding counts by priority (`must_fix_count`, `should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id` opens the full review with `review-hog-reviews-get`. The default `scope=mine` covers reviews you ran plus reviews of pull requests you authored. Pass `scope=everyone` for every review on the project, and `limit` to widen the page.",- "category": "ReviewHog",+ "description": "List recent code reviews on this project. Use it to poll a review's status. Running reviews come first, each with `in_progress: true` and a `progress` object (the running turn's `review_stage` plus `done`/`total` counters). Completed reviews follow, newest first, with their finding counts by priority (`must_fix_count`, `should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id` opens the full review with `review-hog-reviews-get`. The default `scope=mine` covers reviews you ran plus reviews of pull requests you authored. Pass `scope=everyone` for every review on the project, and `limit` to widen the page.",+ "category": "PostHog Review","feature": "review_hog",- "summary": "List ReviewHog reviews",- "title": "List ReviewHog reviews",+ "summary": "List code reviews",+ "title": "List code reviews","required_scopes": ["review_hog:read"],"annotations": {"destructiveHint": false,@@ -11656,11 +11656,11 @@"feature_flag": "review-hog"},"review-hog-reviews-pr-status": {- "description": "Look up where a pull request's ReviewHog runs stand, by `pr_url`. Works for any PR on the project, also ones you did not trigger. `state` is `not_reviewed`, `queued`, `reviewing`, `resolving`, `idle`, or `unknown`. `latest_review` sums up the latest completed turn (its `id`, `run_index`, `review_mode`, `head_sha` and finding counts by priority), and `latest_resolution` the latest Resolve run. The loop for a run you started: call `review-hog-reviews-trigger`, keep the `requested_at` it returns and the `run_mode` you sent, and poll this tool with them (a minute apart is enough) until `request_outcome.status` is not `pending`. On `completed`, call `review-hog-reviews-get` with `request_outcome.review_id` and `run_index` for the findings; a Deep turn also answers a Standard request. `skipped` and `failed` carry a `reason`, for example `flash_after_full`, `review_failed`, or `no_matching_run` (nothing ran for the request and nothing is queued, so trigger again). `unknown` means the run state could not be read: retry later.",- "category": "ReviewHog",+ "description": "Look up where a pull request's review runs stand, by `pr_url`. Works for any PR on the project, also ones you did not trigger. `state` is `not_reviewed`, `queued`, `reviewing`, `resolving`, `idle`, or `unknown`. `latest_review` sums up the latest completed turn (its `id`, `run_index`, `review_mode`, `head_sha` and finding counts by priority), and `latest_resolution` the latest Resolve run. The loop for a run you started: call `review-hog-reviews-trigger`, keep the `requested_at` it returns and the `run_mode` you sent, and poll this tool with them (a minute apart is enough) until `request_outcome.status` is not `pending`. On `completed`, call `review-hog-reviews-get` with `request_outcome.review_id` and `run_index` for the findings; a Deep turn also answers a Standard request. `skipped` and `failed` carry a `reason`, for example `flash_after_full`, `review_failed`, or `no_matching_run` (nothing ran for the request and nothing is queued, so trigger again). `unknown` means the run state could not be read: retry later.",+ "category": "PostHog Review","feature": "review_hog",- "summary": "Get a pull request's ReviewHog status",- "title": "Get a pull request's ReviewHog status",+ "summary": "Get a pull request's review status",+ "title": "Get a pull request's review status","required_scopes": ["review_hog:read"],"annotations": {"destructiveHint": false,@@ -11671,11 +11671,11 @@"feature_flag": "review-hog"},"review-hog-reviews-trigger": {- "description": "Start a ReviewHog run on a pull request. Pass the PR as `pr_url` (e.g. `https://github.com/PostHog/posthog/pull/123`). The repository must be accessible to the project's GitHub App installation. `run_mode` picks the variant: `review` (the default) is a Deep review, published to the PR, followed by the Resolve stage; `review_only` is a Deep review without Resolve; `flash` is a Standard review on a lower-cost model that never resolves; `resolve_only` skips the review and only works the PR's existing unresolved review threads. Resolve runs only when the pull request owner opted in to resolving comments, not the requester. The owner is the PR author, or the Inbox reviewer for a PR the PostHog app opened. The response's `resolve_will_run` says whether Resolve will run, and `resolve_skip_reason` says why not. IMPORTANT: Resolve writes to the PR itself. It may push signed fix commits to the PR's branch, reply to review threads, and resolve bot-authored threads. Nothing is deleted and the commits are plain appends, but the actions are public to everyone on the PR. Non-blocking: returns `status` `started`, with `repository`, `pr_number`, the `head_sha` the request targets, `review_mode`, `requested_at`, and `report_id` (null on the PR's first run; find it later with `review-hog-reviews-list`). If the PR's current commit already has a published review in the requested mode, it returns `already_reviewed` without starting a run (`resolve_only` skips that check). A request while a review runs is queued on that PR's run and returns `joined_running_review`. Refusals: 409 with `code` `flash_after_full` (the PR has a Deep review, so ask for `review` instead) or `resolution_not_opted_in` (`resolve_only` on a PR whose owner did not opt in); 409 without a code while Resolve runs on the PR, or while a review runs for a `resolve_only` request. To wait for the result, poll `review-hog-reviews-pr-status` with `pr_url`, `requested_at` and `head_sha` from this response and the `run_mode` you sent, until `request_outcome.status` is not `pending` (`unknown` means retry later), then read the findings with `review-hog-reviews-get` using its `review_id` and `run_index`. An `already_reviewed` response needs no polling.",- "category": "ReviewHog",+ "description": "Start a PostHog Review run on a pull request. Pass the PR as `pr_url` (e.g. `https://github.com/PostHog/posthog/pull/123`). The repository must be accessible to the project's GitHub App installation. `run_mode` picks the variant: `review` (the default) is a Deep review, published to the PR, followed by the Resolve stage; `review_only` is a Deep review without Resolve; `flash` is a Standard review on a lower-cost model that never resolves; `resolve_only` skips the review and only works the PR's existing unresolved review threads. Resolve runs only when the pull request owner opted in to resolving comments, not the requester. The owner is the PR author, or the Inbox reviewer for a PR the PostHog app opened. The response's `resolve_will_run` says whether Resolve will run, and `resolve_skip_reason` says why not. IMPORTANT: Resolve writes to the PR itself. It may push signed fix commits to the PR's branch, reply to review threads, and resolve bot-authored threads. Nothing is deleted and the commits are plain appends, but the actions are public to everyone on the PR. Non-blocking: returns `status` `started`, with `repository`, `pr_number`, the `head_sha` the request targets, `review_mode`, `requested_at`, and `report_id` (null on the PR's first run; find it later with `review-hog-reviews-list`). If the PR's current commit already has a published review in the requested mode, it returns `already_reviewed` without starting a run (`resolve_only` skips that check). A request while a review runs is queued on that PR's run and returns `joined_running_review`. Refusals: 409 with `code` `flash_after_full` (the PR has a Deep review, so ask for `review` instead) or `resolution_not_opted_in` (`resolve_only` on a PR whose owner did not opt in); 409 without a code while Resolve runs on the PR, or while a review runs for a `resolve_only` request. To wait for the result, poll `review-hog-reviews-pr-status` with `pr_url`, `requested_at` and `head_sha` from this response and the `run_mode` you sent, until `request_outcome.status` is not `pending` (`unknown` means retry later), then read the findings with `review-hog-reviews-get` using its `review_id` and `run_index`. An `already_reviewed` response needs no polling.",+ "category": "PostHog Review","feature": "review_hog",- "summary": "Trigger a ReviewHog review",- "title": "Trigger a ReviewHog review",+ "summary": "Trigger a code review",+ "title": "Trigger a code review","required_scopes": ["review_hog:write"],"annotations": {"destructiveHint": false,diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 14d0ad3c171e..bf3498119afb 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -84081,7 +84081,7 @@ export namespace Schemas {* * `flash` - On everywhere* * `off` - Off everywhere */default_review_mode?: DefaultReviewModeEnum;- /** Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets its first automatic review when it is marked ready for review. Applies to automatic reviews only: the reviewhog label, an @posthog review comment, and the Review button still review drafts. */+ /** Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets its first automatic review when it is marked ready for review. Applies to automatic reviews only: the posthog-review label, an @posthog review comment, and the Review button still review drafts. */review_drafts?: boolean;/** After a Deep review of the user's pull requests is published, run the resolution stage: triage the unresolved review threads, implement the worth-and-safe fixes on the PR branch, and reply on every thread. Off by default. Personal only: no project default applies. */resolve_comments?: boolean;@@ -84093,7 +84093,7 @@ export namespace Schemas {urgency_threshold?: UrgencyThresholdEnum;/** Show a fun image in the review comment when a Deep review of the user's pull requests finds nothing to raise. Without the user's own value the project default applies. */celebrate_clean_reviews?: boolean;- /** Review the pull requests the agent opens for Inbox reports assigned to the user: ReviewHog reviews each one and posts its findings to the pull request. Off by default. */+ /** Review the pull requests the agent opens for Inbox reports assigned to the user: PostHog Review reviews each one and posts its findings to the pull request. Off by default. */review_inbox_prs?: boolean;/** Also have hosted Stamphog review those same Inbox pull requests: an approve-first review that posts a real GitHub approval when the change passes, and a comment when it doesn't. Only takes effect when the project has a synced, enabled Stamphog repository (see stamphog_connected). */stamphog_review_inbox_prs?: boolean;@@ -97373,7 +97373,7 @@ export namespace Schemas {* * `flash` - On everywhere* * `off` - Off everywhere */default_review_mode?: DefaultReviewModeEnum;- /** Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets its first automatic review when it is marked ready for review. Applies to automatic reviews only: the reviewhog label, an @posthog review comment, and the Review button still review drafts. */+ /** Give the user's draft pull requests automatic reviews. On by default. When off, a draft gets its first automatic review when it is marked ready for review. Applies to automatic reviews only: the posthog-review label, an @posthog review comment, and the Review button still review drafts. */review_drafts?: boolean;/** After a Deep review of the user's pull requests is published, run the resolution stage: triage the unresolved review threads, implement the worth-and-safe fixes on the PR branch, and reply on every thread. Off by default. Personal only: no project default applies. */resolve_comments?: boolean;@@ -97385,7 +97385,7 @@ export namespace Schemas {urgency_threshold?: UrgencyThresholdEnum;/** Show a fun image in the review comment when a Deep review of the user's pull requests finds nothing to raise. Without the user's own value the project default applies. */celebrate_clean_reviews?: boolean;- /** Review the pull requests the agent opens for Inbox reports assigned to the user: ReviewHog reviews each one and posts its findings to the pull request. Off by default. */+ /** Review the pull requests the agent opens for Inbox reports assigned to the user: PostHog Review reviews each one and posts its findings to the pull request. Off by default. */review_inbox_prs?: boolean;/** Also have hosted Stamphog review those same Inbox pull requests: an approve-first review that posts a real GitHub approval when the change passes, and a comment when it doesn't. Only takes effect when the project has a synced, enabled Stamphog repository (see stamphog_connected). */stamphog_review_inbox_prs?: boolean;diff --git a/services/mcp/src/generated/review_hog/api.ts b/services/mcp/src/generated/review_hog/api.tsindex 271a12f9a79b..12e4d8386634 100644--- a/services/mcp/src/generated/review_hog/api.ts+++ b/services/mcp/src/generated/review_hog/api.ts@@ -9,7 +9,7 @@import * as zod from 'zod'/**- * Recent ReviewHog reviews on this project: actively running reviews first (with the in-flight turn's stage), then the most recent completed ones — at most `limit` rows (default 5), plus `has_more` for whether a larger `limit` would reveal more. By default only the requesting user's reviews; `scope=everyone` lists every review on the project.+ * Recent code reviews on this project: actively running reviews first (with the in-flight turn's stage), then the most recent completed ones — at most `limit` rows (default 5), plus `has_more` for whether a larger `limit` would reveal more. By default only the requesting user's reviews; `scope=everyone` lists every review on the project.* @summary List recent reviews*/export const ReviewHogReviewsListParams = () => zod.object({@@ -43,7 +43,7 @@ export const ReviewHogReviewsListQueryParams = () => zod.object({})/**- * One completed ReviewHog review on this project, with one turn's validated findings, the findings the validator dismissed (and why), and the review body published to GitHub. The latest completed turn by default; `run_index` reads an older one. `in_progress`, `progress`, and the resolution fields describe the report now, whatever the turn. Project-wide, so reviews listed under `scope=everyone` can be opened too.+ * One completed code review on this project, with one turn's validated findings, the findings the validator dismissed (and why), and the review body published to GitHub. The latest completed turn by default; `run_index` reads an older one. `in_progress`, `progress`, and the resolution fields describe the report now, whatever the turn. Project-wide, so reviews listed under `scope=everyone` can be opened too.* @summary Retrieve one review's detail*/export const ReviewHogReviewsRetrieveParams = () => zod.object({@@ -65,7 +65,7 @@ export const ReviewHogReviewsRetrieveQueryParams = () => zod.object({})/**- * Where a pull request's ReviewHog runs stand: `state`, the latest completed review turn, and the latest Resolve run. Works for any pull request on the project, also ones the caller did not trigger. Pass the `requested_at` and `head_sha` the trigger returned, and the `run_mode` it was called with, to get `request_outcome`, which says when that request is done.+ * Where a pull request's review runs stand: `state`, the latest completed review turn, and the latest Resolve run. Works for any pull request on the project, also ones the caller did not trigger. Pass the `requested_at` and `head_sha` the trigger returned, and the `run_mode` it was called with, to get `request_outcome`, which says when that request is done.* @summary Look up a pull request's review status*/export const ReviewHogReviewsPrStatusRetrieveParams = () => zod.object({@@ -105,7 +105,7 @@ export const ReviewHogReviewsPrStatusRetrieveQueryParams = () => zod.object({})/**- * Start a ReviewHog review of any pull request the project's GitHub App installation can access, and publish it back to the PR. The run appears under the requesting user's recent reviews. A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: 'review' is a Deep review that chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously. A PR whose current commit already has a published review in the requested mode returns 'already_reviewed' without starting a run (resolve_only skips that check, because settling threads on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and whether resolution will run, while the run executes in the worker.+ * Start a PostHog Review run on any pull request the project's GitHub App installation can access, and publish it back to the PR. The run appears under the requesting user's recent reviews. A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: 'review' is a Deep review that chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously. A PR whose current commit already has a published review in the requested mode returns 'already_reviewed' without starting a run (resolve_only skips that check, because settling threads on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and whether resolution will run, while the run executes in the worker.* @summary Start a review of a pull request*/export const ReviewHogReviewsTriggerCreateParams = () => zod.object({