:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(review-hog): enable manual reviews by project feature flag (#109418)
Alex Lebedevec82dd92f382
diff --git a/docs/internal/sandboxes-setup-guide.md b/docs/internal/sandboxes-setup-guide.mdindex e9a9f7f79fd2..e65e85d04eb0 100644--- a/docs/internal/sandboxes-setup-guide.md+++ b/docs/internal/sandboxes-setup-guide.md@@ -207,8 +207,31 @@ When a run lands on the Python gateway unexpectedly, check those two variables fTheir absence means no token was minted, so the agent falls back to deriving theproduct from the task run it fetches at boot, which is the path that fails quietly.+### ReviewHog project access++The boolean `review-hog` feature flag controls the Code review UI and all project ReviewHog APIs,+including for staff. Normal membership and API scopes still apply. Set every release condition to the+**project** group, match its **id** property against the allowed project IDs, and use 100% rollout.+Replace broader conditions and include existing projects before deployment. Use the `id` property,+since frontend and backend group keys differ.+The property identifies the active environment: explicitly include every environment that should have+access. A parent project's flag does not enable its child environments, even though ReviewHog stores+their settings and reviews under the shared parent project.++Newly enabled projects get manual review and resolution. The first `REVIEWHOG_TEAM_IDS` entry retains+Flash and all automation UI (`show_internal_features`); other projects do not query Stamphog.+Existing Inbox or Stamphog opt-ins remain visible in other projects until the user switches them off.+Each project needs a GitHub App integration covering the repository; review skills seed automatically.+Existing automation routing and label secrets stay unchanged.++Use resolution only for explicitly enabled trusted projects reviewing repositories their teams own.+Ownership does not authenticate commenters: operators must assess repository and comment trust before+enabling resolution. The current risk acceptance covers this limited manual rollout, including the+missing commenter authorization and the post-push path check. Public or untrusted use still requires the hardening listed in+[ReviewHog's architecture](../../products/review_hog/ARCHITECTURE.md#status--next).+ReviewHog Flash uses `gpt-6-luna` for review, blind-spot checks, and validation.-The **ReviewHog Flash - Experimental** subsection under **What gets reviewed** on the Code review page groups the automatic Flash review toggle and **Flash strength** setting.+The configured internal project's **ReviewHog Flash - Experimental** subsection under **What gets reviewed** groups the automatic Flash review toggle and **Flash strength** setting.These settings apply only to Flash reviews.**Flash strength** selects **Medium** (`medium`, the default) or **Extra high** (`xhigh`) for all of your Flash reviews, including automatic, UI, and CLI requests.Each turn saves the effort it starts with, so a settings change applies to later turns.@@ -216,11 +239,11 @@ The shared `FLASH_ARM` and `flash_arm_for_effort` in `products/review_hog/backenFlash uses the existing `review_hog` model allowance.Both review modes instruct the agent to fetch pinned review and validation skills through the PostHog MCP with `skill-get`.The agent can fetch referenced bundled files with `skill-file-get`.-Choose **Review in Flash mode** from the Code review page's review menu to run it for one turn without changing the PR's full-review configuration.+On the configured internal project, choose **Review in Flash mode** from the review menu to run it for one turn without changing the PR's full-review configuration.Flash requests preserve an existing report's review tier, including when they join a running review.Flash labels its GitHub messages with `FLASH MODE - Faster, but stupid, use regular ReviewHog for a heavy review` and never starts comment resolution.-**Review all your PRs in Flash mode** is off by default.+**Review all your PRs in Flash mode** is off by default and shown only on the configured internal project.Turn it on in Code review to review PRs you author in `PostHog/posthog` when they open or receive new commits, including drafts.The head branch must belong to `PostHog/posthog`; fork PRs are excluded.Enabling it does not review existing PRs immediately; an existing PR becomes eligible on its next push.diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex afc22f2392ec..6346779415cb 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -12995,13 +12995,25 @@ snapshots:scenes-app-workflows-createaitaskconnectors--unavailable-connector--light:hash: v1.k794b7964.c4fdab3ab5190ace67d354d7010b49cbd37e9ec72feaa3fab9760d1f1010c8b0.S5qBDGrQNUo7qygcV1_MG_nu9RWeaMnoOFrYdhnV97Escenes-code-review--default--dark:- hash: v1.k794b7964.0dc91d491884c921b2a28d4f36de86e37b4442e77a3458d4b899f93ffe3f9329.cWMsULS-e97XTg1fXPiq0nzNGpSFj5hLhkvpJov-jUo+ hash: v1.k794b7964.7c64d83189e847d347f64fce34a566e49e4b660e736b8111b7eb91b0a954bec3.kE8ewW6NXBQgEwoUUWzKzUAsqqk4yv4lT6pjGrxpavoscenes-code-review--default--light:- hash: v1.k794b7964.64b0433a9848330102ab61be679048998992c65afd18ac9b3a9a06ddeade247e.4rHgGQCxEwQFw6QpeLstamxFthTTm-v-bN43LMnuoag+ hash: v1.k794b7964.3ab8c8f6e5e5a22665158b54ebd53359a8808f510b331ac1f9a82c8e497f4984.gan4zW1Fa49DdiGaOn8D_Jk_fNxHV-PT5w9-YOS_Ig0+ scenes-code-review--flag-disabled-for-staff--dark:+ hash: v1.k794b7964.af1b6736f5a6e6ffb329599ed7407d25dbee0939861cd554e0c94b84b2970a7c.HwLX1pgZqjpFAoG4ni16T0wtf1PJQkw0Evr2jBw2vG4+ scenes-code-review--flag-disabled-for-staff--light:+ hash: v1.k794b7964.a71251e301794f51a0a9140ab1442fada37b1cc0fb54095a5eb19499e0cb1b34.3GhhJCqNfLkY2WdBTTn0LHJifxiCqyEJ7viaHaoCoGA+ scenes-code-review--internal-features--dark:+ hash: v1.k794b7964.d858c76e0a9e192ff22e493eb595deea73fa5fcd4096e739deaba4a905ab9028.zFXCPVvOPmfMGhTzmMJC81aHm_dAVKlwylPy0rr5o-8+ scenes-code-review--internal-features--light:+ hash: v1.k794b7964.1d1d0d56f8311996c569acb2b9988e812e9ec720dfd1f0f0a1ea9587a01d95de.u2B-LAFR8NT_fiFbawgJWF6CvWF5cvqUefpF1ABrYZoscenes-code-review--narrow--dark:- hash: v1.k794b7964.5e653d673586db1b4aee7171ac3286ea9e5cd9710ba9342d96f73db462226a0c.l6pjAAewVhTc3Q1z6XHbwfGCuxqgTnxhLLDe9EEISYo+ hash: v1.k794b7964.35849f88cd28db56cb71ca5beaf1cf0c8817abf8714f4035113a75f1aa1a7def.w8ZUBwj8pOSIMaqaxNfLstA4-2GD7_oPox7tm2lrG5oscenes-code-review--narrow--light:- hash: v1.k794b7964.278598caf47885dd96965b61a69ba1bbc6d8f08a2d8c1f934610efcb55deac6c.FLi9zNVQIy8kobjXZ4zV_IPvkZoBHZk_KHNlBjiadu8+ hash: v1.k794b7964.88aeb5533c67b9045bd9b08012f3c3e6ee43909731404e0615d087189d479ef5.rEgrSeDVoFM2CbvwI57WgRZBUf0TD8TEjOWMEsDShhQ+ scenes-code-review--saved-inbox-opt-ins--dark:+ hash: v1.k794b7964.e17fe7708756d2621bb504f9e6d6db1ecfe1639d01a44de6e18424544467ac34.Tt6qVsdw2jHfcy2VU9usalpz1LCTd4xdMAmsbMWptac+ scenes-code-review--saved-inbox-opt-ins--light:+ hash: v1.k794b7964.a7b83b405218dad929bd1dc8739ed410afccf4c98d6807bc27d38bfc77eb2566.KSHymdCYdRa0C6RdxJD4uJGSjIzFNOrV_hT_ygJgfEwscenes-dashboards-customize-breakdown-colors--customize-breakdown-colors--dark:hash: v1.k794b7964.cf89a12669d5221b2441fbfb4439b8b1b38191943438a2c1a220444148329954.B4ew6uW3gZCbPU_3vTOggsOyHojRlyvuXxh5FZnlO-0scenes-dashboards-customize-breakdown-colors--customize-breakdown-colors--light:diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 6d418c25b80f..96e3b3f0167f 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -502,7 +502,7 @@ export const FEATURE_FLAGS = {REPLAY_VISION_MODEL_TIER_NAMING_EXPERIMENT: 'replay-vision-model-tier-naming-experiment', // owner: #team-replay multivariate=control,test,lite-standard-proREVAMPED_PY_NOTEBOOKS: 'revamped-py-notebooks', // owner: #team-data-toolsREVENUE_FIELDS_IN_POWER_USERS_TABLE: 'revenue-fields-in-power-users-table', // owner: @arthurdedeus #team-customer-analytics- REVIEW_HOG: 'review-hog', // owner: #team-devex, gates the Code review menu entry and scene (staff bypass the flag)+ REVIEW_HOG: 'review-hog', // owner: #team-devex, gates the Code review menu entry, scene, and API accessSCENE_MENU_BAR: 'scene-menu-bar', // owner: @adamleithp #team-platform-ux, gates the per-scene MenuBar above SceneTitleSectionSCHEMA_ENFORCEMENT_REJECT: 'schema-enforcement-reject', // owner: @aspicer, gates the ability to set schema enforcement mode to "reject"SCHEMA_MANAGEMENT: 'schema-management', // owner: @aspicerdiff --git a/posthog/settings/access.py b/posthog/settings/access.pyindex a21639cee4c3..290d2e55d31e 100644--- a/posthog/settings/access.py+++ b/posthog/settings/access.py@@ -153,8 +153,9 @@ AGENT_PROXY_CALLBACK_SECRET: str | None = os.getenv("AGENT_PROXY_CALLBACK_SECRET# ReviewHog production label trigger. The trigger endpoint (POST /api/review_hog/trigger) authenticates# CI by comparing the request's bearer token to REVIEWHOG_TRIGGER_TOKEN (a shared secret provisioned to# both Django and the GitHub Action). Unset fails closed outside local dev/test. REVIEWHOG_TEAM_ID is a-# comma-separated list of team ids allowed to use ReviewHog's UI trigger; the FIRST id is the team-# label-triggered runs execute and publish under. REVIEWHOG_RUN_USER_ID is the user the sandbox tasks+# comma-separated list of team ids using tiered review models; the FIRST id is the team that receives+# label-triggered and automatic authored-PR reviews and sees internal UI features. Manual UI/API access+# uses the review-hog feature flag. REVIEWHOG_RUN_USER_ID is the user the label-triggered sandbox tasks# run as (falls back to the team's GitHub integration creator when unset).REVIEWHOG_TRIGGER_TOKEN: str | None = os.getenv("REVIEWHOG_TRIGGER_TOKEN") or None# The env var stays singular (production charts provision it by that name); a single id parses to [id].diff --git a/products/review_hog/ARCHITECTURE.md b/products/review_hog/ARCHITECTURE.mdindex 7c875c6f7c92..41d247ceb597 100644--- a/products/review_hog/ARCHITECTURE.md+++ b/products/review_hog/ARCHITECTURE.md@@ -68,10 +68,13 @@ an unproven SHA posts the reply without the commit link and never auto-resolves.against the hard-floor **path backstop** (`commit_restricted_paths`): one touching `.github/`, CODEOWNERS, ordependency manifests delivers a human-review warning instead of the link and never auto-resolves either.-**TODO (BLOCKING — before any rollout beyond the dogfood team / public release) — the three remaining-injection-surface hardening items from the July e2e GO conditions.** The path backstop above is built; these+**TODO (BLOCKING public release): the three remaining injection-surface hardening items from the July e2e+GO conditions.** Manual review and resolution are available to explicitly enabled projects for+repositories their teams own. This is a limited rollout; the feature flag does not establish repository or+comment trust. Operators must assess both before enabling resolution. DECISIONS.md Stage 7 records the+2026-09-30 decision to accept the existing risks for this limited manual rollout. The path backstop above is built; theseare deliberately deferred (maintainer decisions 2026-08-06 and 2026-08-10, recorded in DECISIONS.md Stage 7)-and MUST land before the resolution stage runs on PRs the team does not own:+and MUST land before public release or resolution on untrusted PRs or repositories the team does not own:1. **Structural comment rendering** — thread comments still render as flat text in the resolution prompt, so acommenter can forge an "OWNER" header or a fake "SAFE TO FIX" verdict inside their own comment@@ -150,10 +153,10 @@ 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 real users:** settle the "ReviewHog Alpha" published-comment wording (see+**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-(structural comment rendering + author-permission gate + pre-push restricted-paths enforcement) — they gate any-rollout beyond the dogfood team.+(structural comment rendering + author-permission gate + pre-push restricted-paths enforcement). Enabling another+project for manual review does not clear these requirements for public or untrusted use.---@@ -671,6 +674,17 @@ See [DECISIONS.md](./DECISIONS.md) for the "reuse the leaf, own the model" bound**Configuration read at runtime:**+- **Project access** uses the existing boolean `review-hog` feature flag for the Code review menu, scene,+ and all project ReviewHog APIs. Staff also need the flag; normal membership and scope checks still apply.+ Set every release condition to the **project** group, match its **id** property against the allowed project+ IDs, and use 100% rollout. Replace broader conditions and include existing projects before deployment.+ This property identifies the **active environment** in both the browser and API. Include each environment+ that should have access; enabling a parent does not enable its child environments. ReviewHog shares its+ data under the parent project, but access remains independently flag-gated in each environment.+ Use the `id` property rather than the group key: the browser+ and MCP use the project's UUID as the group key, while the backend permission passes its numeric ID.+ Newly enabled projects get manual review and resolution. Each project needs a GitHub App integration+ covering the repository. Canonical skills seed on first configuration reads and each review run.- **GitHub auth** — the team's **GitHub App installation token**, resolved server-side per activity via`GitHubIntegration.first_for_team_repository(team_id, repo)` (`_installation_auth` returns`(get_access_token(), github_installation_id)`, auto-refreshing); resolution-thread deliveries re-resolve it@@ -682,14 +696,22 @@ See [DECISIONS.md](./DECISIONS.md) for the "reuse the leaf, own the model" bound`kind="github"` `Integration` is validated up front by `validate_github_integration_activity`.The sandbox `repository` is the PR's own `owner/repo`, derived from the PR URL.- **Prod label trigger** (settings, `posthog/settings/access.py`) — `REVIEWHOG_TRIGGER_TOKEN` (shared secret),- `REVIEWHOG_TEAM_ID` (the run team), `REVIEWHOG_RUN_USER_ID` (optional; falls back to the integration creator).+ the first `REVIEWHOG_TEAM_IDS` entry from the `REVIEWHOG_TEAM_ID` environment variable (the run team),+ and `REVIEWHOG_RUN_USER_ID` (optional; falls back to the integration creator).+ Enabling manual project access requires no changes to these settings or the shared secret.- **Automatic authored-PR trigger** uses the first `REVIEWHOG_TEAM_IDS` entry and requires a matching GitHub installation on that team.The PR author's linked GitHub identity must map to an active member of the team's organization with `review_authored_prs` enabled.+- **Internal UI features** use `show_internal_features` in the settings response, true only for the first+ `REVIEWHOG_TEAM_IDS` entry. That project retains Flash and all automation controls. Other enabled projects+ show manual review and resolution without Flash or automation controls, except that saved Inbox or+ Stamphog opt-ins remain visible until switched off. Their settings reads do not query Stamphog.+ Existing automation routing and its configuration remain separate from the flag.**Triggers.** Six entry points feed the same per-PR `ReviewPRQueueWorkflow`: the `run_review` CLI (manual / eval), the`reviewhog` **label** on a `PostHog/posthog` PR (a thin GitHub Action → `POST /api/review_hog/trigger`), 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+also carries the review-without-resolving and resolve-only variants; the configured internal project also shows+**Flash**, which pins resolution off), an **inbox** trigger (a`TaskRun` receiver auto-reviews self-driving Signals implementations once their PR exists — a pushed branch withouta PR is not reviewed, and the PR must sit in the task's own repository because `output.pr_url` is written bywhoever controls the run, the sandbox agent included), **MCP tools**@@ -700,9 +722,10 @@ It accepts `opened` and `synchronize` for open `PostHog/posthog` PRs whose headEnabling the setting performs no backfill; existing PRs become eligible on their next push.The turn rechecks the author's opt-in before starting and uses their saved severity threshold; Flash never starts resolution.The UI and MCP paths are one surface: the viewset carries the grantable `review_hog` scope (`review_hog:read` for list /-retrieve / perspective_stats, `review_hog:write` for trigger) rather than INTERNAL, and the trigger action keeps-the `REVIEWHOG_TEAM_ID` dogfood gate and its synchronous URL / App-access / fork / open-state checks regardless of-caller. See [DECISIONS.md](./DECISIONS.md) for each trigger's auth / scope / identity rules.+retrieve / perspective_stats, `review_hog:write` for trigger). Both require the `review-hog` feature flag,+and the trigger action checks the URL, GitHub App access, fork status, and open state regardless of caller.+It refuses `run_mode=flash` with a 403 outside the project that has `show_internal_features`.+See [DECISIONS.md](./DECISIONS.md) for each trigger's auth / scope / identity rules.The `review-pr-queue` workflow keeps the existing per-PR workflow ID and records requests through signals.It has at most one pending request each for Full, manual Flash, and automatic Flash, taking explicit requests before automatic ones.@@ -780,10 +803,11 @@ refreshes the perspective stats and an open drawer's detail (`reviewHogSettingsL"valid"/"invalid" (`reviewer/tools/publish_review.py`, the `post_promo` block). Publish is now liveper-run (the trigger endpoint posts with `publish=true`), so settle the prod wording before real userssee it.-- **TODO (BLOCKING public release) — resolution-stage injection hardening, deferred by decision.** Structural+- **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 delivery- backstop stand between a hostile PR comment and a write turn (and the backstop cannot un-push — the commit is- on the branch, and CI has seen it, before the check runs). Do not widen `REVIEWHOG_TEAM_IDS` or ship the- resolution stage publicly before all three land — see the BLOCKING TODO in+ backstop stand between a hostile PR comment and a write turn. The backstop cannot retract a push: the commit+ is on the branch, and CI has seen it, before the check runs. Explicitly enabled projects can use+ manual resolution for repositories their teams own. Public release and resolution on untrusted PRs or+ unowned repositories remain blocked until all three protections land. See the BLOCKING TODO in[Status & next](#status--next) and DECISIONS.md Stage 7.diff --git a/products/review_hog/DECISIONS.md b/products/review_hog/DECISIONS.mdindex ac34836c4d63..bbb1918e72d8 100644--- a/products/review_hog/DECISIONS.md+++ b/products/review_hog/DECISIONS.md@@ -3255,6 +3255,14 @@ implement what is worth doing and safe to do unattended, answer what isn't, andARCHITECTURE.md the same date. Deferred to pre-GA: structural (JSON) comment rendering in the resolution prompt(e2e-gated — forged author headers / fake SAFE TO FIX), and the author-permission gate policy (which`author_association`s may drive a write turn; naive filters drop the bot threads the stage exists for).+ _2026-09-30 (limited manual rollout decision):_ retain full review and resolution for explicitly enabled,+ trusted projects reviewing repositories their teams own. This extends the dogfood-only risk acceptance+ above to that limited rollout. Repository ownership and GitHub App access do not authenticate commenters;+ untrusted comments can still reach a writable session, and the path backstop still runs after the push.+ Operators must assess repository and comment trust before enabling a project. The feature flag is an+ operator allowlist, not an enforced ownership or commenter-trust boundary. Use review without resolution+ for untrusted PRs. Public rollout and resolution on untrusted PRs or unowned repositories remain blocked+ on all three hardening items. The manual rollout does not satisfy or remove those gates._Built 2026-08-10 (off the second review round on PR #72074):_ three verified findings fixed. **Watermarktruncation** — the per-thread `comments(first: 50)` fetch returned the oldest 50 with no overflow detection, soa 51+-comment thread's watermark froze below its real newest comment and the thread went permanently blind todiff --git a/products/review_hog/backend/api/blind_spots.py b/products/review_hog/backend/api/blind_spots.pyindex f0a705f61236..c1d2c909a78f 100644--- a/products/review_hog/backend/api/blind_spots.py+++ b/products/review_hog/backend/api/blind_spots.py@@ -12,6 +12,7 @@ from rest_framework.response import Responsefrom posthog.api.routing import TeamAndOrgViewSetMixinfrom posthog.models.scoping.manager import resolve_effective_team_id+from posthog.permissions import PostHogFeatureFlagPermissionfrom products.review_hog.backend.models import ReviewSkillConfigfrom products.review_hog.backend.reviewer.lazy_seed import seed_canonicals_tolerantly, sync_canonical_blind_spots@@ -70,6 +71,8 @@ class ReviewBlindSpotsConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericView# llm_skill, not INTERNAL: responses carry skill body/description, so the llm_skill RBAC# gate must apply — INTERNAL short-circuits AccessControlPermission before it checks anything.scope_object = "llm_skill"+ permission_classes = [PostHogFeatureFlagPermission]+ posthog_feature_flag = "review-hog"# Unscoped only to satisfy the router/introspection; every real query goes through `for_team`.queryset = ReviewSkillConfig.objects.unscoped()serializer_class = ReviewBlindSpotsConfigSerializerdiff --git a/products/review_hog/backend/api/perspectives.py b/products/review_hog/backend/api/perspectives.pyindex 6c22289ea2ca..b6933425a9d3 100644--- a/products/review_hog/backend/api/perspectives.py+++ b/products/review_hog/backend/api/perspectives.py@@ -9,6 +9,7 @@ from rest_framework.response import Responsefrom posthog.api.routing import TeamAndOrgViewSetMixinfrom posthog.models.scoping.manager import resolve_effective_team_id+from posthog.permissions import PostHogFeatureFlagPermissionfrom products.review_hog.backend.models import ReviewSkillConfigfrom products.review_hog.backend.reviewer.lazy_seed import seed_canonicals_tolerantly, sync_canonical_perspectives@@ -60,6 +61,8 @@ class ReviewPerspectiveConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericVie# llm_skill, not INTERNAL: responses carry skill body/description, so the llm_skill RBAC# gate must apply — INTERNAL short-circuits AccessControlPermission before it checks anything.scope_object = "llm_skill"+ permission_classes = [PostHogFeatureFlagPermission]+ posthog_feature_flag = "review-hog"# Unscoped only to satisfy the router/introspection; every real query goes through `for_team`.queryset = ReviewSkillConfig.objects.unscoped()serializer_class = ReviewPerspectiveConfigSerializerdiff --git a/products/review_hog/backend/api/resolution.py b/products/review_hog/backend/api/resolution.pyindex 16746a7627d0..bceecf7f3980 100644--- a/products/review_hog/backend/api/resolution.py+++ b/products/review_hog/backend/api/resolution.py@@ -12,6 +12,7 @@ from rest_framework.response import Responsefrom posthog.api.routing import TeamAndOrgViewSetMixinfrom posthog.models.scoping.manager import resolve_effective_team_id+from posthog.permissions import PostHogFeatureFlagPermissionfrom products.review_hog.backend.models import ReviewSkillConfigfrom products.review_hog.backend.reviewer.lazy_seed import seed_canonicals_tolerantly, sync_canonical_resolution@@ -70,6 +71,8 @@ class ReviewResolutionConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericView# llm_skill, not INTERNAL: responses carry skill body/description, so the llm_analytics RBAC# gate must apply — INTERNAL short-circuits AccessControlPermission before it checks anything.scope_object = "llm_skill"+ permission_classes = [PostHogFeatureFlagPermission]+ posthog_feature_flag = "review-hog"# Unscoped only to satisfy the router/introspection; every real query goes through `for_team`.queryset = ReviewSkillConfig.objects.unscoped()serializer_class = ReviewResolutionConfigSerializerdiff --git a/products/review_hog/backend/api/reviews.py b/products/review_hog/backend/api/reviews.pyindex b170c8bdba29..09de6cbd5b3d 100644--- a/products/review_hog/backend/api/reviews.py+++ b/products/review_hog/backend/api/reviews.py@@ -2,7 +2,6 @@ import uuidimport loggingfrom typing import Any, cast, get_args-from django.conf import settingsfrom django.db.models import Max, Q, QuerySetfrom django.utils import timezone@@ -20,7 +19,9 @@ from posthog.egress.github.transport import GitHubRateLimitErrorfrom posthog.models.integration import GitHubIntegrationfrom posthog.models.scoping.manager import resolve_effective_team_idfrom posthog.models.user import User+from posthog.permissions import PostHogFeatureFlagPermission+from products.review_hog.backend.api.settings import has_internal_featuresfrom products.review_hog.backend.models import ReviewReport, ReviewReportArtefactfrom products.review_hog.backend.reviewer.artefact_content import (ReviewIssueCategory,@@ -544,6 +545,8 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet# reachable with a personal API key or OAuth token, which is how MCP tools authenticate. Session# UI access is unchanged; this only adds token access, gated by review_hog:read / review_hog:write.scope_object = "review_hog"+ permission_classes = [PostHogFeatureFlagPermission]+ posthog_feature_flag = "review-hog"# Unscoped only to satisfy the router/introspection; every real query goes through `for_team`.queryset = ReviewReport.objects.unscoped()serializer_class = ReviewRecentReviewSerializer@@ -704,7 +707,8 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet),403: OpenApiResponse(response=ReviewTriggerErrorSerializer,- description="The ReviewHog UI trigger is not enabled for this project.",+ description="The review-hog feature flag is off for this project, or Flash was requested in a "+ "project without internal features (see show_internal_features in the settings response).",),409: OpenApiResponse(response=ReviewTriggerErrorSerializer,@@ -730,15 +734,15 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet@action(methods=["POST"], detail=False, required_scopes=["review_hog:write"])def trigger(self, request: Request, **kwargs) -> Response:team_id = resolve_effective_team_id(self.team_id)- # Dogfood gate: the UI trigger only runs on the designated ReviewHog team for now — reviews are- # expensive, so widening beyond it is a deliberate later decision, not a default.- if team_id not in settings.REVIEWHOG_TEAM_IDS:+ serializer = ReviewTriggerRequestSerializer(data=request.data)+ serializer.is_valid(raise_exception=True)+ run_mode: str = serializer.validated_data["run_mode"]+ # The scene hides Flash outside the internal project; this also stops API and MCP callers there.+ if run_mode == RUN_MODE_FLASH and not has_internal_features(team_id):return Response(- {"error": "PostHog Review can't start reviews from this project yet"},+ {"error": "Flash reviews aren't available in this project. Start a regular review instead."},status=status.HTTP_403_FORBIDDEN,)- serializer = ReviewTriggerRequestSerializer(data=request.data)- serializer.is_valid(raise_exception=True)try:pr_info = PRParser().parse_github_pr_url(serializer.validated_data["pr_url"])except ValueError:@@ -790,7 +794,6 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet},status=status.HTTP_400_BAD_REQUEST,)- run_mode: str = serializer.validated_data["run_mode"]# The busy-guard (CONTEXT.md): Temporal joins same-id starts on its own, but a review and# this PR's resolution run under different workflow ids, so the cross-stage check is# explicit — and the answer is a refusal, not a queue.diff --git a/products/review_hog/backend/api/settings.py b/products/review_hog/backend/api/settings.pyindex 5cf4a87370df..f680971fd67c 100644--- a/products/review_hog/backend/api/settings.py+++ b/products/review_hog/backend/api/settings.py@@ -10,6 +10,7 @@ from rest_framework.response import Responsefrom posthog.api.routing import TeamAndOrgViewSetMixinfrom posthog.models.scoping.manager import resolve_effective_team_id+from posthog.permissions import PostHogFeatureFlagPermissionfrom products.review_hog.backend.models import ReviewUserSettingsfrom products.review_hog.backend.reviewer.lazy_seed import seed_canonicals_tolerantly, sync_canonical_authoring@@ -18,6 +19,11 @@ from products.stamphog.backend.facade.api import has_reviewable_repo_configlogger = logging.getLogger(__name__)+def has_internal_features(team_id: int) -> bool:+ """Whether a project gets Flash and the automation settings: only the first configured ReviewHog team."""+ return bool(settings.REVIEWHOG_TEAM_IDS and team_id == settings.REVIEWHOG_TEAM_IDS[0])++class ReviewUserSettingsSerializer(serializers.ModelSerializer):review_inbox_prs = serializers.BooleanField(required=False,@@ -69,8 +75,10 @@ class ReviewUserSettingsSerializer(serializers.ModelSerializer):"blocking issues.",)can_trigger_reviews = serializers.SerializerMethodField(- help_text="Whether reviews can be started from this project's Code review page (the UI trigger "- "is limited to the designated ReviewHog teams while the product is in alpha).",+ help_text="Whether reviews can be started from this project's Code review page.",+ )+ show_internal_features = serializers.SerializerMethodField(+ help_text="Whether to show Flash mode and settings for automatic, label-triggered, and Inbox reviews.",)stamphog_connected = serializers.SerializerMethodField(help_text="Whether this project has at least one synced, enabled Stamphog repository. When "@@ -90,15 +98,22 @@ class ReviewUserSettingsSerializer(serializers.ModelSerializer):"flash_reasoning_effort","urgency_threshold","can_trigger_reviews",+ "show_internal_features","stamphog_connected",]@extend_schema_field(serializers.BooleanField())def get_can_trigger_reviews(self, instance: ReviewUserSettings) -> bool:- return instance.team_id in settings.REVIEWHOG_TEAM_IDS+ return True++ @extend_schema_field(serializers.BooleanField())+ def get_show_internal_features(self, instance: ReviewUserSettings) -> bool:+ return has_internal_features(instance.team_id)@extend_schema_field(serializers.BooleanField())def get_stamphog_connected(self, instance: ReviewUserSettings) -> bool:+ if not self.get_show_internal_features(instance):+ return False# This reads the stamphog product DB, which can fail fast on its own circuit breaker. An# informational UI flag must not fail the settings endpoint, so fall back to False.try:@@ -114,10 +129,12 @@ class ReviewUserSettingsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet)Sibling of the perspective/validator/blind-spots config viewsets: skills control *how* a reviewruns, this controls *what gets reviewed* (trigger opt-outs) and *how strict publishing is*(urgency threshold). Per-user like the skill configs — the workflow reads the PR author's row.- Deliberately not staff-gated (the alpha gate is UI visibility only): every row is self-scoped.+ Every row is self-scoped, and the review-hog feature flag controls project access."""scope_object = "INTERNAL"+ permission_classes = [PostHogFeatureFlagPermission]+ posthog_feature_flag = "review-hog"# Unscoped only to satisfy the router/introspection; every real query goes through `for_team`.queryset = ReviewUserSettings.objects.unscoped()serializer_class = ReviewUserSettingsSerializerdiff --git a/products/review_hog/backend/api/validators.py b/products/review_hog/backend/api/validators.pyindex c5e868bba527..41e48703f632 100644--- a/products/review_hog/backend/api/validators.py+++ b/products/review_hog/backend/api/validators.py@@ -12,6 +12,7 @@ from rest_framework.response import Responsefrom posthog.api.routing import TeamAndOrgViewSetMixinfrom posthog.models.scoping.manager import resolve_effective_team_id+from posthog.permissions import PostHogFeatureFlagPermissionfrom products.review_hog.backend.models import ReviewSkillConfigfrom products.review_hog.backend.reviewer.lazy_seed import seed_canonicals_tolerantly, sync_canonical_validation@@ -68,6 +69,8 @@ class ReviewValidatorConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewS# llm_skill, not INTERNAL: responses carry skill body/description, so the llm_skill RBAC# gate must apply — INTERNAL short-circuits AccessControlPermission before it checks anything.scope_object = "llm_skill"+ permission_classes = [PostHogFeatureFlagPermission]+ posthog_feature_flag = "review-hog"# Unscoped only to satisfy the router/introspection; every real query goes through `for_team`.queryset = ReviewSkillConfig.objects.unscoped()serializer_class = ReviewValidatorConfigSerializerdiff --git a/products/review_hog/backend/tests/test_blind_spots_config_api.py b/products/review_hog/backend/tests/test_blind_spots_config_api.pyindex 91f3d2ad9aa0..194872b6a3ba 100644--- a/products/review_hog/backend/tests/test_blind_spots_config_api.py+++ b/products/review_hog/backend/tests/test_blind_spots_config_api.py@@ -1,4 +1,5 @@from posthog.test.base import APIBaseTest+from unittest.mock import patchfrom parameterized import parameterized@@ -20,6 +21,7 @@ _CUSTOM = f"{REVIEW_HOG_BLIND_SPOTS_PREFIX}security-sweep"class TestReviewBlindSpotsConfigAPI(APIBaseTest):def setUp(self) -> None:super().setUp()+ self.enterContext(patch("posthoganalytics.feature_enabled", return_value=True))sync_canonical_blind_spots(self.team)self.base = f"/api/projects/{self.team.id}/review_hog/blind_spots"diff --git a/products/review_hog/backend/tests/test_perspective_config_api.py b/products/review_hog/backend/tests/test_perspective_config_api.pyindex 0b4a848a8bf9..0188df7cadf8 100644--- a/products/review_hog/backend/tests/test_perspective_config_api.py+++ b/products/review_hog/backend/tests/test_perspective_config_api.py@@ -1,4 +1,5 @@from posthog.test.base import APIBaseTest+from unittest.mock import patchfrom parameterized import parameterized@@ -20,6 +21,7 @@ _CUSTOM = f"{REVIEW_HOG_PERSPECTIVE_PREFIX}custom-x"class TestReviewPerspectiveConfigAPI(APIBaseTest):def setUp(self) -> None:super().setUp()+ self.enterContext(patch("posthoganalytics.feature_enabled", return_value=True))sync_canonical_perspectives(self.team)self.base = f"/api/projects/{self.team.id}/review_hog/perspectives"diff --git a/products/review_hog/backend/tests/test_resolution_config_api.py b/products/review_hog/backend/tests/test_resolution_config_api.pyindex 3f1435999d3a..b4e86763d4c7 100644--- a/products/review_hog/backend/tests/test_resolution_config_api.py+++ b/products/review_hog/backend/tests/test_resolution_config_api.py@@ -1,4 +1,5 @@from posthog.test.base import APIBaseTest+from unittest.mock import patchfrom products.review_hog.backend.models import ReviewSkillConfigfrom products.review_hog.backend.reviewer.lazy_seed import sync_canonical_resolution, sync_canonical_validation@@ -19,6 +20,7 @@ class TestReviewResolutionConfigAPI(APIBaseTest):def setUp(self) -> None:super().setUp()+ self.enterContext(patch("posthoganalytics.feature_enabled", return_value=True))sync_canonical_resolution(self.team)self.base = f"/api/projects/{self.team.id}/review_hog/resolution"diff --git a/products/review_hog/backend/tests/test_reviews_api.py b/products/review_hog/backend/tests/test_reviews_api.pyindex 55a1217d52d7..a34ee9de6bc9 100644--- a/products/review_hog/backend/tests/test_reviews_api.py+++ b/products/review_hog/backend/tests/test_reviews_api.py@@ -2,6 +2,7 @@ from datetime import UTC, datetime, timedeltaimport time_machinefrom posthog.test.base import APIBaseTest+from unittest.mock import patchfrom django.utils import timezone@@ -77,6 +78,7 @@ def _issues_review(count: int) -> IssuesReview:class TestRecentReviewsAPI(APIBaseTest):def setUp(self) -> None:super().setUp()+ self.enterContext(patch("posthoganalytics.feature_enabled", return_value=True))self.url = f"/api/projects/{self.team.id}/review_hog/reviews/"def _report(diff --git a/products/review_hog/backend/tests/test_settings_api.py b/products/review_hog/backend/tests/test_settings_api.pyindex 3b702fbde99c..11c05fc56982 100644--- a/products/review_hog/backend/tests/test_settings_api.py+++ b/products/review_hog/backend/tests/test_settings_api.py@@ -1,6 +1,7 @@from posthog.test.base import APIBaseTest+from unittest.mock import patch-from django.test import SimpleTestCase+from django.test import SimpleTestCase, override_settingsfrom parameterized import parameterized@@ -18,6 +19,7 @@ class TestReviewUserSettingsAPI(APIBaseTest):def setUp(self) -> None:super().setUp()+ self.enterContext(patch("posthoganalytics.feature_enabled", return_value=True))self.url = f"/api/projects/{self.team.id}/review_hog/settings/"def test_get_creates_the_row_with_defaults(self) -> None:@@ -35,7 +37,8 @@ class TestReviewUserSettingsAPI(APIBaseTest):"review_authored_prs": False,"flash_reasoning_effort": "medium","urgency_threshold": "consider",- "can_trigger_reviews": False, # REVIEWHOG_TEAM_IDS is empty in tests+ "can_trigger_reviews": True,+ "show_internal_features": False,"stamphog_connected": False, # no synced+enabled repo config in this project}assert ReviewUserSettings.objects.for_team(self.team.id).filter(user_id=self.user.id).count() == 1@@ -96,9 +99,11 @@ class TestReviewUserSettingsAPI(APIBaseTest):connected_by_user_id=connected_by_user_id,)- res = self.client.get(self.url)+ with override_settings(REVIEWHOG_TEAM_IDS=[self.team.id]):+ res = self.client.get(self.url)assert res.status_code == 200+ assert res.json()["show_internal_features"] is Trueassert res.json()["stamphog_connected"] is expecteddef test_patch_rejects_an_unknown_threshold(self) -> None:@@ -133,17 +138,34 @@ class TestReviewUserSettingsAPI(APIBaseTest):assert rows.count() == 1assert rows.get().version == 1- def test_environment_url_resolves_to_the_canonical_team(self) -> None:+ def test_environment_flag_access_uses_the_url_team_but_settings_use_the_parent(self) -> None:# With an environment (child team) id in the URL, the canonicalized `for_team` filter and a# raw-id create kwarg used to contradict each other: the row landed on the parent, the get# never matched, and every call after the first 500ed on the unique constraint.env = Team.objects.create(organization=self.organization, parent_team=self.team, name="env")url = f"/api/projects/{env.id}/review_hog/settings/"-- first = self.client.get(url)- second = self.client.patch(url, {"urgency_threshold": "must_fix"}, format="json")+ enabled_project_id = str(self.team.id)++ def enabled_for_project(+ key: str,+ _distinct_id: str,+ *,+ group_properties: dict[str, dict[str, str]] | None = None,+ **_kwargs: object,+ ) -> bool:+ return key == "review-hog" and (group_properties or {}).get("project", {}).get("id") == enabled_project_id++ with patch("posthoganalytics.feature_enabled", side_effect=enabled_for_project):+ parent = self.client.patch(self.url, {"urgency_threshold": "should_fix"}, format="json")+ assert parent.status_code == 200+ assert self.client.get(url).status_code == 403++ enabled_project_id = str(env.id)+ first = self.client.get(url)+ second = self.client.patch(url, {"urgency_threshold": "must_fix"}, format="json")assert first.status_code == 200+ assert first.json()["urgency_threshold"] == "should_fix"assert second.status_code == 200row = ReviewUserSettings.objects.for_team(self.team.id).get(user_id=self.user.id)assert row.team_id == self.team.iddiff --git a/products/review_hog/backend/tests/test_ui_trigger_api.py b/products/review_hog/backend/tests/test_ui_trigger_api.pyindex 9ab52fbf5b22..1d98bfe9ef66 100644--- a/products/review_hog/backend/tests/test_ui_trigger_api.py+++ b/products/review_hog/backend/tests/test_ui_trigger_api.py@@ -1,3 +1,5 @@+from uuid import uuid4+from posthog.test.base import APIBaseTestfrom unittest.mock import MagicMock, patch@@ -7,11 +9,13 @@ from parameterized import parameterizedfrom rest_framework import statusfrom posthog.egress.github.transport import GitHubRateLimitError+from posthog.models import User-from products.review_hog.backend.models import ReviewReport+from products.review_hog.backend.models import ReviewReport, ReviewSkillConfig, ReviewUserSettingsfrom products.review_hog.backend.reviewer.constants import REVIEW_ARMS_BY_TIER, ReviewTierfrom products.review_hog.backend.reviewer.persistence import load_review_armfrom products.review_hog.backend.reviewer.tools.github_client import GitHubAPIError+from products.skills.backend.models.skills import LLMSkill_START = "products.review_hog.backend.api.reviews.start_review_pr_workflow"_START_RESOLUTION = "products.review_hog.backend.api.reviews.start_resolution_workflow"@@ -29,11 +33,9 @@ def _pr_meta(**overrides: object) -> MagicMock:class TestReviewHogUiTriggerApi(APIBaseTest):- # The settings GET below resolves stamphog_connected off the stamphog product DB.- databases = {"default", "stamphog_db_writer", "stamphog_db_reader"}-def setUp(self) -> None:super().setUp()+ self.mock_feature_flag = self.enterContext(patch("posthoganalytics.feature_enabled", return_value=True))# The busy-guard probes Temporal on every trigger; tests must never open real connections.busy_patcher = patch(_BUSY, return_value=False)self.mock_busy = busy_patcher.start()@@ -48,11 +50,15 @@ class TestReviewHogUiTriggerApi(APIBaseTest):@patch(_META, return_value=_pr_meta())@patch(_ACCESS, return_value=object())@patch(_START, return_value="wf-ui-1")- def test_trigger_starts_a_publishing_workflow_acting_as_the_requester(self, mock_start, mock_access, _mock_meta):+ def test_trigger_starts_a_publishing_workflow_acting_as_the_requester(+ self, mock_start: MagicMock, mock_access: MagicMock, _mock_meta: MagicMock+ ) -> None:# The URL is canonicalized (trailing /files dropped) and the requester is both the run user# and the acting user — losing the override would make the review follow the PR author's# perspectives instead of the person who asked for it.- with override_settings(REVIEWHOG_TEAM_IDS=[self.team.id]):+ member = User.objects.create_and_join(self.organization, "[email protected]", None)+ self.client.force_login(member)+ with override_settings(REVIEWHOG_TEAM_IDS=[]):resp = self._trigger("https://github.com/PostHog/posthog.com/pull/123/files")self.assertEqual(resp.status_code, status.HTTP_202_ACCEPTED, resp.content)@@ -61,9 +67,9 @@ class TestReviewHogUiTriggerApi(APIBaseTest):mock_start.assert_called_once_with(pr_url="https://github.com/PostHog/posthog.com/pull/123",team_id=self.team.id,- user_id=self.user.id,+ user_id=member.id,publish=True,- acting_user_id=self.user.id,+ acting_user_id=member.id,trigger_source="ui",# None = the requester's resolve_comments setting decides whether resolution chains.resolve_comments=None,@@ -97,6 +103,18 @@ class TestReviewHogUiTriggerApi(APIBaseTest):self.assertEqual(mock_start.call_args.kwargs["review_mode"], expected_review_mode)mock_start_resolution.assert_not_called()+ @patch(_META, return_value=_pr_meta())+ @patch(_ACCESS, return_value=object())+ @patch(_START, return_value="wf-ui-1")+ def test_flash_mode_is_refused_outside_the_internal_project(+ self, mock_start: MagicMock, _mock_access: MagicMock, _mock_meta: MagicMock+ ) -> None:+ with override_settings(REVIEWHOG_TEAM_IDS=[self.team.id + 1, self.team.id]):+ resp = self._trigger("https://github.com/PostHog/posthog.com/pull/123", run_mode="flash")++ self.assertEqual(resp.status_code, status.HTTP_403_FORBIDDEN, resp.content)+ mock_start.assert_not_called()+@patch(_META, return_value=_pr_meta(head_sha="abc123"))@patch(_ACCESS, return_value=object())@patch(_START_RESOLUTION, return_value="wf-resolve-1")@@ -231,17 +249,61 @@ class TestReviewHogUiTriggerApi(APIBaseTest):@parameterized.expand([- ("team_unset", []),- ("other_team", [999_999]),+ ("flag_off", False, False),+ ("flag_missing", None, False),+ ("staff_with_flag_off", False, True),])+ @patch(_ACCESS)+ @patch(_START_RESOLUTION)@patch(_START)- def test_rejected_unless_the_project_is_the_reviewhog_team(self, _name, team_setting, mock_start):- with override_settings(REVIEWHOG_TEAM_IDS=team_setting):- resp = self._trigger("https://github.com/PostHog/posthog/pull/1")+ def test_project_endpoints_require_the_feature_flag(+ self,+ _name: str,+ flag_value: bool | None,+ is_staff: bool,+ mock_start: MagicMock,+ mock_start_resolution: MagicMock,+ mock_access: MagicMock,+ ) -> None:+ self.mock_feature_flag.return_value = flag_value+ self.user.is_staff = is_staff+ self.user.save(update_fields=["is_staff"])+ endpoints: list[tuple[str, str, dict[str, str | bool]]] = [+ ("get", "settings/", {}),+ ("patch", "settings/", {"resolve_comments": False}),+ ("get", "reviews/", {}),+ ("get", f"reviews/{uuid4()}/", {}),+ ("get", "reviews/perspective_stats/", {}),+ ("post", "reviews/trigger/", {"pr_url": "https://github.com/example/repository/pull/1"}),+ (+ "post",+ "reviews/trigger/",+ {"pr_url": "https://github.com/example/repository/pull/1", "run_mode": "resolve_only"},+ ),+ ("get", "perspectives/", {}),+ ("patch", "perspectives/review-hog-perspective-logic-correctness/", {"enabled": False}),+ ("get", "validators/", {}),+ ("patch", "validators/review-hog-validation-criteria/", {"active": True}),+ ("get", "blind_spots/", {}),+ ("patch", "blind_spots/review-hog-blind-spots-general/", {"active": True}),+ ("get", "resolution/", {}),+ ("patch", "resolution/review-hog-resolution-criteria/", {"active": True}),+ ]+ with override_settings(REVIEWHOG_TEAM_IDS=[self.team.id]):+ for method, path, data in endpoints:+ with self.subTest(method=method, path=path, data=data):+ response = getattr(self.client, method)(+ f"/api/projects/{self.team.id}/review_hog/{path}", data, format="json"+ )+ self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN, response.content)- self.assertEqual(resp.status_code, status.HTTP_403_FORBIDDEN)mock_start.assert_not_called()+ mock_start_resolution.assert_not_called()+ mock_access.assert_not_called()+ self.assertFalse(ReviewSkillConfig.objects.for_team(self.team.id).exists())+ self.assertFalse(ReviewUserSettings.objects.for_team(self.team.id).exists())+ self.assertFalse(LLMSkill.objects.filter(team=self.team).exists())@patch(_START)def test_non_pr_github_url_rejected(self, mock_start):@@ -351,13 +413,22 @@ class TestReviewHogUiTriggerApi(APIBaseTest):@parameterized.expand([- ("reviewhog_team", True),- ("other_team", False),+ ("automation_project", True),+ ("manual_project", False),])- def test_settings_expose_whether_reviews_can_be_triggered_here(self, _name, is_reviewhog_team):- with override_settings(REVIEWHOG_TEAM_IDS=[self.team.id] if is_reviewhog_team else [self.team.id + 1]):+ @patch("products.review_hog.backend.api.settings.has_reviewable_repo_config", return_value=False)+ def test_settings_enable_manual_reviews_independently_of_automation(+ self, _name: str, is_automation_project: bool, mock_stamphog: MagicMock+ ) -> None:+ legacy_teams = [self.team.id] if is_automation_project else [self.team.id + 1, self.team.id]+ with override_settings(REVIEWHOG_TEAM_IDS=legacy_teams):resp = self.client.get(f"/api/projects/{self.team.id}/review_hog/settings/")self.assertEqual(resp.status_code, status.HTTP_200_OK)- self.assertEqual(resp.json()["can_trigger_reviews"], is_reviewhog_team)+ self.assertIs(resp.json()["can_trigger_reviews"], True)+ self.assertEqual(resp.json()["show_internal_features"], is_automation_project)+ if is_automation_project:+ mock_stamphog.assert_called_once_with(self.team.id)+ else:+ mock_stamphog.assert_not_called()diff --git a/products/review_hog/backend/tests/test_validator_config_api.py b/products/review_hog/backend/tests/test_validator_config_api.pyindex 64904370b0db..5d66803608ee 100644--- a/products/review_hog/backend/tests/test_validator_config_api.py+++ b/products/review_hog/backend/tests/test_validator_config_api.py@@ -1,4 +1,5 @@from posthog.test.base import APIBaseTest+from unittest.mock import patchfrom parameterized import parameterized@@ -19,6 +20,7 @@ _CUSTOM = f"{REVIEW_HOG_VALIDATION_PREFIX}strict"class TestReviewValidatorConfigAPI(APIBaseTest):def setUp(self) -> None:super().setUp()+ self.enterContext(patch("posthoganalytics.feature_enabled", return_value=True))sync_canonical_validation(self.team)self.base = f"/api/projects/{self.team.id}/review_hog/validators"diff --git a/products/review_hog/frontend/CodeReviewScene.stories.tsx b/products/review_hog/frontend/CodeReviewScene.stories.tsxindex f7001c504b19..92110ba3ce73 100644--- a/products/review_hog/frontend/CodeReviewScene.stories.tsx+++ b/products/review_hog/frontend/CodeReviewScene.stories.tsx@@ -1,6 +1,9 @@+import { MOCK_DEFAULT_USER } from 'lib/api.mock'+import { Meta, StoryObj } from '@storybook/react'import { FEATURE_FLAGS } from 'lib/constants'+import { userLogic } from 'scenes/userLogic'import { mswDecorator } from '~/mocks/browser'@@ -9,6 +12,8 @@ import type {ReviewUserSettingsApi,} from 'products/review_hog/frontend/generated/api.schemas'+import { expect, waitFor, within } from 'storybook/test'+import { CodeReviewScene } from './CodeReviewScene'const defaultSettings: ReviewUserSettingsApi = {@@ -16,11 +21,13 @@ const defaultSettings: ReviewUserSettingsApi = {stamphog_review_inbox_prs: false,review_labeled_prs: true,resolve_comments: true,+ celebrate_clean_reviews: true,review_authored_prs: false,flash_reasoning_effort: 'medium',urgency_threshold: 'consider',can_trigger_reviews: true,- stamphog_connected: true,+ show_internal_features: false,+ stamphog_connected: false,}const meta: Meta<typeof CodeReviewScene> = {@@ -31,10 +38,24 @@ const meta: Meta<typeof CodeReviewScene> = {featureFlags: [FEATURE_FLAGS.REVIEW_HOG],},decorators: [+ (Story): JSX.Element => (+ <div className="p-4">+ <Story />+ </div>+ ),(Story, context): JSX.Element => {- let settings = { ...defaultSettings }+ let settings: ReviewUserSettingsApi = {+ ...defaultSettings,+ show_internal_features: context.parameters.showInternalFeatures ?? false,+ stamphog_connected: context.parameters.showInternalFeatures ?? false,+ ...context.parameters.savedSettings,+ }return mswDecorator({get: {+ '/api/users/@me/': () => [+ 200,+ { ...MOCK_DEFAULT_USER, is_staff: context.parameters.isStaff ?? false },+ ],'/api/projects/:team_id/review_hog/settings/': () => [200, settings],'/api/projects/:team_id/review_hog/reviews/': { results: [], has_more: false },'/api/projects/:team_id/review_hog/reviews/perspective_stats/': {@@ -61,7 +82,59 @@ export default metatype Story = StoryObj<typeof CodeReviewScene>-export const Default: Story = {}+export const Default: Story = {+ play: async ({ canvasElement }) => {+ userLogic.actions.loadUser()+ await waitFor(() => expect(userLogic.values.user?.is_staff).toBe(false))+ const canvas = within(canvasElement)+ await expect(await canvas.findByText('Review a pull request')).toBeVisible()+ await expect(canvas.queryByLabelText('Review all your Inbox PRs')).not.toBeInTheDocument()+ await expect(canvas.queryByLabelText('Let Stamphog review your Inbox PRs')).not.toBeInTheDocument()+ await expect(canvas.queryByLabelText('Review all your PRs with the reviewhog label')).not.toBeInTheDocument()+ await expect(canvas.queryByLabelText('Review all your PRs in Flash mode')).not.toBeInTheDocument()+ await expect(canvas.getByLabelText('Resolve comments on your PRs')).toBeVisible()+ await expect(canvas.getByLabelText('Celebrate clean reviews')).toBeVisible()+ await expect(canvas.queryByText('Flash strength')).not.toBeInTheDocument()+ },+}++export const InternalFeatures: Story = {+ parameters: { showInternalFeatures: true },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement)+ await expect(await canvas.findByLabelText('Review all your Inbox PRs')).toBeVisible()+ await expect(canvas.getByLabelText('Let Stamphog review your Inbox PRs')).toBeVisible()+ await expect(canvas.getByLabelText('Review all your PRs with the reviewhog label')).toBeVisible()+ await expect(canvas.getByLabelText('Review all your PRs in Flash mode')).toBeVisible()+ await expect(canvas.getByText('Flash strength')).toBeVisible()+ },+}++export const SavedInboxOptIns: Story = {+ parameters: { savedSettings: { review_inbox_prs: true, stamphog_review_inbox_prs: true } },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement)+ const inboxSwitch = await canvas.findByLabelText('Review all your Inbox PRs')+ const stamphogSwitch = canvas.getByLabelText('Let Stamphog review your Inbox PRs')+ await expect(inboxSwitch).toBeChecked()+ await expect(inboxSwitch).toBeEnabled()+ await expect(stamphogSwitch).toBeChecked()+ await expect(stamphogSwitch).toBeEnabled()+ await expect(canvas.queryByLabelText('Review all your PRs with the reviewhog label')).not.toBeInTheDocument()+ await expect(canvas.queryByLabelText('Review all your PRs in Flash mode')).not.toBeInTheDocument()+ },+}++export const FlagDisabledForStaff: Story = {+ parameters: { featureFlags: [], isStaff: true },+ play: async ({ canvasElement }) => {+ userLogic.actions.loadUser()+ await waitFor(() => expect(userLogic.values.user?.is_staff).toBe(true))+ const canvas = within(canvasElement)+ await expect(await canvas.findByText('Page not found')).toBeVisible()+ await expect(canvas.queryByText('Review a pull request')).not.toBeInTheDocument()+ },+}export const Narrow: Story = {decorators: [diff --git a/products/review_hog/frontend/CodeReviewScene.tsx b/products/review_hog/frontend/CodeReviewScene.tsxindex 2e1d1ca0e5ac..97a42cd6f965 100644--- a/products/review_hog/frontend/CodeReviewScene.tsx+++ b/products/review_hog/frontend/CodeReviewScene.tsx@@ -46,7 +46,6 @@ import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { SceneExport } from 'scenes/sceneTypes'import { urls } from 'scenes/urls'-import { userLogic } from 'scenes/userLogic'import { SceneContent } from '~/layout/scenes/components/SceneContent'import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'@@ -682,8 +681,7 @@ function RecentReviewsSection(): JSX.Element | null {* start a publishing review, acting as the requesting user. A review resolves the PR's comment* threads afterwards when the user's resolve_comments setting is on; the split button's side* actions are the per-run variants (review without resolving / resolve only / flash). Hidden unless the- * backend says this project can trigger reviews (limited to the designated ReviewHog team while- * in alpha).+ * backend says this project can trigger reviews.*/function TriggerReviewSection(): JSX.Element | null {const { settings, triggerPrUrl, triggeringReview, triggerUrlResolving } = useValues(reviewHogSettingsLogic)@@ -746,13 +744,17 @@ function TriggerReviewSection(): JSX.Element | null {>Only resolve existing comments</LemonButton>- <LemonButton- fullWidth- onClick={() => submitTriggerReview(ReviewTriggerRequestRunModeEnumApi.Flash)}- tooltip="A faster, cheaper review that never resolves comments. Every message it posts is marked FLASH MODE."- >- Review in Flash mode- </LemonButton>+ {settings.show_internal_features && (+ <LemonButton+ fullWidth+ onClick={() =>+ submitTriggerReview(ReviewTriggerRequestRunModeEnumApi.Flash)+ }+ tooltip="A faster, cheaper review that never resolves comments. Every message it posts is marked FLASH MODE."+ >+ Review in Flash mode+ </LemonButton>+ )}</>),},@@ -1151,81 +1153,90 @@ function TriggersSection(): JSX.Element {return (<section className="flex flex-col gap-4 border-t border-primary pt-8"><SectionHeader icon={<IconFilter />} title="What gets reviewed">- Choose which pull requests PostHog Review picks up automatically, and whether reviews also resolve the- comment threads on them.+ {settings?.show_internal_features+ ? 'Choose which pull requests PostHog Review picks up automatically, and whether reviews also resolve the comment threads on them.'+ : 'Choose whether reviews also resolve comment threads and how clean reviews appear on your pull requests.'}</SectionHeader><LemonCard hoverEffect={false} className="divide-y divide-primary p-0">- <div className="flex items-center gap-4 p-4">- <div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary *:h-auto *:w-5">- <Logomark />- </div>- <div className="min-w-0 flex-1">- <div className="text-sm font-semibold">Review all your Inbox PRs</div>- <div className="text-xs text-secondary">- When a self-driving implementation from your Inbox opens a pull request, PostHog Review- reviews it and posts the review to the pull request automatically.+ {/* Inbox reviews start in any project with a saved opt-in, so a switch that is on stays visible+ and the user can turn it off. */}+ {(settings?.show_internal_features || settings?.review_inbox_prs) && (+ <div className="flex items-center gap-4 p-4">+ <div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary *:h-auto *:w-5">+ <Logomark /></div>- </div>- <LemonSwitch- aria-label="Review all your Inbox PRs"- checked={settings?.review_inbox_prs ?? false}- onChange={(checked) => updateSettings({ review_inbox_prs: checked })}- disabledReason={switchDisabledReason}- />- </div>- <div className="flex items-center gap-4 p-4">- <div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary">- <IconStamphog className="size-5" />- </div>- <div className="min-w-0 flex-1">- <div className="text-sm font-semibold">Let Stamphog review your Inbox PRs</div>- <div className="text-xs text-secondary">- When a self-driving implementation from your Inbox opens a pull request, Stamphog reviews it- and approves it if it passes.+ <div className="min-w-0 flex-1">+ <div className="text-sm font-semibold">Review all your Inbox PRs</div>+ <div className="text-xs text-secondary">+ When a self-driving implementation from your Inbox opens a pull request, PostHog Review+ reviews it and posts the review to the pull request automatically.+ </div></div>+ <LemonSwitch+ aria-label="Review all your Inbox PRs"+ checked={settings?.review_inbox_prs ?? false}+ onChange={(checked) => updateSettings({ review_inbox_prs: checked })}+ disabledReason={switchDisabledReason}+ /></div>- <LemonSwitch- aria-label="Let Stamphog review your Inbox PRs"- checked={settings?.stamphog_review_inbox_prs ?? false}- onChange={(checked) => updateSettings({ stamphog_review_inbox_prs: checked })}- disabledReason={- // A switch that is already on stays usable while disconnected, so- // turning it off never requires connecting Stamphog first.- settings && !settings.stamphog_connected && !settings.stamphog_review_inbox_prs- ? 'Connect a repository to Stamphog first. Stamphog is not set up for this project yet.'- : switchDisabledReason- }- />- </div>- <div className="flex items-center gap-4 p-4">- <div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary">- <IconGithub className="size-5" />+ )}+ {(settings?.show_internal_features || settings?.stamphog_review_inbox_prs) && (+ <div className="flex items-center gap-4 p-4">+ <div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary">+ <IconStamphog className="size-5" />+ </div>+ <div className="min-w-0 flex-1">+ <div className="text-sm font-semibold">Let Stamphog review your Inbox PRs</div>+ <div className="text-xs text-secondary">+ When a self-driving implementation from your Inbox opens a pull request, Stamphog+ reviews it and approves it if it passes.+ </div>+ </div>+ <LemonSwitch+ aria-label="Let Stamphog review your Inbox PRs"+ checked={settings?.stamphog_review_inbox_prs ?? false}+ onChange={(checked) => updateSettings({ stamphog_review_inbox_prs: checked })}+ disabledReason={+ // A switch that is already on stays usable while disconnected, so+ // turning it off never requires connecting Stamphog first.+ settings && !settings.stamphog_connected && !settings.stamphog_review_inbox_prs+ ? 'Connect a repository to Stamphog first. Stamphog is not set up for this project yet.'+ : switchDisabledReason+ }+ /></div>- <div className="min-w-0 flex-1">- <div className="text-sm font-semibold">- Review all your PRs with the{' '}- <CopyToClipboardInline- explicitValue="reviewhog"- description="label"- iconSize="xsmall"- className="rounded border border-warning bg-warning-highlight px-1.5 py-0.5 font-mono text-xs text-warning"- >- reviewhog- </CopyToClipboardInline>{' '}- label+ )}+ {settings?.show_internal_features && (+ <div className="flex items-center gap-4 p-4">+ <div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary">+ <IconGithub className="size-5" /></div>- <div className="text-xs text-secondary">- Add the reviewhog label to a pull request you author in a connected repository and PostHog- Review reviews it.+ <div className="min-w-0 flex-1">+ <div className="text-sm font-semibold">+ Review all your PRs with the{' '}+ <CopyToClipboardInline+ explicitValue="reviewhog"+ description="label"+ iconSize="xsmall"+ className="rounded border border-warning bg-warning-highlight px-1.5 py-0.5 font-mono text-xs text-warning"+ >+ reviewhog+ </CopyToClipboardInline>{' '}+ label+ </div>+ <div className="text-xs text-secondary">+ Add the reviewhog label to a pull request you author in a connected repository and+ PostHog Review reviews it.+ </div></div>+ <LemonSwitch+ aria-label="Review all your PRs with the reviewhog label"+ checked={settings?.review_labeled_prs ?? true}+ onChange={(checked) => updateSettings({ review_labeled_prs: checked })}+ disabledReason={switchDisabledReason}+ /></div>- <LemonSwitch- aria-label="Review all your PRs with the reviewhog label"- checked={settings?.review_labeled_prs ?? true}- onChange={(checked) => updateSettings({ review_labeled_prs: checked })}- disabledReason={switchDisabledReason}- />- </div>+ )}<div className="flex items-center gap-4 p-4"><div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary"><IconChat className="size-5" />@@ -1264,54 +1275,58 @@ function TriggersSection(): JSX.Element {/></div></LemonCard>- <div className="mt-2">- <h4 className="mb-1 text-sm font-semibold">ReviewHog Flash - Experimental</h4>- <p className="m-0 text-xs text-secondary">These settings apply only to Flash reviews.</p>- </div>- <LemonCard hoverEffect={false} className="divide-y divide-primary p-0">- <div className="flex items-center gap-4 p-4">- <div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary">- <IconBolt className="size-5" />+ {settings?.show_internal_features && (+ <>+ <div className="mt-2">+ <h4 className="mb-1 text-sm font-semibold">ReviewHog Flash - Experimental</h4>+ <p className="m-0 text-xs text-secondary">These settings apply only to Flash reviews.</p></div>- <div className="min-w-0 flex-1">- <div className="text-sm font-semibold">Review all your PRs in Flash mode</div>- <div className="text-xs text-secondary">- Automatically review PRs you author in PostHog/posthog, including drafts and new commits.- Starts with future PR activity.+ <LemonCard hoverEffect={false} className="divide-y divide-primary p-0">+ <div className="flex items-center gap-4 p-4">+ <div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary">+ <IconBolt className="size-5" />+ </div>+ <div className="min-w-0 flex-1">+ <div className="text-sm font-semibold">Review all your PRs in Flash mode</div>+ <div className="text-xs text-secondary">+ Automatically review PRs you author in PostHog/posthog, including drafts and new+ commits. Starts with future PR activity.+ </div>+ </div>+ <LemonSwitch+ aria-label="Review all your PRs in Flash mode"+ checked={settings?.review_authored_prs ?? false}+ onChange={(checked) => updateSettings({ review_authored_prs: checked })}+ disabledReason={switchDisabledReason}+ loading={settingsLoading}+ /></div>- </div>- <LemonSwitch- aria-label="Review all your PRs in Flash mode"- checked={settings?.review_authored_prs ?? false}- onChange={(checked) => updateSettings({ review_authored_prs: checked })}- disabledReason={switchDisabledReason}- loading={settingsLoading}- />- </div>- <div className="flex items-center gap-4 p-4">- <div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary">- <IconBalance className="size-5" />- </div>- <div className="min-w-0 flex-1">- <div className="text-sm font-semibold">Flash strength</div>- <div className="text-xs text-secondary">- Applies to automatic and manually requested Flash reviews. Extra high takes longer and costs- more.+ <div className="flex items-center gap-4 p-4">+ <div className="flex size-9 shrink-0 items-center justify-center rounded border border-primary bg-primary">+ <IconBalance className="size-5" />+ </div>+ <div className="min-w-0 flex-1">+ <div className="text-sm font-semibold">Flash strength</div>+ <div className="text-xs text-secondary">+ Applies to automatic and manually requested Flash reviews. Extra high takes longer+ and costs more.+ </div>+ </div>+ <LemonSelect<ReviewUserSettingsFlashReasoningEffortEnumApi>+ aria-label="Flash strength"+ value={settings?.flash_reasoning_effort ?? 'medium'}+ options={[+ { value: 'medium', label: 'Medium' },+ { value: 'xhigh', label: 'Extra high' },+ ]}+ onChange={(value) => updateSettings({ flash_reasoning_effort: value })}+ disabledReason={switchDisabledReason}+ loading={settingsLoading}+ /></div>- </div>- <LemonSelect<ReviewUserSettingsFlashReasoningEffortEnumApi>- aria-label="Flash strength"- value={settings?.flash_reasoning_effort ?? 'medium'}- options={[- { value: 'medium', label: 'Medium' },- { value: 'xhigh', label: 'Extra high' },- ]}- onChange={(value) => updateSettings({ flash_reasoning_effort: value })}- disabledReason={switchDisabledReason}- loading={settingsLoading}- />- </div>- </LemonCard>+ </LemonCard>+ </>+ )}</section>)}@@ -1780,16 +1795,14 @@ export const scene: SceneExport = {* The "Code review" scene: ReviewHog's combined onboarding and settings page. One scrollable* guided-configuration page — every control is live from load, no save step. See* `reviewHogSettingsLogic` for the data flow. Access is gated on FEATURE_FLAGS.REVIEW_HOG, the same- * flag that shows the menu entry, so whoever discovers the entry can open the page. Staff bypass the- * flag, keeping the page reachable by direct URL where the flag is off.+ * flag that shows the menu entry, so whoever discovers the entry can open the page.*/export function CodeReviewScene(): JSX.Element {- const { user } = useValues(userLogic)const { featureFlags } = useValues(featureFlagLogic)const { blindSpots, validators, resolutionSkills, initialLoadFailed } = useValues(reviewHogSettingsLogic)const { selectBlindSpots, selectValidator, selectResolutionSkill, loadAll } = useActions(reviewHogSettingsLogic)- if (user != null && !user.is_staff && !featureFlags[FEATURE_FLAGS.REVIEW_HOG]) {+ if (!featureFlags[FEATURE_FLAGS.REVIEW_HOG]) {return <NotFound object="page" />}diff --git a/products/review_hog/frontend/generated/api.schemas.ts b/products/review_hog/frontend/generated/api.schemas.tsindex b3f4e3932470..990e27cefc59 100644--- a/products/review_hog/frontend/generated/api.schemas.ts+++ b/products/review_hog/frontend/generated/api.schemas.ts@@ -559,8 +559,10 @@ export interface ReviewUserSettingsApi {* * `should_fix` - Should Fix* * `must_fix` - Must Fix */urgency_threshold?: ReviewUserSettingsUrgencyThresholdEnumApi- /** Whether reviews can be started from this project's Code review page (the UI trigger is limited to the designated ReviewHog teams while the product is in alpha). */+ /** Whether reviews can be started from this project's Code review page. */readonly can_trigger_reviews: boolean+ /** Whether to show Flash mode and settings for automatic, label-triggered, and Inbox reviews. */+ readonly show_internal_features: boolean/** Whether this project has at least one synced, enabled Stamphog repository. When false, the stamphog_review_inbox_prs toggle has nothing to act on and the UI renders it disabled with a pointer to connect the Stamphog GitHub App. */readonly stamphog_connected: boolean}@@ -589,8 +591,10 @@ export interface PatchedReviewUserSettingsApi {* * `should_fix` - Should Fix* * `must_fix` - Must Fix */urgency_threshold?: ReviewUserSettingsUrgencyThresholdEnumApi- /** Whether reviews can be started from this project's Code review page (the UI trigger is limited to the designated ReviewHog teams while the product is in alpha). */+ /** Whether reviews can be started from this project's Code review page. */readonly can_trigger_reviews?: boolean+ /** Whether to show Flash mode and settings for automatic, label-triggered, and Inbox reviews. */+ readonly show_internal_features?: boolean/** Whether this project has at least one synced, enabled Stamphog repository. When false, the stamphog_review_inbox_prs toggle has nothing to act on and the UI renders it disabled with a pointer to connect the Stamphog GitHub App. */readonly stamphog_connected?: boolean}diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex c3750d4b8570..9e2c66cf4829 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -79392,8 +79392,10 @@ export namespace Schemas {* * `should_fix` - Should Fix* * `must_fix` - Must Fix */urgency_threshold?: ReviewUserSettingsUrgencyThresholdEnum;- /** Whether reviews can be started from this project's Code review page (the UI trigger is limited to the designated ReviewHog teams while the product is in alpha). */+ /** Whether reviews can be started from this project's Code review page. */readonly can_trigger_reviews?: boolean;+ /** Whether to show Flash mode and settings for automatic, label-triggered, and Inbox reviews. */+ readonly show_internal_features?: boolean;/** Whether this project has at least one synced, enabled Stamphog repository. When false, the stamphog_review_inbox_prs toggle has nothing to act on and the UI renders it disabled with a pointer to connect the Stamphog GitHub App. */readonly stamphog_connected?: boolean;}@@ -90934,8 +90936,10 @@ export namespace Schemas {* * `should_fix` - Should Fix* * `must_fix` - Must Fix */urgency_threshold?: ReviewUserSettingsUrgencyThresholdEnum;- /** Whether reviews can be started from this project's Code review page (the UI trigger is limited to the designated ReviewHog teams while the product is in alpha). */+ /** Whether reviews can be started from this project's Code review page. */readonly can_trigger_reviews: boolean;+ /** Whether to show Flash mode and settings for automatic, label-triggered, and Inbox reviews. */+ readonly show_internal_features: boolean;/** Whether this project has at least one synced, enabled Stamphog repository. When false, the stamphog_review_inbox_prs toggle has nothing to act on and the UI renders it disabled with a pointer to connect the Stamphog GitHub App. */readonly stamphog_connected: boolean;}