Skip to content

: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.

feat(signals): render ranking scores in the report activity log (#109320)

posthog[bot]ebfe9b746724
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 5f56dad6d581..a90e138f7fce 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -12630,6 +12630,14 @@ snapshots:
hash: v1.k794b7964.16c8190934d879b7eb46d67ee86637e34003d27e1503dfe0f52cd403f8b7ea0c.zw0vIR4b3_skhadCSU_SQkInLL9Bn0oyVSAXcZddxJo
scenes-app-signals-artefactloglist--narrow--light:
hash: v1.k794b7964.b544f07f6f96dd129bb05ad8f0847e135cb5ddacfb06f71ca7f6dea8567eeb25.l42DAUVqekLSLPYqQtoKHZtTbqH27PeNMG8swIkku3M
+ scenes-app-signals-artefactloglist--ranking-score--dark:
+ hash: v1.k794b7964.e91bde1d05b29532e240583be75cadb24b1bd59429801cdbf93ea8cacaff908a.mLrIHfiWoKr4keRohu9nY5e1hQns6qnNpTGt_dEeQTs
+ scenes-app-signals-artefactloglist--ranking-score--light:
+ hash: v1.k794b7964.72fd7470f9106cf34eb5933b1f16c57bc3151f34b660a92820930107487dc60c.T_Fa3YaQ64pCB30hqbtLwJBRJfyhm8lKUhwYhICYnw0
+ scenes-app-signals-artefactloglist--ranking-score-narrow--dark:
+ hash: v1.k794b7964.e5fdcf08501bfdcd73e1924247cd2179ee56fece5afd29decccf5afba403de32.bDQ2zxjoyqIfhic370qzv4Y7SwpGfXGO_DH1Eh3mV_g
+ scenes-app-signals-artefactloglist--ranking-score-narrow--light:
+ hash: v1.k794b7964.a22a2e79b308029f940ef0871f3b302beb10c7c28e76961e893d35b2d9967deb.SXI51Can_bZBO6MQwuLr00TuQHZQFHE2T3Ti53nRaOY
scenes-app-signals-artefactloglist--replacement-lifecycle--dark:
hash: v1.k794b7964.f723b2160bdf85cd5a827fa3dac4c281d75950f47555cdef7fc01f2ef689dfc6.wAOg7AG2Pf4mYO8EjKdD8lFlC1Ulv4MhkXIEMkzfCrg
scenes-app-signals-artefactloglist--replacement-lifecycle--light:
diff --git a/packages/agent/packages/agent-contracts/src/domain-types.ts b/packages/agent/packages/agent-contracts/src/domain-types.ts
index 9d715d54d0d0..c0e40ecb593a 100644
--- a/packages/agent/packages/agent-contracts/src/domain-types.ts
+++ b/packages/agent/packages/agent-contracts/src/domain-types.ts
@@ -1020,6 +1020,58 @@ export interface NoteContent {
author?: string | null;
}
+/** Artefact with `type: "work_claim"` — someone took ownership of the report's work. */
+export interface WorkClaimArtefact extends SignalReportArtefactBase {
+ type: "work_claim";
+ content: WorkClaimContent;
+}
+
+export interface WorkClaimContent {
+ display_name: string | null;
+}
+
+/** Artefact with `type: "work_release"` — ownership of the report's work ended. */
+export interface WorkReleaseArtefact extends SignalReportArtefactBase {
+ type: "work_release";
+ content: WorkReleaseContent;
+}
+
+export interface WorkReleaseContent {
+ reason: "released" | "taken_over";
+}
+
+/**
+ * Artefact with `type: "ranking_score"` — one scoring pass of the inbox ranking
+ * models. Only staff receive these rows.
+ */
+export interface RankingScoreArtefact extends SignalReportArtefactBase {
+ type: "ranking_score";
+ content: RankingScoreContent;
+}
+
+/** One outcome head. `readable` is false when the head has no holdout AUC yet. */
+export interface RankingHead {
+ name: string;
+ probability: number;
+ readable: boolean;
+}
+
+export interface RankingModelResult {
+ /** `<model_name>@<model_version>`. */
+ key: string;
+ roles: string[];
+ status: "scored" | "skipped";
+ skip_reason: string | null;
+ /** Highest probability first. */
+ heads: RankingHead[];
+}
+
+export interface RankingScoreContent {
+ scored_at: string | null;
+ manifest_version: string | null;
+ served: RankingModelResult;
+ challengers: RankingModelResult[];
+}
/** Response from the `commit` artefact diff endpoint — the commit rendered against its parent. */
export interface CommitDiffResponse {
/** Unified diff (patch) text introduced by the commit. */
@@ -1123,7 +1175,10 @@ export type AnySignalReportArtefact =
| LineReferenceArtefact
| CommitArtefact
| TaskRunArtefact
- | NoteArtefact;
+ | NoteArtefact
+ | WorkClaimArtefact
+ | WorkReleaseArtefact
+ | RankingScoreArtefact;
export interface SignalReportArtefactsResponse {
results: AnySignalReportArtefact[];
diff --git a/products/desktop/packages/api-client/src/posthog-client.test.ts b/products/desktop/packages/api-client/src/posthog-client.test.ts
index e9c8f9599101..396950307214 100644
--- a/products/desktop/packages/api-client/src/posthog-client.test.ts
+++ b/products/desktop/packages/api-client/src/posthog-client.test.ts
@@ -2669,6 +2669,48 @@ describe("PostHogAPIClient", () => {
task_id: "t1",
created_by: null,
},
+ {
+ id: "a15",
+ type: "work_claim",
+ content: { display_name: "Ada" },
+ created_at: "2026-06-01T00:00:14Z",
+ },
+ {
+ id: "a16",
+ type: "work_release",
+ content: { reason: "taken_over" },
+ created_at: "2026-06-01T00:00:15Z",
+ },
+ {
+ id: "a17",
+ type: "ranking_score",
+ content: {
+ scored_at: "2026-06-01T00:00:16Z",
+ manifest_version: "12",
+ served_key: "report_embeddings@2026-05-31",
+ results: {
+ "signal_counts@2026-05-31": {
+ status: "skipped",
+ roles: ["challenger"],
+ skip_reason: "missing report vector",
+ scores: {},
+ },
+ "report_embeddings@2026-05-31": {
+ status: "scored",
+ roles: ["served"],
+ scores: { pr_merged: 0.52, action: 0.78, refund: 0.04 },
+ metadata: {
+ heads: [
+ { head: "action", readable: true },
+ { head: "pr_merged", readable: true },
+ { head: "refund", readable: false },
+ ],
+ },
+ },
+ },
+ },
+ created_at: "2026-06-01T00:00:16Z",
+ },
];
it("normalizes every backend artefact type without dropping rows", async () => {
@@ -2685,6 +2727,30 @@ describe("PostHogAPIClient", () => {
expect(results.map((a) => a.id)).toEqual(ROWS.map((r) => r.id));
expect(results.map((a) => a.type)).toEqual(ROWS.map((r) => r.type));
expect(results.every((a) => !a.degraded)).toBe(true);
+ expect(results.at(-1)?.content).toEqual({
+ scored_at: "2026-06-01T00:00:16Z",
+ manifest_version: "12",
+ served: {
+ key: "report_embeddings@2026-05-31",
+ roles: ["served"],
+ status: "scored",
+ skip_reason: null,
+ heads: [
+ { name: "action", probability: 0.78, readable: true },
+ { name: "pr_merged", probability: 0.52, readable: true },
+ { name: "refund", probability: 0.04, readable: false },
+ ],
+ },
+ challengers: [
+ {
+ key: "signal_counts@2026-05-31",
+ roles: ["challenger"],
+ status: "skipped",
+ skip_reason: "missing report vector",
+ heads: [],
+ },
+ ],
+ });
});
it("keeps rows whose content does not match the type's shape as degraded previews", async () => {
@@ -2711,6 +2777,13 @@ describe("PostHogAPIClient", () => {
content: {},
created_at: "2026-06-01T00:00:02Z",
},
+ // served model missing from the results
+ {
+ id: "bad4",
+ type: "ranking_score",
+ content: { served_key: "gone@1", results: {} },
+ created_at: "2026-06-01T00:00:03Z",
+ },
];
const fetch = vi.fn().mockResolvedValue({
ok: true,
@@ -2720,7 +2793,12 @@ describe("PostHogAPIClient", () => {
const { results } = await client.getSignalReportArtefacts("r1");
- expect(results.map((a) => a.id)).toEqual(["bad1", "bad2", "bad3"]);
+ expect(results.map((a) => a.id)).toEqual([
+ "bad1",
+ "bad2",
+ "bad3",
+ "bad4",
+ ]);
expect(results.every((a) => a.degraded)).toBe(true);
expect(results[0].type).toBe("commit");
expect((results[1].content as { content: string }).content).toBe(
diff --git a/products/desktop/packages/api-client/src/posthog-client.ts b/products/desktop/packages/api-client/src/posthog-client.ts
index c16e864b1613..41bd78a9438e 100644
--- a/products/desktop/packages/api-client/src/posthog-client.ts
+++ b/products/desktop/packages/api-client/src/posthog-client.ts
@@ -41,6 +41,8 @@ import type {
OrganizationMemberBasic,
PriorityJudgmentArtefact,
ProvisionedTaskChannels,
+ RankingModelResult,
+ RankingScoreArtefact,
RepoSelectionArtefact,
SafetyJudgmentArtefact,
SandboxCustomImage,
@@ -77,6 +79,8 @@ import type {
TaskSearchResultRun,
TaskThreadMessage,
UserBasic,
+ WorkClaimArtefact,
+ WorkReleaseArtefact,
} from "@posthog/shared/domain-types";
import { buildPosthogProjectHeaderRecord } from "@posthog/shared/posthog-property-headers";
import {
@@ -1361,7 +1365,10 @@ type AnyArtefact =
| LineReferenceArtefact
| CommitArtefact
| TaskRunArtefact
- | NoteArtefact;
+ | NoteArtefact
+ | WorkClaimArtefact
+ | WorkReleaseArtefact
+ | RankingScoreArtefact;
// Reasons valid on a dismissal artefact. Resolve reasons are included because the
// backend stores resolve feedback on the same artefact type (a resolve writes a
@@ -1703,6 +1710,104 @@ function normalizeNoteArtefact(
};
}
+function normalizeWorkClaimArtefact(
+ value: Record<string, unknown>,
+): WorkClaimArtefact | null {
+ const id = optionalString(value.id);
+ if (!id || !isObjectRecord(value.content)) return null;
+ return {
+ id,
+ type: "work_claim",
+ ...artefactBase(value),
+ content: { display_name: optionalString(value.content.display_name) },
+ };
+}
+
+function normalizeWorkReleaseArtefact(
+ value: Record<string, unknown>,
+): WorkReleaseArtefact | null {
+ const id = optionalString(value.id);
+ if (!id || !isObjectRecord(value.content)) return null;
+ const reason = value.content.reason;
+ if (reason !== "released" && reason !== "taken_over") return null;
+ return {
+ id,
+ type: "work_release",
+ ...artefactBase(value),
+ content: { reason },
+ };
+}
+
+function normalizeRankingModelResult(
+ key: string,
+ value: unknown,
+): RankingModelResult | null {
+ if (!isObjectRecord(value)) return null;
+ const status = value.status;
+ if (status !== "scored" && status !== "skipped") return null;
+ // Mirrors `readable_head_names` in `ranking/model_contract.py`.
+ const metadataHeads =
+ isObjectRecord(value.metadata) && Array.isArray(value.metadata.heads)
+ ? value.metadata.heads
+ : [];
+ const readable = new Set(
+ metadataHeads
+ .filter((entry) => isObjectRecord(entry) && entry.readable === true)
+ .map((entry) => String((entry as Record<string, unknown>).head)),
+ );
+ const scores = isObjectRecord(value.scores) ? value.scores : {};
+ const heads = Object.entries(scores)
+ .filter(
+ (entry): entry is [string, number] =>
+ typeof entry[1] === "number" && Number.isFinite(entry[1]),
+ )
+ .map(([name, probability]) => ({
+ name,
+ probability,
+ readable: readable.has(name),
+ }))
+ .sort((a, b) => b.probability - a.probability);
+ return {
+ key,
+ roles: Array.isArray(value.roles)
+ ? value.roles.filter((role): role is string => typeof role === "string")
+ : [],
+ status,
+ skip_reason: optionalString(value.skip_reason),
+ heads,
+ };
+}
+
+/** Null when the content does not parse or `served_key` is missing from `results`. */
+function normalizeRankingScoreArtefact(
+ value: Record<string, unknown>,
+): RankingScoreArtefact | null {
+ const id = optionalString(value.id);
+ if (!id || !isObjectRecord(value.content)) return null;
+ const c = value.content;
+ const servedKey = optionalString(c.served_key);
+ if (!servedKey || !isObjectRecord(c.results)) return null;
+ const models = Object.entries(c.results).map(([key, result]) =>
+ normalizeRankingModelResult(key, result),
+ );
+ const served = models.find((model) => model?.key === servedKey);
+ if (!served) return null;
+ return {
+ id,
+ type: "ranking_score",
+ ...artefactBase(value),
+ content: {
+ scored_at: optionalString(c.scored_at),
+ manifest_version: optionalString(c.manifest_version),
+ served,
+ challengers: models.filter(
+ (model): model is RankingModelResult =>
+ !!model && model.key !== servedKey,
+ ),
+ },
+ };
+}
+
/** Best human-readable one-liner from arbitrary artefact content. */
function contentPreview(content: unknown): string {
if (typeof content === "string") return content;
@@ -1803,6 +1908,21 @@ function normalizeSignalReportArtefact(value: unknown): AnyArtefact | null {
if (dispatchType === "note") {
return normalizeNoteArtefact(value) ?? normalizeFallbackArtefact(value);
}
+ if (dispatchType === "work_claim") {
+ return (
+ normalizeWorkClaimArtefact(value) ?? normalizeFallbackArtefact(value)
+ );
+ }
+ if (dispatchType === "work_release") {
+ return (
+ normalizeWorkReleaseArtefact(value) ?? normalizeFallbackArtefact(value)
+ );
+ }
+ if (dispatchType === "ranking_score") {
+ return (
+ normalizeRankingScoreArtefact(value) ?? normalizeFallbackArtefact(value)
+ );
+ }
const id = optionalString(value.id);
if (!id) {
diff --git a/products/desktop/packages/ui/src/features/inbox/components/detail/ArtefactLogList.tsx b/products/desktop/packages/ui/src/features/inbox/components/detail/ArtefactLogList.tsx
index cc44db59870b..4cbdb7deec06 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/detail/ArtefactLogList.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/detail/ArtefactLogList.tsx
@@ -2,6 +2,7 @@ import {
ArrowSquareOutIcon,
CaretDownIcon,
CaretRightIcon,
+ InfoIcon,
} from "@phosphor-icons/react";
import { attributionLabel } from "@posthog/core/inbox/activityLog";
import type {
@@ -13,11 +14,16 @@ import type {
LineReferenceContent,
NoteContent,
PriorityJudgmentContent,
+ RankingHead,
+ RankingModelResult,
+ RankingScoreContent,
SafetyJudgmentContent,
SignalFindingContent,
SignalReportArtefactContent,
SuggestedReviewer,
TaskRunArtefactContent,
+ WorkClaimContent,
+ WorkReleaseContent,
} from "@posthog/shared/types";
import { MarkdownRenderer } from "@posthog/ui/features/editor/components/MarkdownRenderer";
import { ArtefactCommit } from "@posthog/ui/features/inbox/components/detail/ArtefactCommit";
@@ -29,7 +35,7 @@ import { HighlightedCode } from "@posthog/ui/primitives/HighlightedCode";
import { RelativeTimestamp } from "@posthog/ui/primitives/RelativeTimestamp";
import { cachedImageUrl } from "@posthog/ui/shell/cachedImageUrl";
import { Badge, Box, Flex, Text } from "@radix-ui/themes";
-import { useState } from "react";
+import { Fragment, useState } from "react";
// A chronological log of every artefact on a report. Each known type renders a
// tailored body; unrecognized types fall back to a plain text preview (never raw
@@ -52,8 +58,17 @@ const TYPE_LABELS: Record<string, string> = {
repo_selection: "Repo selected",
dismissal: "Report dismissed",
video_segment: "Video segment",
+ ranking_score: "Ranking scored",
+ work_claim: "Work claimed",
+ work_release: "Work released",
};
+const WORK_RELEASE_REASON_LABELS: Record<WorkReleaseContent["reason"], string> =
+ {
+ released: "Released",
+ taken_over: "Taken over",
+ };
+
function typeLabel(type: string): string {
return TYPE_LABELS[type] ?? type;
}
@@ -236,6 +251,130 @@ function ReviewersBody({ reviewers }: { reviewers: SuggestedReviewer[] }) {
);
}
+function RankingHeadRows({ heads }: { heads: RankingHead[] }) {
+ return (
+ <Box className="grid grid-cols-[minmax(0,max-content)_minmax(2rem,10rem)_auto] items-center justify-start gap-x-2 gap-y-1 text-[12px]">
+ {heads.map((head) => {
+ const percent = Math.round(head.probability * 100);
+ const tone = head.readable ? "text-(--gray-12)" : "text-(--gray-10)";
+ return (
+ <Fragment key={head.name}>
+ <Text className={`truncate ${tone}`}>{prettify(head.name)}</Text>
+ <Box className="h-1.5 overflow-hidden rounded-full bg-(--gray-4)">
+ <Box
+ className={`h-full rounded-full ${head.readable ? "bg-(--accent-9)" : "bg-(--gray-8)"}`}
+ style={{ width: `${percent}%` }}
+ />
+ </Box>
+ <Flex
+ align="center"
+ justify="end"
+ gap="1"
+ className={`tabular-nums ${tone}`}
+ >
+ {percent}%
+ {head.readable ? (
+ <span className="size-3" aria-hidden />
+ ) : (
+ <span
+ role="img"
+ title="No holdout read for this head yet"
+ aria-label="No holdout read for this head yet"
+ className="inline-flex"
+ >
+ <InfoIcon size={12} />
+ </span>
+ )}
+ </Flex>
+ </Fragment>
+ );
+ })}
+ </Box>
+ );
+}
+
+function RankingModelBody({ model }: { model: RankingModelResult }) {
+ if (model.status === "skipped" || model.heads.length === 0) {
+ return (
+ <Text className="block text-(--gray-10) text-[12px]">
+ Skipped{model.skip_reason ? `: ${model.skip_reason}` : ""}
+ </Text>
+ );
+ }
+ return <RankingHeadRows heads={model.heads} />;
+}
+
+function RankingScoreBody({ content }: { content: RankingScoreContent }) {
+ const [showOthers, setShowOthers] = useState(false);
+ const { served, challengers } = content;
+ return (
+ <Flex direction="column" gap="2" className="min-w-0">
+ <RankingModelBody model={served} />
+ <Flex
+ align="center"
+ gap="1"
+ wrap="wrap"
+ className="text-(--gray-10) text-[12px]"
+ >
+ <Text className="break-all font-mono">{served.key}</Text>
+ {content.manifest_version ? (
+ <Text>· manifest {content.manifest_version}</Text>
+ ) : null}
+ {content.scored_at ? (
+ <>
+ <Text>·</Text>
+ <RelativeTimestamp timestamp={content.scored_at} />
+ </>
+ ) : null}
+ </Flex>
+ {challengers.length > 0 ? (
+ <Box>
+ <button
+ type="button"
+ onClick={() => setShowOthers((v) => !v)}
+ aria-expanded={showOthers}
+ className="-mx-1 flex items-center gap-1 rounded-md px-1 py-0.5 text-(--gray-11) text-[13px] transition-colors hover:bg-(--gray-3) hover:text-(--gray-12)"
+ >
+ {showOthers ? (
+ <CaretDownIcon size={12} className="shrink-0" />
+ ) : (
+ <CaretRightIcon size={12} className="shrink-0" />
+ )}
+ Other models ({challengers.length})
+ </button>
+ {showOthers ? (
+ <Flex direction="column" gap="3" className="mt-2 pl-3">
+ {challengers.map((model) => {
+ const role = model.roles.find((r) => r !== "served");
+ return (
+ <Flex
+ key={model.key}
+ direction="column"
+ gap="1"
+ className="min-w-0"
+ >
+ <Flex align="center" gap="2" wrap="wrap">
+ <Text className="break-all font-mono text-(--gray-11) text-[12px]">
+ {model.key}
+ </Text>
+ {role ? (
+ <Badge color="gray" variant="soft">
+ {prettify(role)}
+ </Badge>
+ ) : null}
+ </Flex>
+ <RankingModelBody model={model} />
+ </Flex>
+ );
+ })}
+ </Flex>
+ ) : null}
+ </Box>
+ ) : null}
+ </Flex>
+ );
+}
+
function ArtefactBody({
reportId,
artefact,
@@ -248,6 +387,8 @@ function ArtefactBody({
// Degraded rows carry a plain text preview instead of their type's content
// shape — render that rather than feeding mismatched content to a typed body.
if (artefact.degraded) {
+ // A score has no text, so its preview would be a JSON dump. Show only the label.
+ if (artefact.type === "ranking_score") return null;
const text = (artefact.content as SignalReportArtefactContent | null)
?.content;
return (
@@ -378,6 +519,24 @@ function ArtefactBody({
</Flex>
);
}
+ case "ranking_score":
+ return (
+ <RankingScoreBody content={artefact.content as RankingScoreContent} />
+ );
+ case "work_claim": {
+ const name = (artefact.content as WorkClaimContent).display_name;
+ return name ? (
+ <Text className="block text-(--gray-11) text-[13px]">{name}</Text>
+ ) : null;
+ }
+ case "work_release": {
+ const c = artefact.content as WorkReleaseContent;
+ return (
+ <Badge color="gray" variant="soft">
+ {WORK_RELEASE_REASON_LABELS[c.reason]}
+ </Badge>
+ );
+ }
default: {
const c = artefact.content as SignalReportArtefactContent | null;
const text = typeof c?.content === "string" ? c.content : "";
diff --git a/products/signals/frontend/inbox/components/detail/ArtefactLogList.stories.tsx b/products/signals/frontend/inbox/components/detail/ArtefactLogList.stories.tsx
index bc138fe48f6f..7442ac1e5bb7 100644
--- a/products/signals/frontend/inbox/components/detail/ArtefactLogList.stories.tsx
+++ b/products/signals/frontend/inbox/components/detail/ArtefactLogList.stories.tsx
@@ -238,3 +238,100 @@ export const LinkedReportGates: Story = {
parameters: { mockDate: '2026-09-23T10:00:00Z' },
args: { artefacts: linkArtefacts },
}
+
+/** A staff-only scoring pass: the served model, one challenger, and one model that could not score. */
+const rankingArtefacts = [
+ {
+ id: 'work-release',
+ type: 'work_release',
+ created_at: '2026-09-29T09:58:00Z',
+ content: { reason: 'taken_over' },
+ },
+ {
+ id: 'work-claim',
+ type: 'work_claim',
+ created_at: '2026-09-29T09:56:00Z',
+ content: { display_name: 'Ada' },
+ },
+ {
+ id: 'ranking-score',
+ type: 'ranking_score',
+ created_at: '2026-09-29T09:00:00Z',
+ content: {
+ scored_at: '2026-09-29T09:00:00Z',
+ manifest_version: '12',
+ served_key: 'report_embeddings@2026-09-28',
+ results: {
+ 'report_embeddings@2026-09-28': {
+ model_name: 'report_embeddings',
+ model_version: '2026-09-28',
+ model_kind: 'xgboost',
+ roles: ['served'],
+ feature_schema_version: 3,
+ status: 'scored',
+ scores: { action: 0.78, pr_merged: 0.52, dismiss_wrong: 0.14, reviewer_fix: 0.04 },
+ metadata: {
+ heads: [
+ { head: 'action', readable: true },
+ { head: 'pr_merged', readable: true },
+ { head: 'dismiss_wrong', readable: true },
+ { head: 'reviewer_fix', readable: false },
+ ],
+ },
+ },
+ 'report_embeddings@2026-09-29': {
+ model_name: 'report_embeddings',
+ model_version: '2026-09-29',
+ model_kind: 'xgboost',
+ roles: ['challenger'],
+ feature_schema_version: 3,
+ status: 'scored',
+ scores: { action: 0.74, pr_merged: 0.55, dismiss_wrong: 0.11 },
+ metadata: {
+ heads: [
+ { head: 'action', readable: true },
+ { head: 'pr_merged', readable: true },
+ { head: 'dismiss_wrong', readable: true },
+ ],
+ },
+ },
+ 'signal_counts@2026-09-28': {
+ model_name: 'signal_counts',
+ model_version: '2026-09-28',
+ model_kind: 'xgboost',
+ roles: ['challenger'],
+ feature_schema_version: 1,
+ status: 'skipped',
+ skip_reason: 'missing report vector',
+ scores: {},
+ metadata: {},
+ },
+ },
+ },
+ },
+]
+
+const openOtherModels: Story['play'] = async ({ canvas }) => {
+ // The list renders after play starts, so wait for the disclosure or the snapshot catches it closed.
+ const summary = await canvas.findByText(/Other models/)
+ summary.closest('details')?.setAttribute('open', '')
+}
+
+export const RankingScore: Story = {
+ parameters: { mockDate: '2026-09-29T10:00:00Z' },
+ args: { artefacts: rankingArtefacts },
+ play: openOtherModels,
+}
+export const RankingScoreNarrow: Story = {
+ parameters: { mockDate: '2026-09-29T10:00:00Z' },
+ args: { artefacts: rankingArtefacts },
+ play: openOtherModels,
+ decorators: [
+ (Story) => (
+ // About 520px of scene, the width left next to the nav sidebar and an open side panel.
+ <div className="w-[20rem] p-5">
+ <Story />
+ </div>
+ ),
+ ],
+}
diff --git a/products/signals/frontend/inbox/components/detail/ArtefactLogList.test.tsx b/products/signals/frontend/inbox/components/detail/ArtefactLogList.test.tsx
index 86d7364bc93f..69f188aa61ad 100644
--- a/products/signals/frontend/inbox/components/detail/ArtefactLogList.test.tsx
+++ b/products/signals/frontend/inbox/components/detail/ArtefactLogList.test.tsx
@@ -188,4 +188,70 @@ describe('ArtefactLogList', () => {
expect.stringContaining('0198c0de-0000-7000-8000-000000000001')
)
})
+
+ it('shows the served ranking model heads, highest first, with challengers behind a disclosure', () => {
+ const { container } = render(
+ <ArtefactLogList
+ reportId="report-1"
+ artefacts={[
+ makeArtefact(
+ {
+ scored_at: '2026-06-11T09:00:00Z',
+ manifest_version: '12',
+ served_key: 'report_embeddings@2026-06-10',
+ results: {
+ 'report_embeddings@2026-06-10': {
+ status: 'scored',
+ roles: ['served'],
+ scores: { pr_merged: 0.52, action: 0.78, refund: 0.04 },
+ metadata: {
+ heads: [
+ { head: 'action', readable: true },
+ { head: 'pr_merged', readable: true },
+ { head: 'refund', readable: false },
+ ],
+ },
+ },
+ 'signal_counts@2026-06-10': {
+ status: 'skipped',
+ roles: ['challenger'],
+ skip_reason: 'missing report vector',
+ scores: {},
+ },
+ },
+ },
+ 'ranking_score'
+ ),
+ ]}
+ />
+ )
+
+ expect(screen.getByText('Ranking scored')).toBeInTheDocument()
+ expect(screen.getAllByText(/^\d+%$/).map((node) => node.textContent)).toEqual(['78%', '52%', '4%'])
+ expect(screen.getByLabelText('No holdout read for this head yet').closest('span')).toHaveTextContent('4%')
+ expect(screen.getByText('Other models (1)')).toBeInTheDocument()
+ expect(container.querySelector('details')).not.toHaveAttribute('open')
+ expect(screen.getByText('Skipped: missing report vector')).toBeInTheDocument()
+ })
+
+ it.each([
+ ['a served key missing from the results', { served_key: 'gone@1', results: {} }],
+ ['content with no results', { served_key: 'a@1' }],
+ ['a served result with an unknown status', { served_key: 'a@1', results: { 'a@1': { status: 'pending' } } }],
+ ])('falls back to the ranking label alone for %s', (_name, content) => {
+ const { container } = render(
+ <ArtefactLogList reportId="report-1" artefacts={[makeArtefact(content, 'ranking_score')]} />
+ )
+ expect(screen.getByText('Ranking scored')).toBeInTheDocument()
+ expect(container.querySelector('.LemonCard')).not.toBeInTheDocument()
+ })
+
+ it.each([
+ ['work_claim', { display_name: 'Ada' }, 'Work claimed', 'Ada'],
+ ['work_release', { reason: 'taken_over' }, 'Work released', 'Taken over'],
+ ])('labels a %s row', (type, content, label, detail) => {
+ render(<ArtefactLogList reportId="report-1" artefacts={[makeArtefact(content, type)]} />)
+ expect(screen.getByText(label)).toBeInTheDocument()
+ expect(screen.getByText(detail)).toBeInTheDocument()
+ })
})
diff --git a/products/signals/frontend/inbox/components/detail/ArtefactLogList.tsx b/products/signals/frontend/inbox/components/detail/ArtefactLogList.tsx
index e1df89496c0a..d51c8e2682ce 100644
--- a/products/signals/frontend/inbox/components/detail/ArtefactLogList.tsx
+++ b/products/signals/frontend/inbox/components/detail/ArtefactLogList.tsx
@@ -20,9 +20,11 @@ import {
IconTerminal,
IconVideoCamera,
IconExternal,
+ IconInfo,
IconPullRequest,
+ IconTrending,
} from '@posthog/icons'
-import { LemonCard, LemonTag, type LemonTagType, Link, ProfilePicture } from '@posthog/lemon-ui'
+import { LemonCard, LemonTag, type LemonTagType, Link, ProfilePicture, Tooltip } from '@posthog/lemon-ui'
import { CodeSnippet, Language } from 'lib/components/CodeSnippet'
import { TZLabel } from 'lib/components/TZLabel'
@@ -58,6 +60,10 @@ import {
ImplementationReplacementContent,
ImplementationHandoverContent,
LineReferenceContent,
+ RankingHead,
+ RankingModel,
+ RankingScoreView,
+ readRankingScore,
NoteContent,
RelatedToContent,
REPORT_LINK_KIND_LABELS,
@@ -68,6 +74,9 @@ import {
SummaryChangeContent,
TaskRunArtefactContent,
TitleChangeContent,
+ WORK_RELEASE_REASON_LABELS,
+ WorkClaimContent,
+ WorkReleaseContent,
} from './artefactTypes'
import { prActivityTitle } from './prActivityPresentation'
import { CHECK_LIFECYCLE_ENTRIES } from './reportCheckPresentation'
@@ -156,6 +165,9 @@ const ARTEFACT_MARKER: Record<string, ComponentType<{ className?: string }>> = {
implementation_decision: IconRefresh,
implementation_replacement: IconRefresh,
implementation_handover: IconRefresh,
+ ranking_score: IconTrending,
+ work_claim: IconPeople,
+ work_release: IconPeople,
}
function dismissReasonLabel(reason: string): string {
@@ -462,6 +474,92 @@ function CodeReviewBody({ content }: { content: CodeReviewContent }): JSX.Elemen
)
}
+function RankingHeadRows({ heads }: { heads: RankingHead[] }): JSX.Element {
+ return (
+ <div className="grid grid-cols-[minmax(0,max-content)_minmax(2rem,10rem)_auto] items-center justify-start gap-x-2 gap-y-1">
+ {heads.map((head) => {
+ const percent = Math.round(head.probability * 100)
+ return (
+ <Fragment key={head.name}>
+ <span className={`truncate ${head.readable ? 'text-default' : 'text-tertiary'}`}>
+ {prettify(head.name)}
+ </span>
+ <div className="h-1.5 overflow-hidden rounded-full bg-border-light">
+ <div
+ className={`h-full rounded-full ${head.readable ? 'bg-primary-3000' : 'bg-border-bold'}`}
+ // eslint-disable-next-line react/forbid-dom-props
+ style={{ width: `${percent}%` }}
+ />
+ </div>
+ <span
+ className={`inline-flex items-center justify-end gap-1 tabular-nums ${head.readable ? 'text-default' : 'text-tertiary'}`}
+ >
+ {percent}%
+ {head.readable ? (
+ <span className="size-3" aria-hidden />
+ ) : (
+ <Tooltip title="No holdout read for this head yet">
+ <IconInfo className="size-3" aria-label="No holdout read for this head yet" />
+ </Tooltip>
+ )}
+ </span>
+ </Fragment>
+ )
+ })}
+ </div>
+ )
+}
+
+function RankingModelResult({ model }: { model: RankingModel }): JSX.Element {
+ return model.status === 'skipped' || model.heads.length === 0 ? (
+ <span className="text-tertiary">Skipped{model.skipReason ? `: ${model.skipReason}` : ''}</span>
+ ) : (
+ <RankingHeadRows heads={model.heads} />
+ )
+}
+
+function RankingScoreBody({ score }: { score: RankingScoreView }): JSX.Element {
+ return (
+ <div className="flex w-full min-w-0 flex-col gap-2 text-xs">
+ <RankingModelResult model={score.served} />
+ <span className="flex flex-wrap items-center gap-x-1 text-tertiary">
+ <span className="break-all font-mono">{score.served.key}</span>
+ {score.manifestVersion ? <span>· manifest {score.manifestVersion}</span> : null}
+ {score.scoredAt ? (
+ <span className="inline-flex items-center gap-1">
+ · <TZLabel time={score.scoredAt} />
+ </span>
+ ) : null}
+ </span>
+ {score.challengers.length > 0 ? (
+ <details>
+ <summary className="cursor-pointer text-secondary">
+ Other models ({score.challengers.length})
+ </summary>
+ <div className="mt-2 flex flex-col gap-3 pl-3">
+ {score.challengers.map((model) => {
+ const role = model.roles.find((r) => r !== 'served')
+ return (
+ <div key={model.key} className="flex min-w-0 flex-col gap-1">
+ <span className="flex flex-wrap items-center gap-1.5">
+ <span className="break-all font-mono text-secondary">{model.key}</span>
+ {role ? (
+ <LemonTag size="small" type="muted">
+ {prettify(role)}
+ </LemonTag>
+ ) : null}
+ </span>
+ <RankingModelResult model={model} />
+ </div>
+ )
+ })}
+ </div>
+ </details>
+ ) : null}
+ </div>
+ )
+}
+
function renderArtefactSummary(artefact: SignalReportArtefact): JSX.Element | null {
const content = artefact.content
@@ -559,6 +657,18 @@ function renderArtefactSummary(artefact: SignalReportArtefact): JSX.Element | nu
</LemonTag>
)
}
+ case 'work_claim': {
+ const name = (content as WorkClaimContent).display_name
+ return name?.trim() ? <span className="text-xs text-secondary">{name}</span> : null
+ }
+ case 'work_release': {
+ const reason = (content as WorkReleaseContent).reason
+ return reason && WORK_RELEASE_REASON_LABELS[reason] ? (
+ <LemonTag size="small" type="muted">
+ {WORK_RELEASE_REASON_LABELS[reason]}
+ </LemonTag>
+ ) : null
+ }
default:
return null
}
@@ -722,6 +832,10 @@ function renderArtefactBody({
</div>
)
}
+ case 'ranking_score': {
+ const score = readRankingScore(content)
+ return score ? <RankingScoreBody score={score} /> : null
+ }
default: {
const value = (content as { content?: unknown })?.content
return typeof value === 'string' && value.trim() ? (
diff --git a/products/signals/frontend/inbox/components/detail/artefactTypes.ts b/products/signals/frontend/inbox/components/detail/artefactTypes.ts
index 898d1d1dc8cb..d934a45dcfb4 100644
--- a/products/signals/frontend/inbox/components/detail/artefactTypes.ts
+++ b/products/signals/frontend/inbox/components/detail/artefactTypes.ts
@@ -3,6 +3,7 @@
// (`Record<string, any>` on the artefact) and are read through these typed accessors so legacy
// rows with extra/missing keys never crash a render.
+import { isObject } from 'lib/utils/guards'
import { identifierToHuman } from 'lib/utils/strings'
import { SignalReportArtefact } from '../../types'
@@ -173,6 +174,91 @@ export interface ImplementationHandoverContent {
results?: Record<string, 'closed' | 'already_closed' | 'skipped'>
}
+export interface WorkClaimContent {
+ display_name?: string | null
+}
+
+export interface WorkReleaseContent {
+ reason?: 'released' | 'taken_over'
+}
+
+export const WORK_RELEASE_REASON_LABELS: Record<NonNullable<WorkReleaseContent['reason']>, string> = {
+ released: 'Released',
+ taken_over: 'Taken over',
+}
+
+// ── Ranking scores (staff only) ──────────────────────────────────────────────────────────────
+
+/** One outcome head of a ranking model. `readable` is false when the head has no holdout AUC yet. */
+export interface RankingHead {
+ name: string
+ probability: number
+ readable: boolean
+}
+
+export interface RankingModel {
+ key: string
+ roles: string[]
+ status: 'scored' | 'skipped'
+ skipReason: string | null
+ /** Highest probability first. */
+ heads: RankingHead[]
+}
+
+export interface RankingScoreView {
+ scoredAt: string
+ manifestVersion: string
+ served: RankingModel
+ challengers: RankingModel[]
+}
+
+/** Mirrors `readable_head_names` in `ranking/model_contract.py`. */
+function readableHeadNames(metadata: unknown): Set<string> {
+ const heads = isObject(metadata) && Array.isArray(metadata.heads) ? metadata.heads : []
+ return new Set(
+ heads.filter((entry) => isObject(entry) && entry.readable === true).map((entry) => String(entry.head))
+ )
+}
+
+function readRankingModel(key: string, value: unknown): RankingModel | null {
+ if (!isObject(value) || (value.status !== 'scored' && value.status !== 'skipped')) {
+ return null
+ }
+ const readable = readableHeadNames(value.metadata)
+ const heads = Object.entries(isObject(value.scores) ? value.scores : {})
+ .filter((entry): entry is [string, number] => typeof entry[1] === 'number' && Number.isFinite(entry[1]))
+ .map(([name, probability]) => ({ name, probability, readable: readable.has(name) }))
+ .sort((a, b) => b.probability - a.probability)
+ return {
+ key,
+ roles: Array.isArray(value.roles) ? value.roles.filter((role): role is string => typeof role === 'string') : [],
+ status: value.status,
+ skipReason: typeof value.skip_reason === 'string' ? value.skip_reason : null,
+ heads,
+ }
+}
+
+/**
+ * Reads a `ranking_score` artefact (`RankingScore` in `artefact_schemas.py`). Returns null when the
+ * content does not parse or the served model is missing, so the row shows only its label.
+ */
+export function readRankingScore(content: unknown): RankingScoreView | null {
+ if (!isObject(content) || !isObject(content.results) || typeof content.served_key !== 'string') {
+ return null
+ }
+ const models = Object.entries(content.results).map(([key, value]) => readRankingModel(key, value))
+ const served = models.find((model) => model?.key === content.served_key)
+ if (!served) {
+ return null
+ }
+ return {
+ scoredAt: typeof content.scored_at === 'string' ? content.scored_at : '',
+ manifestVersion: typeof content.manifest_version === 'string' ? content.manifest_version : '',
+ served,
+ challengers: models.filter((model): model is RankingModel => !!model && model.key !== served.key),
+ }
+}
+
// ── Activity visibility ──────────────────────────────────────────────────────────────────────
/**
@@ -220,6 +306,9 @@ export const ARTEFACT_TYPE_LABELS: Record<string, string> = {
implementation_decision: 'Open PR assessed',
implementation_replacement: 'Replacement started',
implementation_handover: 'Replacement outcome',
+ ranking_score: 'Ranking scored',
+ work_claim: 'Work claimed',
+ work_release: 'Work released',
}
export function artefactTypeLabel(type: string): string {