Skip to content
GitHub (opens in a new tab)
AgentsBlock

Anomaly detail

One metric anomaly an agent flagged, so a person understands it before anything is fixed. It shows what happened, the likely cause with the agent's confidence, and the evidence and causes ruled out beside them.

What a block is

A block is a kit component for a whole area of a screen, built only from other kit components and tokens. You import it like any component; nothing is copied into your app. Put it inside your page’s <main>: it brings no header or nav of its own.

When to use

  • a watcher agent flags a business metric (payments, usage, refunds, tax) and a person reviews it before a fix runs
  • show what happened, how much it matters and why the agent thinks it happened, on one record page
  • keep the causes the agent checked and ruled out beside the evidence

When not to use

  • a live incident with phases and responders — the incident-timeline screen
  • failed agent runs grouped by cause — FailureClusters
  • a ranked list of findings across metrics — the insight-stack pattern
  • approve the fix itself — PlanReview or ApprovalCard, after Review fix

Usage

import { AnomalyDetail } from "agentic-ds-kit";

export function AnomalyPage({ anomaly }) {
  return (
    <main className="layout-content">
      <AnomalyDetail
        title={anomaly.title}                // "EU-West usage stopped reaching billing"
        lead={anomaly.lead}                  // "Flagged by Usage watcher at 06:40 · 38 accounts"
        agent="Usage watcher"
        severity="high"
        chart={anomaly.chart}                // { labels, series, description?, tooltipNote? }
        impact={anomaly.impact}              // { id, label, value }[], up to four
        cause={anomaly.cause}                // { title, description, confidence, confidenceNote?, source? }
        evidence={anomaly.evidence}          // ActivityFeed events
        alternatives={anomaly.alternatives}  // { id, label, detail?, verdict }[]
        onReviewFix={() => openFix(anomaly.id)}
        onRejectCause={() => rejectCause(anomaly.id)}
      />
    </main>
  );
}

Layout

  • header (h2 title, status and severity Badges, lead), then layout-split--primary: the What happened Card and the cause InsightCard on the wide side, Evidence and Checked and ruled out on the narrow side
  • the block is its own inline-size container; below --grid-breakpoint-md (64rem) of block width the sides stack, evidence after the cause

Props

NameTypeRequiredDefaultNotes
titlestringYes—The anomaly in words, e.g. "EU-West usage stopped reaching billing". The block's h2.
leadstringNo—Line under the title, e.g. "Flagged by Usage watcher at 06:40 · 38 accounts".
statusopen | fixing | resolved | dismissedNoopenStatus Badge beside the title: open warning, fixing info, resolved success, dismissed neutral. Anything but open hides Review fix and Not the cause.
severitylow | medium | highNo—Severity Badge after the status, in words ("High severity"): high danger, medium warning, low neutral. Left out, no severity Badge.
chartobjectYes—{ labels: string[], series: LineChartSeries[], description?, tooltipNote?, referenceLine? }, passed to a LineChart (variant line) in the What happened Card. Use a dashed series for what was expected or last period.
impactarrayNo—2–4 of { id, label, value }, e.g. { label: "Revenue at stake", value: "€21,600" }. Plain sm Scorecards in one row under the chart. More than four are cut to four.
causeobjectNo—{ title, description?, confidence: "low" | "medium" | "high", confidenceNote?, source? }. A large warning InsightCard; confidence reads "High confidence · 91%" with confidenceNote. Left out, the block says the agent has no likely cause yet.
evidencearrayNo—ActivityFeed events ({ id, type, actor, verb, object, at, detail?, status? }[]), shown as ActivityFeed variant history titled Evidence.
alternativesarrayNo—{ id, label, detail?, verdict: "ruled-out" | "unverified" }[]. A ListView titled Checked and ruled out, each row with its verdict as a Badge in words.
agentstringNo—Which agent flagged it, e.g. "Usage watcher". Joins the cause eyebrow: "Likely cause · Usage watcher".
onReviewFixfunctionNo—() => void. Review fix on the cause card: an outline neutral md Button, last in its footer (Not the cause is ghost neutral md before it). Open status with a cause only. Opens the fix in PlanReview or ApprovalCard.
onRejectCausefunctionNo—() => void. Not the cause on the cause card (outline). Open status with a cause only.

Built from

  • Block
    →

    Failure clusters

    Failed runs across every agent, grouped by likely cause so you fix causes, not single runs.

  • Pattern
    →

    Insight stack

    A ranked AI summary card: findings with a change and a Why? panel, a loading state and an all-clear state.

  • Block
    →

    Plan review

    The go / no-go before an agent runs: edit its steps, see what will change, then approve, send back or reject.

  • Component
    →

    ApprovalCard

    The agent asks before it acts: risk, what will happen in words, an exact preview of the command or diff, and Approve (⌘/Ctrl+Enter) / Deny (Escape) with an optional auto-deny countdown.