Failure clusters

Pro

Failing runs grouped by what went wrong, largest first, each with its share of failures, how it moved since last period, and a few real examples. The bar is length only; the count is always printed beside it.

Markdown

Preview

Install

With the Candor CLI

First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/failure-clusters

Brings in: agent-avatar, collapsible, locale, ops, utils · npm: lucide-react@^1.67.0

Usage

TSX · The example above
"use client"

import { FailureClusters } from "@/components/failure-clusters"
import type { FailureCluster } from "@/lib/ops"

const clusters: FailureCluster[] = [
  { id: "x1", label: "Row lock during data backfill", count: 14, delta: 9, agent: { id: "dev", name: "Dev agent", role: "coder" }, examples: ["Add region to customers: batch 12, lock timeout ×4", "Backfill tier on subscriptions: batch 3 locked by a nightly job"] },
  { id: "x2", label: "Code search timed out", count: 9, delta: -2, agent: { id: "qa", name: "QA agent", role: "tester" }, examples: ["Find code reading legacy_score: timed out after 30s"] },
  { id: "x3", label: "Asked to act without a clear target environment", count: 6, delta: 0, examples: ["“Clean up the old flags” with Production and Staging both connected"] },
]

export default function Example() {
  return <FailureClusters className="max-w-xl" clusters={clusters} />
}

<FailureClusters>

PropTypeDefaultDescription
clustersrequiredFailureClusterInput[]—Failure groups, each with its count, change since the comparison and example runs. Shown largest first. A `delta` of null (nothing to compare with) is shown as unknown.
titlestring | undefined—The heading. Defaults to "Why runs failed".
unitstring | undefined—What the total counts, plural, as in "12 failures". Defaults to "failures".
sincestring | undefined—What the change is measured against, read after "more than" and "fewer than", as in "production's run". Defaults to "last period".
classNamestring | undefined—Extra classes for the outer element.

Strings

The fixed words, in English by default. Change any of them under failureClusters in <LocaleProvider strings={{ … }}>; the table is exported as failureClustersStrings.

KeyEnglish
titleWhy runs failed
unitfailures
total{total} {unit}
sincelast period
moremore than {since}
fewerfewer than {since}
noChangeno change since {since}
unknownchange unknown