: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(signals): show a report's follow-up checks on the detail rail (#103649)
posthog[bot]7a25fa819e44
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 3bf042032bd0..1aa74757fb2c 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -8640,6 +8640,18 @@ snapshots:hash: v1.k794b7964.6d25562ee11eb3e2bc5ecf6aedff4fe058299de21db40a241d22ec348566b5e7.1QCX8kAJWvaKf9rBXs7O4S-9Nh9tbQR6zn2IL5ehZposcenes-app-inbox-detail--run-ready--light:hash: v1.k794b7964.2a7035c21bc396a44a81e18222d5f9a50f8ca650d47bc387b27a4c8ab72db7aa.BZ_qNCVpWT1v8Ov60-xHUyKzBwvr1BPNjoLZgjobYw4+ scenes-app-inbox-detail-follow-up-checks--every-state--dark:+ hash: v1.k794b7964.db65be880b7ea05e9d05d47e6a55dd09cf96097fe23069a4ad58bee132d4a29f.5Ujk0VN9aRboEk8AT2Et2hucpwBeKvQ_cQVOhpPhDLM+ scenes-app-inbox-detail-follow-up-checks--every-state--light:+ hash: v1.k794b7964.6e7fcde5e16c95033c9e0b5c328c71a7a896244112af9b1eeb9fdc034db0c756.VacT_Pn_QENz3TSTvZjLdLQ3dKtj_TMN37D2R4DKr-o+ scenes-app-inbox-detail-follow-up-checks--narrow-rail--dark:+ hash: v1.k794b7964.05727164f85dd7b818793adac1b96025dc34ca877719382b7c4c6e6827a292c0.oSTW6nWZ3NNOcEBORQbYTD5VpCHJDy-WwObn3v4azpk+ scenes-app-inbox-detail-follow-up-checks--narrow-rail--light:+ hash: v1.k794b7964.71bc62198aef8af9b48673b29376bcffd9c5bae62712d1943b41f80a62997a5a.Ia8n2VymOvs9rUVdnKT4V1pBnd93dPTsCQ6B8SRZ4wo+ scenes-app-inbox-detail-follow-up-checks--running--dark:+ hash: v1.k794b7964.6140d13ee22cd970b554499942fb4c0086384855d2fd98b07733ff7bec069cf3.HwCZ5Wv5rEJK15jPx0_owBQB0Ejwlr41XkeMMFUPV8g+ scenes-app-inbox-detail-follow-up-checks--running--light:+ hash: v1.k794b7964.7b607a184b4dac5f92fff1d8dd160b515ccd339e4eecc9c8fe38885eb97e6544.rznFhlEfGozAGcFKqSiE7V9Lqfnm-KkfU29YEkxb4yMscenes-app-inbox-detail-suggested-reviewers-mockup--code-history--dark:hash: v1.k794b7964.855dc499453a42a73a88ddc6af003e54fca17d6d9c15b77cb16decd61c2e2135.nWuYyTY6x1XdFhfeQyv9vqmZ1QXoegdJaG2TYfhr7B8scenes-app-inbox-detail-suggested-reviewers-mockup--code-history--light:diff --git a/products/signals/backend/serializers.py b/products/signals/backend/serializers.pyindex 69bc9a4e614d..fd50eb962b52 100644--- a/products/signals/backend/serializers.py+++ b/products/signals/backend/serializers.py@@ -1646,6 +1646,7 @@ class SignalReportCheckSerializer(serializers.ModelSerializer):"expires_at","last_run_at","last_outcome",+ "dispatched_at","consecutive_errors","created_at","updated_at",@@ -1678,6 +1679,14 @@ class SignalReportCheckSerializer(serializers.ModelSerializer):"expires_at": {"help_text": "Horizon after which the check retires without running again."},"last_run_at": {"help_text": "When the check last ran; null before its first run."},"last_outcome": {"help_text": "Verdict of the most recent run."},+ "dispatched_at": {+ "help_text": (+ "When the `agent` check's scout run started, cleared as soon as a verdict is recorded. "+ "A non-null value is what tells a reader the check is running rather than waiting, "+ "because dispatch also pushes `next_run_at` out to the result window. "+ "Always null on a `metric_threshold` check, which is measured in the tick that collects it."+ )+ },"consecutive_errors": {"help_text": "Runs that could not be measured since the last clean one."},}diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.tsindex 316d794a83a5..af0dd1e72be5 100644--- a/products/signals/frontend/generated/api.schemas.ts+++ b/products/signals/frontend/generated/api.schemas.ts@@ -2472,6 +2472,11 @@ export interface SignalReportCheckApi {* * `failed` - Failed* * `errored` - Errored */readonly last_outcome: SignalReportCheckOutcomeEnumApi | null+ /**+ * When the `agent` check's scout run started, cleared as soon as a verdict is recorded. A non-null value is what tells a reader the check is running rather than waiting, because dispatch also pushes `next_run_at` out to the result window. Always null on a `metric_threshold` check, which is measured in the tick that collects it.+ * @nullable+ */+ readonly dispatched_at: string | null/** Runs that could not be measured since the last clean one. */readonly consecutive_errors: numberreadonly created_at: stringdiff --git a/products/signals/frontend/inbox/components/detail/ReportCheckRow.stories.tsx b/products/signals/frontend/inbox/components/detail/ReportCheckRow.stories.tsxnew file mode 100644index 000000000000..8300d9345420--- /dev/null+++ b/products/signals/frontend/inbox/components/detail/ReportCheckRow.stories.tsx@@ -0,0 +1,124 @@+import type { Meta, StoryObj } from '@storybook/react'++import { IconTarget } from '@posthog/icons'++import type { SignalReportCheckApi } from 'products/signals/frontend/generated/api.schemas'++import { DetailSection } from './DetailSection'+import { buildReportCheckRows, reportChecksMeta } from './reportCheckPresentation'+import { ReportCheckRow } from './ReportCheckRow'++function check(overrides: Partial<SignalReportCheckApi>): SignalReportCheckApi {+ return {+ id: 'check',+ title: 'Checkout errors stay at zero after the retry fix',+ rationale: 'The retry fix should stop the exception reaching the customer.',+ kind: 'agent',+ status: 'active',+ config: { instructions: 'Re-read the issue.', skill_name: 'signals-scout-error-tracking', probe_hints: [] },+ next_run_at: '2026-09-27T09:00:00Z',+ soak_minutes: 10080,+ run_interval_minutes: null,+ runs_remaining: 1,+ expires_at: '2026-10-27T09:00:00Z',+ last_run_at: null,+ last_outcome: null,+ dispatched_at: null,+ consecutive_errors: 0,+ created_at: '2026-09-20T09:00:00Z',+ updated_at: '2026-09-20T09:00:00Z',+ ...overrides,+ } as SignalReportCheckApi+}++const everyState: SignalReportCheckApi[] = [+ check({ id: 'scheduled' }),+ check({+ id: 'waiting',+ status: 'pending',+ title: 'No new reports of the export timeout',+ kind: 'metric_threshold',+ config: { comparison: { operator: 'lte', value: 0 } },+ soak_minutes: 4320,+ }),+ check({+ id: 'passed',+ status: 'passed',+ kind: 'metric_threshold',+ config: { comparison: { operator: 'lte', value: 20 } },+ title: 'Signup form rageclicks fall to at most 20 per 14 days',+ last_run_at: '2026-09-20T09:00:00Z',+ }),+ check({+ id: 'failed',+ status: 'failed',+ title: 'The export backlog stays clear',+ last_run_at: '2026-09-27T09:00:00Z',+ }),+ check({+ id: 'expired',+ status: 'expired',+ title: 'Confirm the retry budget holds',+ updated_at: '2026-10-27T09:00:00Z',+ }),+ check({+ id: 'cancelled',+ status: 'cancelled',+ title: 'Replaced when research re-ran on this report',+ updated_at: '2026-09-21T09:00:00Z',+ }),+]++const explanations = new Map([+ ['passed', '11 rageclicks in the last 14 days. Expected at most 20, was 64 when set.'],+ ['failed', '14 new events after the fix, on the same stack frame.'],+])++function ChecksSection({ checks }: { checks: SignalReportCheckApi[] }): JSX.Element {+ return (+ <DetailSection+ icon={<IconTarget />}+ title="Follow-up checks"+ meta={<span className="text-xs text-tertiary tabular-nums">{reportChecksMeta(checks)}</span>}+ >+ <div className="flex flex-col gap-1.5">+ {buildReportCheckRows(checks, explanations).map((row) => (+ <ReportCheckRow key={row.check.id} row={row} cancelling={false} onCancel={() => undefined} />+ ))}+ </div>+ </DetailSection>+ )+}++const meta: Meta<typeof ChecksSection> = {+ title: 'Scenes-App/Inbox/Detail/Follow-up checks',+ component: ChecksSection,+ parameters: { layout: 'centered', viewMode: 'story' },+ decorators: [+ (Story, context) => (+ // The rail is 26rem wide, and about 20rem of it survives next to an open side panel.+ <div+ className={`${context.parameters.railWidth === 'narrow' ? 'w-[20rem]' : 'w-[26rem]'} max-w-[calc(100vw-2rem)] rounded border bg-primary p-4`}+ >+ <Story />+ </div>+ ),+ ],+}++export default meta++type Story = StoryObj<typeof ChecksSection>++export const EveryState: Story = {+ args: { checks: everyState },+}++export const Running: Story = {+ args: { checks: [check({ id: 'running', dispatched_at: '2026-09-21T09:00:00Z' })] },+}++export const NarrowRail: Story = {+ parameters: { railWidth: 'narrow' },+ args: { checks: everyState },+}diff --git a/products/signals/frontend/inbox/components/detail/ReportCheckRow.tsx b/products/signals/frontend/inbox/components/detail/ReportCheckRow.tsxnew file mode 100644index 000000000000..aff98ca2fb02--- /dev/null+++ b/products/signals/frontend/inbox/components/detail/ReportCheckRow.tsx@@ -0,0 +1,77 @@+import { IconClock, IconTrends } from '@posthog/icons'+import { LemonButton, LemonTag, Tooltip } from '@posthog/lemon-ui'++import { LemonDialog } from 'lib/lemon-ui/LemonDialog'++import { ReportCheckRowData } from './reportCheckPresentation'++/**+ * One follow-up check on the report rail: what it claims, where it stands, and the one thing a+ * reader can still do about it. The Stop button appears on hover and confirms first, because a+ * cancelled check is terminal and its author has to write a new one to get the answer back.+ */+export function ReportCheckRow({+ row,+ cancelling,+ onCancel,+}: {+ row: ReportCheckRowData+ cancelling: boolean+ onCancel: (checkId: string) => void+}): JSX.Element {+ const { check, tag, detail, cancelled, cancellable } = row++ return (+ <div+ className={`group flex flex-col gap-1 rounded border border-primary bg-surface-primary px-2.5 py-2 ${+ cancelled ? 'opacity-60' : ''+ }`}+ >+ <div className="flex items-start gap-2 min-w-0">+ <span className="mt-0.5 shrink-0 text-tertiary [&_svg]:size-3.5">+ {check.kind === 'agent' ? <IconClock /> : <IconTrends />}+ </span>+ <Tooltip title={check.rationale || undefined}>+ <span+ className={`min-w-0 flex-1 text-xs leading-snug text-default line-clamp-2 ${+ cancelled ? 'line-through' : ''+ }`}+ >+ {check.title}+ </span>+ </Tooltip>+ <LemonTag size="small" type={tag.type} className="shrink-0">+ {tag.label}+ </LemonTag>+ </div>+ <div className="flex items-end gap-2 min-w-0 pl-[1.375rem]">+ <span className="min-w-0 flex-1 text-xs leading-snug text-tertiary">{detail}</span>+ {cancellable && (+ <LemonButton+ type="tertiary"+ size="xsmall"+ status="danger"+ loading={cancelling}+ disabledReason={cancelling ? 'Stopping this check' : undefined}+ data-attr="signals-report-check-stop"+ className="shrink-0 opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-100"+ onClick={() =>+ LemonDialog.open({+ title: 'Stop this check?',+ description: `"${check.title}" will not run, and nothing will report back on it. Results it already recorded stay on this report.`,+ primaryButton: {+ children: 'Stop check',+ status: 'danger',+ onClick: () => onCancel(check.id),+ },+ secondaryButton: { children: 'Keep it' },+ })+ }+ >+ Stop+ </LemonButton>+ )}+ </div>+ </div>+ )+}diff --git a/products/signals/frontend/inbox/components/detail/ReportChecksSection.tsx b/products/signals/frontend/inbox/components/detail/ReportChecksSection.tsxnew file mode 100644index 000000000000..2b94e6003f26--- /dev/null+++ b/products/signals/frontend/inbox/components/detail/ReportChecksSection.tsx@@ -0,0 +1,74 @@+import { useActions, useValues } from 'kea'+import { useState } from 'react'++import { IconTarget } from '@posthog/icons'+import { LemonButton, LemonSkeleton } from '@posthog/lemon-ui'++import { inboxReportDetailLogic } from '../../logics/inboxReportDetailLogic'+import { SignalReport } from '../../types'+import { DetailSection } from './DetailSection'+import {+ buildReportCheckRows,+ latestCheckExplanations,+ reportChecksMeta,+ splitReportCheckRows,+} from './reportCheckPresentation'+import { ReportCheckRow } from './ReportCheckRow'++/**+ * What is still watching this report, and what the checks that already ran decided. A check is the+ * one forward-looking row a report carries: an expectation plus the time to test it. Until it+ * produces a verdict nothing else on the page mentions it, so a reader cannot otherwise tell that a+ * check is scheduled, waiting for the report to resolve, or expired without ever running.+ *+ * Reads the report's checks endpoint and the artefacts the detail logic already loads, which is+ * where a finished check's explanation lives. Hidden entirely when the report has no checks, so the+ * rail does not grow an empty section on the reports that carry none.+ */+export function ReportChecksSection({ report }: { report: SignalReport }): JSX.Element | null {+ const { reportChecks, reportChecksLoading, reportArtefacts, cancellingCheckIds } = useValues(+ inboxReportDetailLogic({ reportId: report.id, report })+ )+ const { cancelReportCheck } = useActions(inboxReportDetailLogic({ reportId: report.id, report }))+ const [showRetired, setShowRetired] = useState(false)++ if (reportChecksLoading && !reportChecks) {+ return (+ <DetailSection icon={<IconTarget />} title="Follow-up checks" collapsible>+ <LemonSkeleton className="h-12 w-full" />+ </DetailSection>+ )+ }++ if (!reportChecks || reportChecks.length === 0) {+ return null+ }++ const rows = buildReportCheckRows(reportChecks, latestCheckExplanations(reportArtefacts ?? []))+ const { visible, hidden } = splitReportCheckRows(rows)++ return (+ <DetailSection+ icon={<IconTarget />}+ title="Follow-up checks"+ collapsible+ meta={<span className="text-xs text-tertiary tabular-nums">{reportChecksMeta(reportChecks)}</span>}+ >+ <div className="flex flex-col gap-1.5">+ {(showRetired ? rows : visible).map((row) => (+ <ReportCheckRow+ key={row.check.id}+ row={row}+ cancelling={cancellingCheckIds.includes(row.check.id)}+ onCancel={cancelReportCheck}+ />+ ))}+ {hidden.length > 0 && !showRetired && (+ <LemonButton type="tertiary" size="xsmall" onClick={() => setShowRetired(true)}>+ Show {hidden.length} more+ </LemonButton>+ )}+ </div>+ </DetailSection>+ )+}diff --git a/products/signals/frontend/inbox/components/detail/ReportDetail.tsx b/products/signals/frontend/inbox/components/detail/ReportDetail.tsxindex d7aef2ac1ac5..993dff4c61d2 100644--- a/products/signals/frontend/inbox/components/detail/ReportDetail.tsx+++ b/products/signals/frontend/inbox/components/detail/ReportDetail.tsx@@ -49,6 +49,7 @@ import { PullRequestDiffPending, PullRequestDiffStat, PullRequestDiffStatSkeletoimport { PullRequestFilesChanged } from './PullRequestFilesChanged'import { ReportActivitySection } from './ReportActivitySection'import { ReportChart } from './ReportChart'+import { ReportChecksSection } from './ReportChecksSection'import { useReportDetailActions } from './ReportDetailActions'import { ReportFeedbackFooter } from './ReportFeedbackFooter'import { ReportImpactMetrics } from './ReportImpactMetrics'@@ -454,6 +455,7 @@ export function InboxDetailFrame({{children}<SuggestedReviewersSection report={report} /><ReportTasksSection report={report} />+ <ReportChecksSection report={report} /><ReportActivitySection report={report} />{asideFooter}</aside>diff --git a/products/signals/frontend/inbox/components/detail/reportCheckPresentation.test.ts b/products/signals/frontend/inbox/components/detail/reportCheckPresentation.test.tsnew file mode 100644index 000000000000..c92bdde2d4e4--- /dev/null+++ b/products/signals/frontend/inbox/components/detail/reportCheckPresentation.test.ts@@ -0,0 +1,214 @@+import { dayjs } from 'lib/dayjs'++import type { SignalReportCheckApi } from 'products/signals/frontend/generated/api.schemas'++import { SignalReportArtefact } from '../../types'+import {+ buildReportCheckRows,+ latestCheckExplanations,+ reportChecksMeta,+ splitReportCheckRows,+} from './reportCheckPresentation'++function makeCheck(overrides: Partial<SignalReportCheckApi> = {}): SignalReportCheckApi {+ return {+ id: 'check-1',+ title: 'Checkout errors stay at zero',+ rationale: 'The retry fix should stop the exception.',+ kind: 'agent',+ status: 'active',+ config: { instructions: 'Re-read the issue.', skill_name: 'signals-scout-error-tracking', probe_hints: [] },+ next_run_at: '2026-09-27T09:00:00Z',+ soak_minutes: 10080,+ run_interval_minutes: null,+ runs_remaining: 1,+ expires_at: '2026-10-27T09:00:00Z',+ last_run_at: null,+ last_outcome: null,+ dispatched_at: null,+ consecutive_errors: 0,+ created_at: '2026-09-20T09:00:00Z',+ updated_at: '2026-09-20T09:00:00Z',+ ...overrides,+ } as SignalReportCheckApi+}++function rowFor(+ overrides: Partial<SignalReportCheckApi>,+ explanations = new Map<string, string>()+): {+ tag: string+ detail: string+} {+ const [row] = buildReportCheckRows([makeCheck(overrides)], explanations)+ return { tag: row.tag.label, detail: row.detail }+}++describe('reportCheckPresentation', () => {+ describe('buildReportCheckRows', () => {+ // The section exists so a reader can tell a scheduled check from a waiting one from a check+ // that never ran. A wrong mapping here puts the wrong verdict word on the row.+ it.each<[string, Partial<SignalReportCheckApi>, string, string]>([+ [+ 'a check waiting for the report to resolve names its soak',+ { status: 'pending' },+ 'Waiting',+ 'Starts 7 days after this report is resolved · Error tracking runs it',+ ],+ [+ 'a scheduled check leads with its run date and its lane',+ {},+ 'Runs Sep 27',+ 'Error tracking re-probes the claim · 1 run · 7 days soak',+ ],+ [+ 'a scheduled metric check says the coordinator measures it',+ {+ kind: 'metric_threshold',+ config: { comparison: { operator: 'lte', value: 20 } },+ soak_minutes: null,+ },+ 'Runs Sep 27',+ 'Measures the metric again · 1 run',+ ],+ [+ 'a passed check reports the verdict, not the status name',+ { status: 'passed', last_run_at: '2026-09-27T09:00:00Z' },+ 'Still holds',+ 'Sep 27 · 11 rageclicks in the last 14 days.',+ ],+ [+ 'a failed check reads as the claim no longer holding',+ { status: 'failed', last_run_at: '2026-09-27T09:00:00Z' },+ 'No longer holds',+ 'Sep 27 · 11 rageclicks in the last 14 days.',+ ],+ [+ 'an errored check says how many tries it took before giving up',+ { status: 'errored', last_run_at: '2026-09-27T09:00:00Z', consecutive_errors: 3 },+ "Couldn't measure",+ 'Gave up after 3 tries · Sep 27 · 11 rageclicks in the last 14 days.',+ ],+ [+ 'a check that expired before its first run says so',+ { status: 'expired', updated_at: '2026-10-27T09:00:00Z' },+ 'Never ran',+ 'Expired Oct 27 before it ever ran',+ ],+ [+ 'a check that ran and then expired keeps its last run visible',+ { status: 'expired', last_run_at: '2026-09-27T09:00:00Z', updated_at: '2026-10-27T09:00:00Z' },+ 'Expired',+ 'Last ran Sep 27 · expired Oct 27',+ ],+ [+ 'a cancelled check says when it was stopped',+ { status: 'cancelled', updated_at: '2026-09-21T09:00:00Z' },+ 'Cancelled',+ 'Stopped Sep 21',+ ],+ ])('%s', (_name, overrides, tag, detail) => {+ expect(rowFor(overrides, new Map([['check-1', '11 rageclicks in the last 14 days.']]))).toEqual({+ tag,+ detail,+ })+ })++ it('reads a dispatched agent check as running rather than as scheduled', () => {+ // Dispatch pushes `next_run_at` out to the result window, so `dispatched_at` is the only+ // field that separates a run in flight from one still waiting for its date.+ const { tag, detail } = rowFor({+ dispatched_at: dayjs().subtract(20, 'minutes').toISOString(),+ next_run_at: dayjs().add(2, 'hours').toISOString(),+ })+ expect(tag).toEqual('Running')+ expect(detail).toEqual('Error tracking started 20 minutes ago')+ })++ it('leads with what is happening now and trails with the checks that never decided', () => {+ // A check retired later than a verdict landed must not outrank it: the retired rows are+ // also the ones that fold away, so they belong at the end of the band.+ const rows = buildReportCheckRows(+ [+ makeCheck({ id: 'expired', status: 'expired', updated_at: '2026-10-27T09:00:00Z' }),+ makeCheck({ id: 'passed', status: 'passed', last_run_at: '2026-09-20T09:00:00Z' }),+ makeCheck({ id: 'pending', status: 'pending' }),+ makeCheck({ id: 'later', next_run_at: '2026-10-04T09:00:00Z' }),+ makeCheck({ id: 'running', dispatched_at: '2026-09-21T09:00:00Z' }),+ makeCheck({ id: 'sooner', next_run_at: '2026-09-27T09:00:00Z' }),+ ],+ new Map()+ )+ expect(rows.map((row) => row.check.id)).toEqual([+ 'running',+ 'sooner',+ 'later',+ 'pending',+ 'passed',+ 'expired',+ ])+ })++ it.each<[string, SignalReportCheckApi['status'], boolean]>([+ ['a scheduled check', 'active', true],+ ['a check waiting for the resolve', 'pending', true],+ ['a check that already decided', 'passed', false],+ ])('offers Stop on %s', (_name, status, cancellable) => {+ const [row] = buildReportCheckRows([makeCheck({ status })], new Map())+ expect(row.cancellable).toEqual(cancellable)+ })+ })++ describe('splitReportCheckRows', () => {+ it('folds only the retired rows past the fourth, never a check still running', () => {+ const rows = buildReportCheckRows(+ [+ ...[1, 2, 3, 4].map((n) =>+ makeCheck({ id: `cancelled-${n}`, status: 'cancelled', updated_at: `2026-09-0${n}T09:00:00Z` })+ ),+ makeCheck({ id: 'running', dispatched_at: '2026-09-21T09:00:00Z' }),+ makeCheck({ id: 'scheduled' }),+ ],+ new Map()+ )+ const { visible, hidden } = splitReportCheckRows(rows)+ expect(visible.map((row) => row.check.id)).toEqual(['running', 'scheduled', 'cancelled-4', 'cancelled-3'])+ expect(hidden.map((row) => row.check.id)).toEqual(['cancelled-2', 'cancelled-1'])+ })+ })++ describe('reportChecksMeta', () => {+ it.each<[string, Partial<SignalReportCheckApi>[], string]>([+ [+ 'names the soonest run while anything is scheduled',+ [+ { next_run_at: '2026-10-04T09:00:00Z' },+ { next_run_at: '2026-09-27T09:00:00Z' },+ { status: 'passed' },+ ],+ '3 · next Sep 27',+ ],+ [+ 'says a run is under way rather than quoting its answer-by deadline',+ [{ dispatched_at: '2026-09-21T09:00:00Z' }, { next_run_at: '2026-09-27T09:00:00Z' }],+ '2 · running now',+ ],+ ['says what pending checks are waiting on', [{ status: 'pending' }], '1 · waiting for resolve'],+ ['says nothing is left to run', [{ status: 'passed' }, { status: 'failed' }], '2 · all done'],+ ])('%s', (_name, overrides, expected) => {+ expect(reportChecksMeta(overrides.map((o) => makeCheck(o)))).toEqual(expected)+ })+ })++ describe('latestCheckExplanations', () => {+ it('keeps the newest verdict per check and ignores every other artefact', () => {+ const artefacts = [+ { type: 'check_result', content: { check_id: 'a', explanation: 'newest' } },+ { type: 'check_result', content: { check_id: 'a', explanation: 'older' } },+ { type: 'check_result', content: { check_id: 'b', explanation: ' ' } },+ { type: 'commit', content: { check_id: 'a', explanation: 'not a verdict' } },+ ] as unknown as SignalReportArtefact[]+ expect(latestCheckExplanations(artefacts)).toEqual(new Map([['a', 'newest']]))+ })+ })+})diff --git a/products/signals/frontend/inbox/components/detail/reportCheckPresentation.ts b/products/signals/frontend/inbox/components/detail/reportCheckPresentation.tsnew file mode 100644index 000000000000..a872ef6ab3ac--- /dev/null+++ b/products/signals/frontend/inbox/components/detail/reportCheckPresentation.ts@@ -0,0 +1,228 @@+import type { LemonTagType } from '@posthog/lemon-ui'++import { dayjs } from 'lib/dayjs'++import type { SignalReportCheckApi } from 'products/signals/frontend/generated/api.schemas'++import { SignalReportArtefact } from '../../types'+import { prettifyScoutSkillName } from '../../utils/scoutRunsWindow'+import { CheckResultContent } from './artefactTypes'++/** Rows past this many collapse the ones that only record how a check ended. */+const REPORT_CHECK_ROWS_BEFORE_COLLAPSE = 4++/** Mirrors `report_check_agent.FALLBACK_CHECK_SKILL_NAME`'s role: the lane a check with no scout runs on. */+const FALLBACK_LANE_LABEL = 'The follow-up scout'++export interface ReportCheckRowData {+ check: SignalReportCheckApi+ tag: { label: string; type: LemonTagType }+ /** The line under the title: when it runs, who runs it, or what the verdict said. */+ detail: string+ /** A check a person stopped. The row renders faded with a struck title. */+ cancelled: boolean+ /** Open checks can still be stopped; terminal ones cannot. */+ cancellable: boolean+}++/** A soak window in the words the copy needs: "7 days", "36 hours", "90 minutes". */+function soakLabel(minutes: number): string {+ if (minutes % 1440 === 0) {+ const days = minutes / 1440+ return `${days} ${days === 1 ? 'day' : 'days'}`+ }+ if (minutes % 60 === 0) {+ const hours = minutes / 60+ return `${hours} ${hours === 1 ? 'hour' : 'hours'}`+ }+ return `${minutes} ${minutes === 1 ? 'minute' : 'minutes'}`+}++/** Which scout answers an `agent` check. A `metric_threshold` check has no lane: the coordinator measures it. */+function laneLabel(check: SignalReportCheckApi): string | null {+ if (check.kind !== 'agent') {+ return null+ }+ const skillName = 'skill_name' in check.config ? check.config.skill_name : null+ return skillName ? prettifyScoutSkillName(skillName) : FALLBACK_LANE_LABEL+}++function shortDate(value: string): string {+ return dayjs(value).format('MMM D')+}++/** Mirrors `SignalReportCheck.OPEN_STATUSES`: the two statuses a check can still produce a verdict from. */+const OPEN_STATUSES = ['pending', 'active']++/** A check is running when its scout run is open; dispatch also pushes `next_run_at` out to the result window. */+function isRunning(check: SignalReportCheckApi): boolean {+ return check.status === 'active' && !!check.dispatched_at+}++/** A check that ended without a verdict. Nothing is owed on it, so it is the first row to fold away. */+function isRetired(check: SignalReportCheckApi): boolean {+ return check.status === 'expired' || check.status === 'cancelled'+}++function joinDetail(parts: (string | null | undefined)[]): string {+ return parts.filter((part): part is string => !!part).join(' · ')+}++function openCheckRow(check: SignalReportCheckApi): Pick<ReportCheckRowData, 'tag' | 'detail'> {+ const lane = laneLabel(check)++ if (check.status === 'pending') {+ const start = check.soak_minutes+ ? `Starts ${soakLabel(check.soak_minutes)} after this report is resolved`+ : 'Starts when this report is resolved'+ return { tag: { label: 'Waiting', type: 'muted' }, detail: joinDetail([start, lane && `${lane} runs it`]) }+ }++ if (isRunning(check)) {+ const startedAgo = dayjs(check.dispatched_at).fromNow()+ return {+ tag: { label: 'Running', type: 'primary' },+ detail: lane ? `${lane} started ${startedAgo}` : `Started ${startedAgo}`,+ }+ }++ const work = lane ? `${lane} re-probes the claim` : 'Measures the metric again'+ const runs = check.runs_remaining > 1 ? `${check.runs_remaining} runs left` : '1 run'+ return {+ tag: { label: `Runs ${shortDate(check.next_run_at)}`, type: 'primary' },+ detail: joinDetail([work, runs, check.soak_minutes ? `${soakLabel(check.soak_minutes)} soak` : null]),+ }+}++function terminalCheckRow(+ check: SignalReportCheckApi,+ explanation: string | undefined+): Pick<ReportCheckRowData, 'tag' | 'detail'> {+ const ranOn = check.last_run_at ? shortDate(check.last_run_at) : null++ switch (check.status) {+ case 'passed':+ return { tag: { label: 'Still holds', type: 'success' }, detail: joinDetail([ranOn, explanation]) }+ case 'failed':+ return { tag: { label: 'No longer holds', type: 'danger' }, detail: joinDetail([ranOn, explanation]) }+ case 'errored':+ return {+ tag: { label: "Couldn't measure", type: 'warning' },+ detail: joinDetail([`Gave up after ${check.consecutive_errors} tries`, ranOn, explanation]),+ }+ case 'cancelled':+ return { tag: { label: 'Cancelled', type: 'muted' }, detail: `Stopped ${shortDate(check.updated_at)}` }+ }++ // Expired: the sweep retired the check when its horizon passed. It may still have run first,+ // because a check that errors its way to its expiry lands here rather than in `errored`.+ return check.last_run_at+ ? {+ tag: { label: 'Expired', type: 'muted' },+ detail: joinDetail([`Last ran ${ranOn}`, `expired ${shortDate(check.updated_at)}`]),+ }+ : {+ tag: { label: 'Never ran', type: 'muted' },+ detail: `Expired ${shortDate(check.updated_at)} before it ever ran`,+ }+}++/**+ * Rank a check for the rail: what is happening now, then what is about to, then what is waiting on+ * the resolve, then the verdicts, and last the checks that ended without one. Scheduled checks sort+ * by their run date and finished ones by how recently they spoke, so the row a reader wants leads+ * each band. Retired rows trail the verdicts because they are also the ones that fold away.+ */+function orderingKey(check: SignalReportCheckApi): [number, number] {+ if (isRunning(check)) {+ return [0, 0]+ }+ if (check.status === 'active') {+ return [1, dayjs(check.next_run_at).valueOf()]+ }+ if (check.status === 'pending') {+ return [2, dayjs(check.next_run_at).valueOf()]+ }+ if (isRetired(check)) {+ return [4, -dayjs(check.updated_at).valueOf()]+ }+ return [3, -dayjs(check.last_run_at ?? check.updated_at).valueOf()]+}++/** The newest `check_result` explanation per check, so a terminal row can say what the verdict found. */+export function latestCheckExplanations(artefacts: SignalReportArtefact[]): Map<string, string> {+ const explanations = new Map<string, string>()+ // Artefacts arrive newest first, so the first entry seen for a check is the one that stands.+ for (const artefact of artefacts) {+ if (artefact.type !== 'check_result') {+ continue+ }+ const content = artefact.content as CheckResultContent+ if (content?.check_id && content.explanation?.trim() && !explanations.has(content.check_id)) {+ explanations.set(content.check_id, content.explanation.trim())+ }+ }+ return explanations+}++export function buildReportCheckRows(+ checks: SignalReportCheckApi[],+ explanations: Map<string, string>+): ReportCheckRowData[] {+ return [...checks]+ .sort((a, b) => {+ const [bandA, withinA] = orderingKey(a)+ const [bandB, withinB] = orderingKey(b)+ return bandA - bandB || withinA - withinB+ })+ .map((check) => {+ const open = OPEN_STATUSES.includes(check.status)+ return {+ check,+ ...(open ? openCheckRow(check) : terminalCheckRow(check, explanations.get(check.id))),+ cancelled: check.status === 'cancelled',+ cancellable: open,+ }+ })+}++/**+ * Split the rows into the ones the section always shows and the ones behind "Show more". Only rows+ * that record how a check ended without a verdict are foldable, so a long history never buries a+ * check that is still running.+ */+export function splitReportCheckRows(rows: ReportCheckRowData[]): {+ visible: ReportCheckRowData[]+ hidden: ReportCheckRowData[]+} {+ const visible: ReportCheckRowData[] = []+ const hidden: ReportCheckRowData[] = []+ for (const row of rows) {+ if (isRetired(row.check) && visible.length >= REPORT_CHECK_ROWS_BEFORE_COLLAPSE) {+ hidden.push(row)+ } else {+ visible.push(row)+ }+ }+ return { visible, hidden }+}++/** The section header's right-hand summary: how many checks, and then the next thing that happens. */+export function reportChecksMeta(checks: SignalReportCheckApi[]): string {+ if (checks.some(isRunning)) {+ // A dispatched check's `next_run_at` is the deadline its run has to answer by, so quoting it+ // as the next date would promise a run that is already under way.+ return `${checks.length} · running now`+ }+ const scheduled = checks+ .filter((check) => check.status === 'active')+ .map((check) => dayjs(check.next_run_at))+ .sort((a, b) => a.valueOf() - b.valueOf())+ if (scheduled.length > 0) {+ return `${checks.length} · next ${scheduled[0].format('MMM D')}`+ }+ if (checks.some((check) => check.status === 'pending')) {+ return `${checks.length} · waiting for resolve`+ }+ return `${checks.length} · all done`+}diff --git a/products/signals/frontend/inbox/logics/inboxReportDetailLogic.ts b/products/signals/frontend/inbox/logics/inboxReportDetailLogic.tsindex 7f9d49314b63..69a70cc7f1b6 100644--- a/products/signals/frontend/inbox/logics/inboxReportDetailLogic.ts+++ b/products/signals/frontend/inbox/logics/inboxReportDetailLogic.ts@@ -27,6 +27,8 @@ import { userLogic } from 'scenes/userLogic'import { Task, TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'import {signalsReportArtefactsDiff,+ signalsReportChecksDestroy,+ signalsReportChecksList,signalsReportPrChecks,signalsReportPrComments,signalsReportPrReviewCommentDestroy,@@ -43,6 +45,7 @@ import type {PullRequestCommentApi,PullRequestCommentReactionApi,ReportChartApi,+ SignalReportCheckApi,} from 'products/signals/frontend/generated/api.schemas'import type { SignalNodeApi } from 'products/signals/frontend/generated/api.schemas'@@ -280,6 +283,7 @@ export interface inboxReportDetailLogicValues {addReviewerOptions: AvailableReviewerOption[]availableReviewers: AvailableReviewerOption[] | nullavailableReviewersLoading: boolean+ cancellingCheckIds: string[]chartIdsKey: stringchartPlacements: ChartPlacementschartsById: Map<string, ReportChartApi>@@ -321,6 +325,8 @@ export interface inboxReportDetailLogicValues {reportArtefacts: SignalReportArtefact[] | nullreportArtefactsLoading: booleanreportCharts: ReportChartApi[]+ reportChecks: SignalReportCheckApi[] | null+ reportChecksLoading: booleanreportDiff: CommitDiffResponseApi | nullreportDiffError: string | nullreportDiffLoading: boolean@@ -347,6 +353,12 @@ export interface inboxReportDetailLogicActions {discussReportSuccess: () => {value: true} // inboxTaskKickoffLogic+ cancelReportCheck: (checkId: string) => {+ checkId: string+ }+ cancelReportCheckDone: (checkId: string) => {+ checkId: string+ }closeDraftThread: () => {value: true}@@ -440,6 +452,21 @@ export interface inboxReportDetailLogicActions {reportArtefacts: SignalReportArtefact[]payload?: any}+ loadReportChecks: () => any+ loadReportChecksFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadReportChecksSuccess: (+ reportChecks: SignalReportCheckApi[],+ payload?: any+ ) => {+ reportChecks: SignalReportCheckApi[]+ payload?: any+ }loadReportDiff: ({ artefactId }: { artefactId: string }) => {artefactId: string}@@ -689,6 +716,9 @@ export const inboxReportDetailLogic = kea<inboxReportDetailLogicType>([setFeedbackNoteDraft: (draft: string) => ({ draft }),// The note rides on the payload: the reducers below clear the draft, and listeners run after them.submitFeedbackNote: (note: string) => ({ note }),+ cancelReportCheck: (checkId: string) => ({ checkId }),+ // Fired whether the cancel succeeded or failed, so the row's button always comes back.+ cancelReportCheckDone: (checkId: string) => ({ checkId }),// Driven by the submit listener only, so the re-entrancy guard and the Send button's// loading state read the same flag.setFeedbackNoteSubmitting: (submitting: boolean) => ({ submitting }),@@ -718,6 +748,18 @@ export const inboxReportDetailLogic = kea<inboxReportDetailLogicType>([},},],+ reportChecks: [+ null as SignalReportCheckApi[] | null,+ {+ loadReportChecks: async () => {+ const response = await signalsReportChecksList(+ String(teamLogic.values.currentTeamId),+ props.reportId+ )+ return response.results+ },+ },+ ],reportTasks: [null as ReportTaskEntry[] | null,{@@ -858,6 +900,17 @@ export const inboxReportDetailLogic = kea<inboxReportDetailLogicType>([reducers({selectedPullRequestUrl: [null as string | null, { selectPullRequest: (_, { url }) => url }],+ // Checks whose cancel request is in flight, so each row's Stop button disables itself+ // without blocking a second row.+ cancellingCheckIds: [+ [] as string[],+ {+ cancelReportCheck: (state: string[], { checkId }: { checkId: string }) =>+ state.includes(checkId) ? state : [...state, checkId],+ cancelReportCheckDone: (state: string[], { checkId }: { checkId: string }) =>+ state.filter((id) => id !== checkId),+ },+ ],evidenceExpanded: [false, { expandEvidence: () => true, collapseEvidence: () => false }],report: [null as SignalReport | null,@@ -1302,6 +1355,25 @@ export const inboxReportDetailLogic = kea<inboxReportDetailLogicType>([}),listeners(({ actions, values, props }) => ({+ // The endpoint answers with the cancelled row, so the list is patched in place rather than+ // refetched: the section keeps its scroll position and the other rows never flicker.+ cancelReportCheck: async ({ checkId }) => {+ const teamId = teamLogic.values.currentTeamId+ if (!teamId) {+ actions.cancelReportCheckDone(checkId)+ return+ }+ try {+ const cancelled = await signalsReportChecksDestroy(String(teamId), props.reportId, checkId)+ actions.loadReportChecksSuccess(+ (values.reportChecks ?? []).map((check) => (check.id === checkId ? cancelled : check))+ )+ } catch (error: any) {+ lemonToast.error(error?.detail || "Couldn't stop this check. Try again in a moment.")+ } finally {+ actions.cancelReportCheckDone(checkId)+ }+ },setDetailTab: ({ tab }) => {// Reviewing the diff is the deepest engagement a report gets short of acting on it.if (tab === 'files' && values.report) {@@ -1659,6 +1731,9 @@ export const inboxReportDetailLogic = kea<inboxReportDetailLogicType>([actions.loadReportArtefacts()actions.loadReportSignals()actions.loadAvailableReviewers()+ // Loaded once per mount, unlike the artefact log: a check's soak window is measured in days+ // and the coordinator's tick is coarse, so there is nothing for a poll to catch.+ actions.loadReportChecks()// Seed the report from props so polling is gated on its status from the first tick.actions.setReport(props.report ?? null)// Register the artefact-log poll once for the lifetime of the mount and let each tick decidediff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex f260e0bf4db0..e730c49a6a88 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -62426,6 +62426,11 @@ export namespace Schemas {* * `failed` - Failed* * `errored` - Errored */readonly last_outcome: SignalReportCheckOutcomeEnum | null;+ /**+ * When the `agent` check's scout run started, cleared as soon as a verdict is recorded. A non-null value is what tells a reader the check is running rather than waiting, because dispatch also pushes `next_run_at` out to the result window. Always null on a `metric_threshold` check, which is measured in the tick that collects it.+ * @nullable+ */+ readonly dispatched_at: string | null;/** Runs that could not be measured since the last clean one. */readonly consecutive_errors: number;readonly created_at: string;