import type React from "react"; import type { VectorCortexDiagnosticsView } from "../api/vector-cortex"; import { Card, CardContent, CardHeader, CardTitle } from "../components/ui/card"; import { Metric } from "./VectorCortexMetric"; import { VcStatusBadge } from "./VcStatusBadge"; export function VectorCortexDiagnosticsCard({ view }: { view: VectorCortexDiagnosticsView | null }): React.ReactElement { return (
Cache Diagnostics & Breakers (VC7C)
{!view?.enabled ? (
Cache diagnostics disabled (VC7C off) — no miss is classified and no cache serve is attested here, so all caches are reported bypassed rather than hit (mode C). The classification and breaker arithmetic still runs; only this reporting seam is suppressed.
) : ( <>
Reader-only cache miss diagnostics — per-class counts and CACHE_*/M5_* codes only. Classification is exclusive and ordered (profile, range, dependency, request, generation, then unknown), so each miss increments exactly one counter. A miss diagnostic would otherwise carry the missed request itself, so request payloads, RequestHashV2 digests, covered ranges, span/covered digests, profile digests, and session ids are never exposed (SECURITY_PRIVACY). Blocked serves are demotions taken BEFORE a cache serve — on key collision, stale generation, digest failure, or profile mismatch — and are reported here only as a count; the breaker cannot be reset from this reader-only surface.
{view?.status === "awaiting_data" && (
Awaiting first event. Data will appear after the next pipeline run.
)} {view?.status === "deferred" && view?.deferredReason && (
Deferred: {view.deferredReason.replace(/_/g, " ")}
)} )}
); }