: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
fix(signals): gate metric controls with monitoring (#130048)
Mikayla Thompsonc13312f8db94
diff --git a/docs/internal/signals-pr-lifecycle.md b/docs/internal/signals-pr-lifecycle.mdindex ef3fb7c93889..c52d502fc0fd 100644--- a/docs/internal/signals-pr-lifecycle.md+++ b/docs/internal/signals-pr-lifecycle.md@@ -88,11 +88,11 @@ Report reads, research selection, and snapshot refresh use the same filter checkSnapshot refresh still requires access to both the live query and the shared measurement.A viewer with a property grant can read the live query while the team's default property restrictions keep the shared snapshot hidden.-Research writes measurable outcome goals as `metric_threshold` report checks and investigative goals as `agent` checks. A metric check stores a bounded live query, baseline, comparison, and soak window; the query and display format are copied from its report metric when it names one. Metric checks execute only during enabled Monitoring; flag-off agent checks use the legacy scout path described above. The coordinator records interim metric observations within each check's soak window; final metric evaluation records fixed-window results after each deadline. Authored agent checks run the selected scout, or its existing fallback, after their own original soak. They retain the normal scout skill, tools, credentials, runtime selection, and memory, with a per-run brief naming the original attempt, definition, environment, and fixed window. Only an assigned Monitoring scout receives the internal capability for `scout-monitoring-result-submit`. It submits evidence qualification, expectation match, explanation, and references through that tool while still running. The server derives the attempt, check, definition, and fixed window from its persisted assignment. Invalid submissions return field errors without storing an evaluation or consuming an evaluation retry; the scout corrects them within the same run. Accepted results are immutable and identical retries return the stored result. A normal prose close-out does not submit a verdict. Workflow finalization records a bounded technical error only when no result was accepted; retries recover the same scout run through an indexed brief binding. Authored agent checks on child environments remain deferred, including previously queued dispatches, because scout history, task artifacts, and memory are project-owned. They create no execution artifacts or extra credential grants and consume no evaluation retries. Parent-environment checks retain normal scout credentials. The Monitoring brief overrides scheduled skill routines and legacy check callbacks; full skill loading and normal tools remain available. Submission does not wait for task finalization and leaves the report in Monitoring. Dispatch attempts back off for one hour and selection prioritizes the least recently attempted due checks, so paused or busy scouts cannot monopolize the team's due-check cap even after the backoff expires. A new Monitoring attempt clears that backoff. Agent dispatch reserves half of its available slots and time for interim metric measurements, so deferred agents cannot consume the whole tick. Execution failures before a scout run exists and close-outs containing PostgreSQL-incompatible text record errored evaluations; skips remain deferred. Normal enrollment, pause, run budget, spend, and execution gates apply. Technical errors use the same bounded final-check retry delays as metrics. Aggregation, automatic completion, report-level assessment, and linked follow-up research remain separate work. With Monitoring enabled, resolving a report stops execution, including recurrence checks. Historical results remain readable. New metric checks validate count, rate, duration, baseline, and threshold values using the same rules as report metrics; existing configurations remain readable. A later research pass reviews every open check, preserves unchanged checks and their approvals, replaces changed checks, and retires omitted checks. A failed verification turn leaves existing checks alone. Verification can revise only Expected impact; other summary sections and their chart links must remain intact. The full replacement schedule, including its soak and measurement window, must finish before the 90-day horizon. The Follow-up checks sidebar shows schedules and results for both kinds. The Expected impact section uses the same metric checks to show goals and charts, behind the person-level `signals-expected-impact` display flag. A person can mark those measurements "Looks good" as a quality signal; approval does not control scheduling or execution. The "Suggest different metrics" action starts a discussion that can atomically replace relevant open metric checks while preserving unrelated checks. A failed replacement leaves the original running, and a successful replacement starts unapproved. Report observation metrics remain separate from these forward-looking checks.+Research writes measurable outcome goals as `metric_threshold` report checks and investigative goals as `agent` checks. A metric check stores a bounded live query, baseline, comparison, and soak window; the query and display format are copied from its report metric when it names one. Metric checks execute only during enabled Monitoring; flag-off agent checks use the legacy scout path described above. The coordinator records interim metric observations within each check's soak window; final metric evaluation records fixed-window results after each deadline. Authored agent checks run the selected scout, or its existing fallback, after their own original soak. They retain the normal scout skill, tools, credentials, runtime selection, and memory, with a per-run brief naming the original attempt, definition, environment, and fixed window. Only an assigned Monitoring scout receives the internal capability for `scout-monitoring-result-submit`. It submits evidence qualification, expectation match, explanation, and references through that tool while still running. The server derives the attempt, check, definition, and fixed window from its persisted assignment. Invalid submissions return field errors without storing an evaluation or consuming an evaluation retry; the scout corrects them within the same run. Accepted results are immutable and identical retries return the stored result. A normal prose close-out does not submit a verdict. Workflow finalization records a bounded technical error only when no result was accepted; retries recover the same scout run through an indexed brief binding. Authored agent checks on child environments remain deferred, including previously queued dispatches, because scout history, task artifacts, and memory are project-owned. They create no execution artifacts or extra credential grants and consume no evaluation retries. Parent-environment checks retain normal scout credentials. The Monitoring brief overrides scheduled skill routines and legacy check callbacks; full skill loading and normal tools remain available. Submission does not wait for task finalization and leaves the report in Monitoring. Dispatch attempts back off for one hour and selection prioritizes the least recently attempted due checks, so paused or busy scouts cannot monopolize the team's due-check cap even after the backoff expires. A new Monitoring attempt clears that backoff. Agent dispatch reserves half of its available slots and time for interim metric measurements, so deferred agents cannot consume the whole tick. Execution failures before a scout run exists and close-outs containing PostgreSQL-incompatible text record errored evaluations; skips remain deferred. Normal enrollment, pause, run budget, spend, and execution gates apply. Technical errors use the same bounded final-check retry delays as metrics. Aggregation, automatic completion, report-level assessment, and linked follow-up research remain separate work. With Monitoring enabled, resolving a report stops execution, including recurrence checks. Historical results remain readable. New metric checks validate count, rate, duration, baseline, and threshold values using the same rules as report metrics; existing configurations remain readable. A later research pass reviews every open check, preserves unchanged checks and their approvals, replaces changed checks, and retires omitted checks. A failed verification turn leaves existing checks alone. Verification can revise only Expected impact; other summary sections and their chart links must remain intact. The full replacement schedule, including its soak and measurement window, must finish before the 90-day horizon. The Follow-up checks sidebar shows schedules and results for both kinds. The Expected impact section uses the same metric checks to show goals and charts, behind the `signals-report-monitoring` flag, together with its suggestion action. A person can mark those measurements "Looks good" as a quality signal; approval does not control scheduling or execution. The "Suggest different metrics" action starts a discussion that can atomically replace relevant open metric checks while preserving unrelated checks. A failed replacement leaves the original running, and a successful replacement starts unapproved. Report observation metrics remain separate from these forward-looking checks.-Reports awaiting human input retain their generated checks for a later Monitoring period. Outside Monitoring, open checks display as paused in the Follow-up checks sidebar. Expected impact retains proposed or approved measurement labels before Monitoring, and shows paused checks on resolved or archived reports, including when the rollout is disabled. Stored schedules do not advertise future runs or active scouts. Historical verdicts and legacy schedule fields remain readable; remaining-run counts authorize post-resolution execution only for flag-off agent checks. Metric replacements require access to the query they schedule and an explicit `config.monitoring` definition. Callers can configure `soak_minutes` and `run_interval_minutes`. Omitted duration preserves the existing window, including zero. Replacements use one terminal evaluation: `runs_remaining` may be omitted or set to 1; higher counts are rejected. Legacy recurrence counts are not copied into a Monitoring replacement. Replacing during active Monitoring creates a fresh attempt containing the replacement, every other open check, and errored or expired snapshot members still awaiting final verification. It restarts their observation windows and expiry horizons. The previous attempt and its results remain historical; unrelated check definitions and approvals stay unchanged. Omitted cadence uses the current Monitoring authoring defaults, enabling interim measurements for windows longer than six hours. Shorter windows remain valid without interim samples. Creation and replacement share full schedule validation against the 90-day horizon. A replacement rejects a check moved by a concurrent report merge; reload the report and retry on the survivor. Units cannot contain null characters or unpaired Unicode surrogates. The Expected impact section shows finished verdicts and refreshes after agent tasks change checks.+Reports awaiting human input retain their generated checks for a later Monitoring period. Outside Monitoring, open checks display as paused in the Follow-up checks sidebar. Expected impact retains proposed or approved measurement labels before Monitoring, and shows paused checks on resolved or archived reports, while Monitoring is enabled. Stored schedules do not advertise future runs or active scouts. Historical verdicts and legacy schedule fields remain readable; remaining-run counts authorize post-resolution execution only for flag-off agent checks. Metric replacements require access to the query they schedule and an explicit `config.monitoring` definition. Callers can configure `soak_minutes` and `run_interval_minutes`. Omitted duration preserves the existing window, including zero. Replacements use one terminal evaluation: `runs_remaining` may be omitted or set to 1; higher counts are rejected. Legacy recurrence counts are not copied into a Monitoring replacement. Replacing during active Monitoring creates a fresh attempt containing the replacement, every other open check, and errored or expired snapshot members still awaiting final verification. It restarts their observation windows and expiry horizons. The previous attempt and its results remain historical; unrelated check definitions and approvals stay unchanged. Omitted cadence uses the current Monitoring authoring defaults, enabling interim measurements for windows longer than six hours. Shorter windows remain valid without interim samples. Creation and replacement share full schedule validation against the 90-day horizon. A replacement rejects a check moved by a concurrent report merge; reload the report and retry on the survivor. Units cannot contain null characters or unpaired Unicode surrogates. The Expected impact section shows finished verdicts and refreshes after agent tasks change checks.-Open follow-up check cards expand on hover or keyboard focus to show **Suggest a better metric** and **Cancel this check**. The cards stay compact otherwise, with both actions always visible on touch devices. Suggesting a metric opens the report's AI sidebar with an editable prompt referencing the selected check by ID. Opening a task for another report clears the unsent suggestion. Submitting asks AI to investigate and replace only that check, preserving unrelated checks and the report state. The existing check remains live if AI cannot establish a credible metric or the replacement is invalid. Cancellation confirms first and preserves recorded results.+Open follow-up check cards expand on hover or keyboard focus to show **Cancel this check** and, when `signals-report-monitoring` is enabled, **Suggest a better metric**. The cards stay compact otherwise, with available actions always visible on touch devices. The same flag controls the whole Expected impact measurement block, including **Suggest different metrics**, the replacement MCP tool, and the replacement API endpoint. Suggesting a metric opens the report's AI sidebar with an editable prompt referencing the selected check by ID. Opening a task for another report clears the unsent suggestion. Submitting asks AI to investigate and replace only that check, preserving unrelated checks and the report state. The existing check remains live if AI cannot establish a credible metric or the replacement is invalid. Cancellation confirms first and preserves recorded results.The `inbox-report-checks-replace` MCP tool can replace an open agent or metric check with a metric check. It requires `inbox:write` and `query:read`. Query-specific event, action, and cohort permissions still apply. The `signals-report-monitoring` flag gates the replacement API, MCP tool, and metric suggestion actions. The legacy replacement rollout flag does not make replacement available when Monitoring is disabled.@@ -643,7 +643,7 @@ Verification proposals can name `existing_check_id` to revise an open check whilResearch traces that contain existing metric-check context require the same analytics permissions as the check query and baseline, including for resumed runs, Max task tools, trace analysis, task summaries, and run details. A sandbox token’s exception covers only the run on which the server records its token ID; task-wide reads and other runs still require analytics access. Checks without a stored query contribute neither a query marker nor an unproven baseline to the research trace. Authorized readers retain summaries and run details; direct storage links remain withheld. Query provenance is private server-owned run state inherited on resume, so ordinary task reads do not scan ancestors. Legacy checks inherit missing display formats only from a report metric with the same stored query. When a suggestion task finishes, the selected report refreshes its prose as well as its checks.-Metric suggestions are available only when `signals-report-checks-replace` enables the replacement tool.+Metric suggestions and the Expected impact measurement block are available only when `signals-report-monitoring` is enabled.The note names proposed follow-up checks without claiming they were scheduled. The Follow-up checks sidebar shows the stored checks. Verification permits five submissions: the initial proposal and up to four correction turns on the same research session. Each correction receives the latest failing fields and validation rules. Only verification output is retried; completed research is retained, and existing execution deadlines still apply. Exhausted correction or failed check persistence preserves existing checks and the presentation summary, records a server-owned `check_authoring` failure, and adds a visible work-log note. With Monitoring enabled, implementation completion and plan roll-up read the authoring outcome from the locked report’s writer connection and cannot automatically resolve without checks while that failure is current. Existing applicable checks can still enter Monitoring. A later successfully saved plan clears the blocker, including an explicitly empty plan; manual resolution remains available. An explicitly empty, valid check list still retires omitted checks. Legacy activity payloads preserve approved, person-authored, and nonpending checks. Referenced checks inherit their existing wait when the proposal omits it. Verification’s revised summary is saved only after its check reconciliation succeeds.diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex d43cd7b386f0..73a89b23a7d7 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -12255,13 +12255,13 @@ snapshots:scenes-app-inbox-detail--pull-request-stack--light:hash: v1.k794b7964.192d4d81438253642d3303b5273cf774d51e3a7ca82e34af187e2013bef5626c.mW9HWXUPYuvOHbsSHtZMH99RACA88QZAZ2_lcSyTGSwscenes-app-inbox-detail--report--dark:- hash: v1.k794b7964.7c43c705da10b4b48a796b97a8987dae58bfa2abbb0dd0086c9d3c8bffe8a9ca.yTkLHcjOHnpnzAiFaubmHqfxyKop4mterGMw4_x3C1Q+ hash: v1.k794b7964.2a542de2cc345264d9a787a090d8d5bc2f8296d1d83b222d90b0425bc305e343.COAZUrlPTrGHwijE63B6H45E7MPvI4Nq4qw_fBMT9w4scenes-app-inbox-detail--report--light:- hash: v1.k794b7964.fc593578f41dd620279d83b383ba2323d42fdf8aa3bdf88e2bdbd01b0fc46138.zSwvmQ4h6cJ85p5TK3Su7ATQnokSkQirrM2fy9H4zjI+ hash: v1.k794b7964.1afea589bee916211cfb7d2a9d016c23ca92c580692388a2d6a5c41017db5510.TXknkYjlSLIGh1fcRwm9mo4bFRoELzQ67J8b44DQEd4scenes-app-inbox-detail--report-claimed-by-teammate--dark:hash: v1.k794b7964.dbc1dc269c035fcb3f805fdb32ffdbbd49b02c1f6ec7f758591587987d455ab0.KK2MHML3KIAjGVRoQ5-emiTK5Ol7MSAidoP6TUyeFJUscenes-app-inbox-detail--report-claimed-by-teammate--light:- hash: v1.k794b7964.c575fb8257b8399e6d29d07f010f21b8638ff1e99f16968505ab0831110b1277.XWIcrb_PoStFOkmmJlkVR87DKH1FlLA21vM_dMs3kKA+ hash: v1.k794b7964.350cb16fcc9d22b882659fb7dbe68905b73f32d8824c82e3d2dafdcb1a3d9829.t2cSRZqiU2TFlGsreagfTD0QBi8KpeyqTZDgFMy3XPUscenes-app-inbox-detail--report-follow-up-pending--dark:hash: v1.k794b7964.82ef2f59a9c5e631411e1706af5e1c4e2ff7b906935a2fadadcd30e44b11cc82.r5NkpEG7ogX6mdOsOzD0CThSFKk9HzszpaLrRmCFmKwscenes-app-inbox-detail--report-follow-up-pending--light:@@ -12283,9 +12283,9 @@ snapshots:scenes-app-inbox-detail--report-plan-step--light:hash: v1.k794b7964.ea6dc56c3aa2b4ff79bbf7684c7687cd7d27b682a15b05fcb74714d3c12c5eb5.TCOvoul_RiZOoXqWG8y-F6jOuI_PGYZ38rrdk3xkw2Mscenes-app-inbox-detail--report-ready-to-implement--dark:- hash: v1.k794b7964.7c43c705da10b4b48a796b97a8987dae58bfa2abbb0dd0086c9d3c8bffe8a9ca.qW7wNvzQFKV4DDH7VxALp3zIQyXGRfi0A4ynDjT62aI+ hash: v1.k794b7964.2a542de2cc345264d9a787a090d8d5bc2f8296d1d83b222d90b0425bc305e343.Fcf4pCWAyx9RLN7R6iZ8yRPOs-AgGd6V5cAZ8A_-TVEscenes-app-inbox-detail--report-ready-to-implement--light:- hash: v1.k794b7964.fc593578f41dd620279d83b383ba2323d42fdf8aa3bdf88e2bdbd01b0fc46138.UMetUbp9jKnpleWGuy2aVo4C7PWeYKOqEvMe9v4swHk+ hash: v1.k794b7964.1afea589bee916211cfb7d2a9d016c23ca92c580692388a2d6a5c41017db5510.ffms4i4-XwCt86wGhKqmsGc86-AwD-KafgXeei-dfM0scenes-app-inbox-detail--report-with-follow-up-metric--dark:hash: v1.k794b7964.2383e17cf6fdac5a8a6fb0bc40458811c942bb77af733800505bb9faafd65b92.k2mrOLBhtvJH0p1WlDVuwnBgdtCMY2F_4JdMgv1o01Mscenes-app-inbox-detail--report-with-follow-up-metric--light:@@ -12334,10 +12334,6 @@ snapshots:hash: v1.k794b7964.ae082b6c8b0a012d3202c17c9634b9ac315d056fc43bcce706ff6ea928d19138.71UgrCjD51Kcfhd3rtnjdqZujFR93GXF3J6boYjLty0scenes-app-inbox-detail-expected-impact--monitoring-definition--light:hash: v1.k794b7964.c108b43638b8cce49fe8ed3c896e0ce3441a9ac04c4ee61ef5ba20791ddc4560.0ByZGqISFjPW0rQ0WfqHUBZMO9UYjyOaRRJ5vshQ0c8- scenes-app-inbox-detail-expected-impact--monitoring-definition-flag-off--dark:- hash: v1.k794b7964.4497d91ad86cef9418def048c904a2131583ce05c1a15d2deb7e38b699df028d.3NQ1y1BDagcnvl_l2RVbVBg8Kyu9Lc0-pzlMepD7W5c- scenes-app-inbox-detail-expected-impact--monitoring-definition-flag-off--light:- hash: v1.k794b7964.7cab971b1c23034a13ac2b2a45a725eb7c410a3cda556e23f3303eb60a1dbc92.T05I-VgaKuqgym0kk7nZwj1wScADW4axDtfBds-gH1Escenes-app-inbox-detail-expected-impact--monitoring-definition-narrow--dark:hash: v1.k794b7964.76c4fdad05b00703fa8530424e61bb9789c4805793a70298164865ec630bae8d.Pk8LcjrJEdmO-8Gq3vEYYH2GcdLaqAyPMokg9XAQGdoscenes-app-inbox-detail-expected-impact--monitoring-definition-narrow--light:@@ -12362,10 +12358,6 @@ snapshots:hash: v1.k794b7964.d775f73c0702b1409b7c11b9ccdd2c01e385d0371e2420f4ace53b60e175a185.GBoAu-DyZCKHHG-MoaqByqL4KQWIQWofxV0AaWWp2Doscenes-app-inbox-detail-expected-impact--range-goal--light:hash: v1.k794b7964.ff9f962cfbc53d10b1f05c82f8314c83318f3c3aa8355a006b1405d03ef45249.4dDfLh9vzg3zUs8e7Kend-QoB8z8Qodx0FDxWgWgKkk- scenes-app-inbox-detail-expected-impact--replacement-unavailable--dark:- hash: v1.k794b7964.fcc3f4688b1ff08a3dd606db2337e1d621f0f85b1020a5a34fe32440a986ea4b.DJU5Tsk7kVflGl8SmM4jtY6CInUC9cHPNNYJwthjWfg- scenes-app-inbox-detail-expected-impact--replacement-unavailable--light:- hash: v1.k794b7964.255b55f7170b6523b6e21f9381eaea395e08283d289e4569a73a8f7ec752d662.wIq1CUQZYNqkWzgnP17AAaaLS-wOyEL9G7fyg9YQ1_Iscenes-app-inbox-detail-follow-up-checks--every-state--dark:hash: v1.k794b7964.9cc27a98fa553f69d21b4668b30ba0cd5d8f9039de15d55c0a0f9edc351825c1.042apt58HU3k1l1qutxqHxT4mDsjQXYx3v-Qfmy8dNoscenes-app-inbox-detail-follow-up-checks--every-state--light:diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex a388a8973460..0bf11a9952cc 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -234,10 +234,8 @@ export const FEATURE_FLAGS = {SETTINGS_SESSION_TABLE_VERSION: 'settings-session-table-version', // owner: #team-analytics-platformSETTINGS_WEB_ANALYTICS_PRE_AGGREGATED_TABLES: 'web-analytics-pre-aggregated-tables', // owner: @lricoy #team-web-analyticsSIGNALS_ANALYTICS_ALL_ALERTS: 'signals-analytics-all-alerts', // owner: #team-self-driving, lets the product analytics source send every firing insight alert to the inbox (also checked server-side)- SIGNALS_EXPECTED_IMPACT_DISPLAY: 'signals-expected-impact', // owner: #team-self-driving, person-level display gate for metric follow-up graphs and actionsSIGNALS_INBOX_VALUE_SUMMARY: 'signals-inbox-value-summary', // owner: #team-self-drivingSIGNALS_PR_REFUNDS: 'signals-pr-refunds', // owner: #team-self-driving, gates the inbox PR refund flow (also checked server-side)- SIGNALS_REPORT_CHECKS_REPLACE: 'signals-report-checks-replace', // owner: #team-self-drivingSIGNALS_REPORT_METRICS: 'signals-report-metrics', // owner: #team-self-driving, gates the live impact metrics on inbox report rows and the report detail, and the snapshot refresh calls they makeSIGNALS_REPORT_MONITORING: 'signals-report-monitoring', // owner: #team-self-drivingSIGNALS_REPORT_NOTES: 'signals-report-notes', // owner: #team-self-driving, gates the notes list and composer at the end of an inbox report, and the quoted notes in its activitydiff --git a/products/signals/frontend/inbox/components/detail/DiscussReportButton.stories.tsx b/products/signals/frontend/inbox/components/detail/DiscussReportButton.stories.tsxindex b7783cd2ab10..6d385e4a61b2 100644--- a/products/signals/frontend/inbox/components/detail/DiscussReportButton.stories.tsx+++ b/products/signals/frontend/inbox/components/detail/DiscussReportButton.stories.tsx@@ -151,6 +151,22 @@ export const MetricSuggestion: Story = {},}+export const MonitoringUnavailable: Story = {+ ...MetricSuggestion,+ name: 'Monitoring unavailable',+ parameters: {+ featureFlags: { [FEATURE_FLAGS.SIGNALS_REPORT_MONITORING]: false },+ testOptions: { snapshotBrowsers: [] },+ },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement)+ if (canvas.queryByText('Suggest a better metric')) {+ throw new Error('Metric suggestions must be hidden without Monitoring')+ }+ await canvas.findByText('Cancel this check')+ },+}+async function openQuickAsk(canvasElement: HTMLElement): Promise<void> {await userEvent.click(await within(canvasElement).findByLabelText('Quick ask and more AI actions'))await waitFor(() => {diff --git a/products/signals/frontend/inbox/components/detail/InboxDetail.stories.tsx b/products/signals/frontend/inbox/components/detail/InboxDetail.stories.tsxindex 4b65f86d2134..c0bd2f3430ac 100644--- a/products/signals/frontend/inbox/components/detail/InboxDetail.stories.tsx+++ b/products/signals/frontend/inbox/components/detail/InboxDetail.stories.tsx@@ -184,7 +184,7 @@ const meta: Meta = {mockDate: '2026-06-11',featureFlags: {[FEATURE_FLAGS.SIGNALS_REPORT_METRICS]: true,- [FEATURE_FLAGS.SIGNALS_EXPECTED_IMPACT_DISPLAY]: true,+ [FEATURE_FLAGS.SIGNALS_REPORT_MONITORING]: true,},},decorators: [detailMocks],@@ -462,7 +462,7 @@ export const ReportWithFollowUpMetric: Story = {mockDate: '2026-08-29',featureFlags: {[FEATURE_FLAGS.SIGNALS_REPORT_METRICS]: true,- [FEATURE_FLAGS.SIGNALS_EXPECTED_IMPACT_DISPLAY]: true,+ [FEATURE_FLAGS.SIGNALS_REPORT_MONITORING]: true,},},render: () => (@@ -493,7 +493,7 @@ export const ReportWithFollowUpMetricHidden: Story = {mockDate: '2026-08-29',featureFlags: {[FEATURE_FLAGS.SIGNALS_REPORT_METRICS]: true,- [FEATURE_FLAGS.SIGNALS_EXPECTED_IMPACT_DISPLAY]: false,+ [FEATURE_FLAGS.SIGNALS_REPORT_MONITORING]: false,},},}diff --git a/products/signals/frontend/inbox/components/detail/ReportCheckRow.tsx b/products/signals/frontend/inbox/components/detail/ReportCheckRow.tsxindex 491dc7814401..0551065c4944 100644--- a/products/signals/frontend/inbox/components/detail/ReportCheckRow.tsx+++ b/products/signals/frontend/inbox/components/detail/ReportCheckRow.tsx@@ -1,6 +1,7 @@import { IconClock, IconTrends } from '@posthog/icons'import { LemonButton, LemonTag, Tooltip } from '@posthog/lemon-ui'+import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'import { LemonDialog } from 'lib/lemon-ui/LemonDialog'import { ReportCheckRowData } from './reportCheckPresentation'@@ -19,6 +20,7 @@ export function ReportCheckRow({onSuggestMetric: () => voidsuggestionDisabledReason?: string | null}): JSX.Element {+ const monitoringEnabled = useFeatureFlag('SIGNALS_REPORT_MONITORING')const { check, reportStatus, tag, detail, cancelled, cancellable } = rowreturn (@@ -51,15 +53,17 @@ export function ReportCheckRow({</div>{cancellable && (<div className="-mt-1 flex h-0 flex-wrap justify-end gap-1 overflow-hidden group-hover:mt-0 group-hover:h-auto group-focus-within:mt-0 group-focus-within:h-auto group-focus-within:overflow-visible [@media(hover:none)]:mt-0 [@media(hover:none)]:h-auto">- <LemonButton- type="tertiary"- size="xsmall"- disabledReason={cancelling ? 'Canceling this check' : suggestionDisabledReason}- data-attr="signals-report-check-suggest-metric"- onClick={onSuggestMetric}- >- Suggest a better metric- </LemonButton>+ {monitoringEnabled && (+ <LemonButton+ type="tertiary"+ size="xsmall"+ disabledReason={cancelling ? 'Canceling this check' : suggestionDisabledReason}+ data-attr="signals-report-check-suggest-metric"+ onClick={onSuggestMetric}+ >+ Suggest a better metric+ </LemonButton>+ )}<LemonButtontype="tertiary"size="xsmall"diff --git a/products/signals/frontend/inbox/components/detail/ReportDetail.tsx b/products/signals/frontend/inbox/components/detail/ReportDetail.tsxindex 01a800561f13..f0ee8aaf9644 100644--- a/products/signals/frontend/inbox/components/detail/ReportDetail.tsx+++ b/products/signals/frontend/inbox/components/detail/ReportDetail.tsx@@ -360,7 +360,7 @@ export function InboxDetailFrame({// "Summary" tab; otherwise it sits under the "Report summary" header.// The key observation leads the evidence rail; the supporting tiles belong to the body's Impact section.const metricsEnabled = useFeatureFlag('SIGNALS_REPORT_METRICS')- const expectedImpactEnabled = useFeatureFlag('SIGNALS_EXPECTED_IMPACT_DISPLAY')+ const monitoringEnabled = useFeatureFlag('SIGNALS_REPORT_MONITORING')const notesEnabled = useFeatureFlag('SIGNALS_REPORT_NOTES')const primaryMetric = metricsEnabled ? report.metrics?.find((metric) => metric.role === 'primary') : undefinedconst supportingMetrics = metricsEnabled@@ -372,7 +372,7 @@ export function InboxDetailFrame({(check) => check.kind === 'metric_threshold' && check.status !== 'cancelled')const expectedImpact =- expectedImpactEnabled && !summaryPending && (reportChecks === null || reportChecksError || hasMeasurements) ? (+ monitoringEnabled && !summaryPending && (reportChecks === null || reportChecksError || hasMeasurements) ? (<ReportExpectedImpact report={report} reportUrl={reportUrl} />) : nullconst planBlock = report.plan ? <ReportPlanBlock reportId={report.id} plan={report.plan} /> : nulldiff --git a/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.stories.tsx b/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.stories.tsxindex 3c316a8d7ba3..940dca3943de 100644--- a/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.stories.tsx+++ b/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.stories.tsx@@ -85,11 +85,6 @@ const monitoringCheck: SignalReportCheckApi = {next_measurement_at: '2026-08-29T18:00:00Z',},}-const flagOffCheck: SignalReportCheckApi = {- ...check,- title: monitoringCheck.title,- config: { ...monitoringConfig, monitoring: undefined },-}const fixedTargetCheck: SignalReportCheckApi = {...monitoringCheck,config: { ...monitoringConfig, monitoring: { ...monitoringDefinition, threshold_scaling: 'fixed' } },@@ -163,13 +158,6 @@ const meta: Meta<typeof ReportExpectedImpact> = {export default metatype Story = StoryObj<typeof ReportExpectedImpact>-export const MonitoringDefinitionFlagOff: Story = {- parameters: {- check: flagOffCheck,- featureFlags: { 'signals-report-checks-replace': true, [FEATURE_FLAGS.SIGNALS_REPORT_MONITORING]: false },- },-}-export const MonitoringDefinition: Story = {args: { report: { ...report, monitoring_started_at: monitoringStartedAt } },parameters: {@@ -218,10 +206,6 @@ export const Narrow: Story = { parameters: { narrow: true } }export const Failed: Story = { parameters: { check: failedCheck } }export const LoadFailure: Story = { parameters: { loadFailure: true } }-export const ReplacementUnavailable: Story = {- parameters: { featureFlags: { [FEATURE_FLAGS.SIGNALS_REPORT_MONITORING]: false } },-}-export const MonitoringRateTarget: Story = {args: MonitoringDefinition.args,parameters: {diff --git a/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.test.tsx b/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.test.tsxindex 4c64ad6b5991..cbb1bccc6d6b 100644--- a/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.test.tsx+++ b/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.test.tsx@@ -16,6 +16,7 @@ import { reportMetricsFixture } from '../../__mocks__/reportMetricMocks'import { inboxTaskKickoffLogic } from '../../inboxTaskKickoffLogic'import { inboxReportDetailLogic } from '../../logics/inboxReportDetailLogic'import { SignalReport, SignalReportStatus } from '../../types'+import { ReportChecksSection } from './ReportChecksSection'import { ReportExpectedImpact } from './ReportExpectedImpact'jest.mock('./ReportCheckMetricChart', () => ({ ReportCheckMetricChart: () => <div>Chart</div> }))@@ -203,10 +204,19 @@ describe('ReportExpectedImpact', () => {expect(screen.getByText('Ask AI to update checks').closest('button')).toHaveAttribute('aria-disabled', 'true')})- it('disables metric suggestions until the replacement tool is available', () => {- featureFlagLogic.actions.setFeatureFlags([], { [FEATURE_FLAGS.SIGNALS_REPORT_MONITORING]: false })+ it.each([false, undefined])('hides Expected impact and sidebar suggestions when Monitoring is %s', (enabled) => {+ featureFlagLogic.actions.setFeatureFlags(+ [],+ enabled === undefined ? {} : { [FEATURE_FLAGS.SIGNALS_REPORT_MONITORING]: enabled }+ )renderMeasurements([check])- expect(screen.getByText('Suggest different metrics').closest('button')).toHaveAttribute('aria-disabled', 'true')+ render(<ReportChecksSection report={report} />)+ expect(screen.queryByText('Suggest different metrics')).not.toBeInTheDocument()+ expect(screen.queryByText('Suggest a better metric')).not.toBeInTheDocument()+ expect(screen.getByText('Cancel this check')).toBeInTheDocument()+ expect(screen.queryByText('Looks good')).not.toBeInTheDocument()+ expect(screen.queryByText('Chart')).not.toBeInTheDocument()+ expect(document.querySelector('[data-attr="report-expected-impact"]')).not.toBeInTheDocument()})it('caps visible measurements after skipping malformed check configs', () => {diff --git a/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.tsx b/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.tsxindex 0ab978bc59c6..931c72f6b750 100644--- a/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.tsx+++ b/products/signals/frontend/inbox/components/detail/ReportExpectedImpact.tsx@@ -3,6 +3,8 @@ import { useState } from 'react'import { LemonButton, LemonTag } from '@posthog/lemon-ui'+import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'+import type { ReportMetricApi } from 'products/signals/frontend/generated/api.schemas'import { inboxTaskKickoffLogic } from '../../inboxTaskKickoffLogic'@@ -17,13 +19,23 @@ import { ReportMonitoringDetails } from './ReportMonitoringDetails'const MAX_VISIBLE_MEASUREMENTS = 6-export function ReportExpectedImpact({ report, reportUrl }: { report: SignalReport; reportUrl: string }): JSX.Element {+export function ReportExpectedImpact({+ report,+ reportUrl,+}: {+ report: SignalReport+ reportUrl: string+}): JSX.Element | null {+ const monitoringEnabled = useFeatureFlag('SIGNALS_REPORT_MONITORING')const [modalOpen, setModalOpen] = useState(false)const logic = inboxReportDetailLogic({ reportId: report.id, report })const { reportChecks, reportChecksLoading, reportChecksError, reportArtefacts, approvingCheckIds } =useValues(logic)const { approveReportCheck, loadReportChecks } = useActions(logic)- const { currentProjectId, metricCheckReplacementDisabledReason } = useValues(inboxTaskKickoffLogic)+ const { currentProjectId } = useValues(inboxTaskKickoffLogic)+ if (!monitoringEnabled) {+ return null+ }const measurements = buildReportCheckRows(reportChecks ?? [],latestCheckExplanations(reportArtefacts ?? []),@@ -196,10 +208,7 @@ export function ReportExpectedImpact({ report, reportUrl }: { report: SignalRepodata-attr="report-expected-impact-suggest-metrics"type="secondary"size="small"- disabledReason={- metricCheckReplacementDisabledReason ??- (openMeasurements.length === 0 ? 'No open metric checks to revise.' : undefined)- }+ disabledReason={openMeasurements.length === 0 ? 'No open metric checks to revise.' : undefined}onClick={() => setModalOpen(true)}>Suggest different metrics