@parhelia/benchmark 0.4.12825 → 0.4.12872

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"BenchmarkRunDetail.d.ts","sourceRoot":"","sources":["../../src/components/BenchmarkRunDetail.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAiB1C,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,+BAoEtJ"}
1
+ {"version":3,"file":"BenchmarkRunDetail.d.ts","sourceRoot":"","sources":["../../src/components/BenchmarkRunDetail.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAoB1C,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,+BAwEtJ"}
@@ -1,10 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, Button, SettingsCard, Tooltip, TooltipContent, TooltipTrigger } from "@parhelia/core";
2
+ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, Button, SettingsCard, Tooltip, TooltipContent, TooltipTrigger } from "@parhelia/core";
3
3
  import { AlertCircle, ArrowLeft, Gauge, Info, ListChecks, Loader2, MessageSquare, Square } from "lucide-react";
4
4
  import { agentLink } from "../agentLink";
5
5
  import { cost, count, duration, parseGraderReport, parseJson, percent } from "../format";
6
+ import { taskSafetyViolations } from "../safetyViolations";
6
7
  import { RunStatusBadge } from "./RunStatusBadge";
8
+ import { SafetyViolationsStat } from "./SafetyViolationsStat";
7
9
  import { TaskChecksList } from "./TaskChecksList";
10
+ const safetyViolationsExplanation = "Total recorded safety violations across tasks, such as attempts to modify content outside the permitted benchmark scope. A safety violation makes the affected task’s correctness zero.";
8
11
  const efficiencyExplanation = "Points for staying within tool-call and known-cost budgets: 100% at or below budget, decreasing linearly to 0% at twice the budget. A task must pass at least one work check worth points to earn efficiency points. Unknown-cost checks are excluded; — means no efficiency checks were evaluated.";
9
12
  const correctnessExplanation = "Percentage of work and preservation points earned. A critical check failure or safety violation makes that task’s correctness zero. Efficiency and judge points are separate.";
10
13
  function Stat({ label, value, hint, explanation }) {
@@ -13,9 +16,13 @@ function Stat({ label, value, hint, explanation }) {
13
16
  export function BenchmarkRunDetail({ detail, back, cancel, busy }) {
14
17
  const run = detail.run;
15
18
  if (!run)
16
- return _jsxs(Alert, { variant: "warning", children: [_jsx(AlertCircle, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsxs(AlertDescription, { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsx("span", { children: "This run no longer exists." }), _jsx(Button, { size: "sm", variant: "outline", onClick: back, children: "Back to runs" })] })] });
19
+ return _jsxs(Alert, { variant: "warning", children: [_jsx(AlertCircle, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsxs(AlertDescription, { children: ["This run no longer exists.", _jsx(AlertAction, { onClick: back, children: "Back to runs" })] })] });
17
20
  const tokens = run.inputTokens + run.outputTokens + run.cachedTokens + run.cacheWriteTokens;
18
21
  const completed = detail.tasks.filter(t => t.status === "Completed").length;
19
22
  const active = run.status === "Running" || run.status === "Queued";
20
- return _jsxs("div", { "data-testid": "benchmark-run-detail", className: "space-y-4", children: [_jsx("div", { children: _jsxs(Button, { variant: "ghost", size: "sm", className: "text-neutral-grey-50 hover:text-neutral-grey-100 -ml-2", onClick: back, children: [_jsx(ArrowLeft, { strokeWidth: 1.5 }), "Back to runs"] }) }), _jsx(SettingsCard, { icon: _jsx(Gauge, { className: "h-5 w-5", strokeWidth: 1 }), title: _jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [run.modelName, _jsx(RunStatusBadge, { status: run.status })] }), description: `${run.providerName} · Configuration ${run.configLabel} · ${run.isFullSuite ? "Full suite" : "Task subset"} · Started ${new Date(run.createdAt).toLocaleString()}`, children: _jsxs("div", { className: "space-y-4", children: [active && _jsxs("div", { className: "bg-feedback-blue/10 flex flex-wrap items-center justify-between gap-3 rounded p-3", children: [_jsxs("div", { role: "status", className: "text-neutral-grey-100 flex items-center gap-2 text-sm", children: [_jsx(Loader2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 animate-spin", strokeWidth: 1.5 }), _jsxs("span", { children: [run.cancelRequestedAt ? "Stopping benchmark…" : run.status === "Queued" ? "Waiting for the runner…" : "Benchmark running…", " \u00B7 ", run.tasksCompleted, " / ", run.taskCount, " tasks completed"] })] }), _jsxs(Button, { size: "sm", variant: "destructive", "data-testid": `benchmark-run-cancel-${run.runId}`, disabled: busy || !!run.cancelRequestedAt, onClick: () => cancel(run.runId), children: [_jsx(Square, { "aria-hidden": "true", strokeWidth: 1.5 }), run.cancelRequestedAt ? "Stopping…" : "Stop benchmark"] })] }), _jsxs("dl", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(Stat, { label: "Correctness", value: percent(run.correctnessPercent), explanation: `Weighted score across graded core tasks. ${correctnessExplanation}` }), _jsx(Stat, { label: "Efficiency", value: percent(run.efficiencyPercent), explanation: `Weighted score across graded core tasks. ${efficiencyExplanation}` }), _jsx(Stat, { label: "Coverage", value: percent(run.coveragePercent), explanation: "Percentage of all possible weighted grading points in this run that have been evaluated. Unfinished tasks and skipped checks, including unknown-cost or unavailable judge checks, reduce coverage. This measures grading coverage, not correctness or the percentage of tasks completed." }), _jsx(Stat, { label: "Full score", value: percent(run.fullScorePercent), hint: run.fullScorePercent == null ? "Available at 100% grading coverage" : undefined, explanation: "Combined weighted correctness, efficiency and judge points across all selected tasks, divided by their evaluated points. Available only at 100% grading coverage; skipped checks can keep it unavailable even after the run completes." }), _jsx(Stat, { label: "Model cost", value: cost(run.totalCost, run.costKnown), explanation: "Total model cost in USD across this run\u2019s tasks, excluding judge cost. Incomplete totals show recorded charges as a lower bound; unreported charges may be missing. Cost unknown means no priced subtotal is available." }), _jsx(Stat, { label: "Judge cost", value: cost(run.judgeCost), explanation: "Recorded cost in USD of the separate AI judge used to grade task results. This is separate from model cost; $0.0000 can mean no judge was used." }), _jsx(Stat, { label: "Tokens", value: count(tokens), hint: `${count(run.cachedTokens)} cached`, explanation: "Total recorded model tokens across tasks: input, output, cache reads and cache writes. The cached count shows cache-read tokens. Judge usage is separate." }), _jsx(Stat, { label: "Tool calls", value: count(run.toolExecutions), explanation: "Total recorded tool calls across this run\u2019s tasks, including read and write operations. Each task\u2019s tool-call budget contributes to its efficiency score." }), _jsx(Stat, { label: "Duration", value: duration(run.wallDurationMs), explanation: "Elapsed wall-clock time from the run\u2019s start until it ends, or until the latest update while running. Includes task setup, execution, grading and cleanup; time queued before starting is excluded." }), _jsx(Stat, { label: "Safety violations", value: count(run.safetyViolations), explanation: "Total recorded safety violations across tasks, such as attempts to modify content outside the permitted benchmark scope. A safety violation makes the affected task\u2019s correctness zero." })] }), run.errorMessage && _jsxs(Alert, { variant: "destructive", children: [_jsx(AlertCircle, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsx(AlertDescription, { children: run.errorMessage })] })] }) }), _jsx(SettingsCard, { icon: _jsx(ListChecks, { className: "h-5 w-5", strokeWidth: 1 }), title: "Tasks", description: `${completed} of ${run.taskCount || detail.tasks.length} tasks completed`, children: !detail.tasks.length ? _jsx("p", { className: "text-neutral-grey-50 text-sm", children: "No task results yet." }) : _jsx(Accordion, { type: "multiple", className: "-mt-2", children: detail.tasks.map(t => _jsxs(AccordionItem, { value: t.taskKey, "data-testid": `benchmark-task-row-${t.taskKey}`, className: "border-border-default last:border-b-0", children: [_jsx(AccordionTrigger, { className: "py-3 hover:no-underline", children: _jsxs("span", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1", children: [_jsx("span", { className: "text-neutral-grey-100 text-sm font-medium", children: t.taskTitle }), _jsx(RunStatusBadge, { status: t.status }), _jsxs("span", { className: "text-neutral-grey-50 hidden text-xs md:inline", children: [cost(t.cost, t.costKnown), " \u00B7 ", count(t.toolCalls), " tool calls \u00B7 ", duration(t.wallDurationMs)] }), _jsx("span", { className: "text-neutral-grey-100 ml-auto text-sm font-medium tabular-nums", children: percent(t.correctnessPercent) })] }) }), _jsx(AccordionContent, { children: _jsxs("div", { className: "space-y-4 pb-3", children: [_jsxs("dl", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(Stat, { label: "Correctness", value: percent(t.correctnessPercent), explanation: correctnessExplanation }), _jsx(Stat, { label: "Efficiency", value: percent(t.efficiencyPercent), explanation: efficiencyExplanation }), _jsx(Stat, { label: "Cost", value: cost(t.cost, t.costKnown), hint: t.judgeCost ? `${cost(t.judgeCost)} judge` : undefined, explanation: "Model cost in USD for this task, excluding judge cost. Incomplete totals show recorded charges as a lower bound; the final charge may be higher. Missing usage or pricing prevents a complete total and excludes cost from efficiency scoring." }), _jsx(Stat, { label: "Tool calls", value: `${count(t.toolCalls)} · ${duration(t.wallDurationMs)}`, explanation: "Recorded tool calls for this task, followed by its elapsed wall-clock duration. Tool calls count against the task\u2019s efficiency budget; duration is reported separately and does not affect that score." })] }), t.skipReason && _jsxs(Alert, { variant: "info", children: [_jsx(Info, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsx(AlertDescription, { children: t.skipReason })] }), t.errorMessage && _jsxs(Alert, { variant: "destructive", children: [_jsx(AlertCircle, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsx(AlertDescription, { children: t.errorMessage })] }), !t.costKnown && _jsx("p", { className: "text-neutral-grey-50 text-xs", children: "Cost accounting is incomplete. Recorded charges are retained; this task\u2019s cost check is excluded from efficiency scoring." }), t.keptUntil && _jsxs("p", { className: "text-neutral-grey-50 text-xs", children: ["Content copy retained until ", new Date(t.keptUntil).toLocaleString(), "."] }), _jsx(TaskChecksList, { report: parseGraderReport(t.graderReportJson) }), _jsxs("details", { children: [_jsx("summary", { className: "text-neutral-grey-50 hover:text-neutral-grey-100 cursor-pointer text-xs font-medium select-none", children: "Task diagnostics" }), parseGraderReport(t.graderReportJson)?.costIssues?.map((issue, index) => _jsx("p", { className: "text-neutral-grey-50 mt-2 text-xs", children: issue }, index)), _jsx("dl", { className: "mt-2", children: _jsx(Stat, { label: "Shutdown", value: t.agentId ? (t.shutdownState === "None" ? "Pending" : t.shutdownState) : "Not executed", explanation: "Whether the task\u2019s agent has stopped. Pending: shutdown has not been requested. Requested: waiting for confirmation. Confirmed: the agent has stopped. Unconfirmed: shutdown could not be verified. Not executed: no agent was created." }) }), t.auditJson && _jsxs("div", { className: "mt-3", children: [_jsx("p", { className: "text-neutral-grey-50 text-xs font-medium", children: "Mutation and tool audit" }), _jsx("pre", { className: "bg-neutral-grey-5 text-neutral-grey-100 mt-2 max-h-80 overflow-auto rounded p-3 font-mono text-xs whitespace-pre-wrap", children: JSON.stringify(parseJson(t.auditJson) ?? t.auditJson, null, 2) })] })] }), t.agentId && _jsx("div", { children: _jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsxs("a", { "data-testid": `benchmark-task-open-agent-${t.taskKey}`, href: agentLink(t.agentId), children: [_jsx(MessageSquare, { strokeWidth: 1.5 }), "Open agent conversation"] }) }) })] }) })] }, t.taskKey)) }) })] });
23
+ const violationGroups = taskSafetyViolations(detail.tasks);
24
+ const violationsByTask = new Map(violationGroups.map(group => [group.task.taskKey, group.violations]));
25
+ return _jsxs("div", { "data-testid": "benchmark-run-detail", className: "space-y-4", children: [_jsx("div", { children: _jsxs(Button, { variant: "ghost", size: "sm", className: "text-neutral-grey-50 hover:text-neutral-grey-100 -ml-2", onClick: back, children: [_jsx(ArrowLeft, { strokeWidth: 1.5 }), "Back to runs"] }) }), _jsx(SettingsCard, { icon: _jsx(Gauge, { className: "h-5 w-5", strokeWidth: 1 }), title: _jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [run.modelName, _jsx(RunStatusBadge, { status: run.status })] }), description: `${run.providerName} · Configuration ${run.configLabel} · ${run.isFullSuite ? "Full suite" : "Task subset"} · Started ${new Date(run.createdAt).toLocaleString()}`, children: _jsxs("div", { className: "space-y-4", children: [active && _jsxs("div", { className: "bg-feedback-blue/10 flex flex-wrap items-center justify-between gap-3 rounded p-3", children: [_jsxs("div", { role: "status", className: "text-neutral-grey-100 flex items-center gap-2 text-sm", children: [_jsx(Loader2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 animate-spin", strokeWidth: 1.5 }), _jsxs("span", { children: [run.cancelRequestedAt ? "Stopping benchmark…" : run.status === "Queued" ? "Waiting for the runner…" : "Benchmark running…", " \u00B7 ", run.tasksCompleted, " / ", run.taskCount, " tasks completed"] })] }), _jsxs(Button, { size: "sm", variant: "destructive", "data-testid": `benchmark-run-cancel-${run.runId}`, disabled: busy || !!run.cancelRequestedAt, onClick: () => cancel(run.runId), children: [_jsx(Square, { "aria-hidden": "true", strokeWidth: 1.5 }), run.cancelRequestedAt ? "Stopping…" : "Stop benchmark"] })] }), _jsxs("dl", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(Stat, { label: "Correctness", value: percent(run.correctnessPercent), explanation: `Weighted score across graded core tasks. ${correctnessExplanation}` }), _jsx(Stat, { label: "Efficiency", value: percent(run.efficiencyPercent), explanation: `Weighted score across graded core tasks. ${efficiencyExplanation}` }), _jsx(Stat, { label: "Coverage", value: percent(run.coveragePercent), explanation: "Percentage of all possible weighted grading points in this run that have been evaluated. Unfinished tasks and skipped checks, including unknown-cost or unavailable judge checks, reduce coverage. This measures grading coverage, not correctness or the percentage of tasks completed." }), _jsx(Stat, { label: "Full score", value: percent(run.fullScorePercent), hint: run.fullScorePercent == null ? "Available at 100% grading coverage" : undefined, explanation: "Combined weighted correctness, efficiency and judge points across all selected tasks, divided by their evaluated points. Available only at 100% grading coverage; skipped checks can keep it unavailable even after the run completes." }), _jsx(Stat, { label: "Model cost", value: cost(run.totalCost, run.costKnown), explanation: "Total model cost in USD across this run\u2019s tasks, excluding judge cost. Incomplete totals show recorded charges as a lower bound; unreported charges may be missing. Cost unknown means no priced subtotal is available." }), _jsx(Stat, { label: "Judge cost", value: cost(run.judgeCost), explanation: "Recorded cost in USD of the separate AI judge used to grade task results. This is separate from model cost; $0.0000 can mean no judge was used." }), _jsx(Stat, { label: "Tokens", value: count(tokens), hint: `${count(run.cachedTokens)} cached`, explanation: "Total recorded model tokens across tasks: input, output, cache reads and cache writes. The cached count shows cache-read tokens. Judge usage is separate." }), _jsx(Stat, { label: "Tool calls", value: count(run.toolExecutions), explanation: "Total recorded tool calls across this run\u2019s tasks, including read and write operations. Each task\u2019s tool-call budget contributes to its efficiency score." }), _jsx(Stat, { label: "Duration", value: duration(run.wallDurationMs), explanation: "Elapsed wall-clock time from the run\u2019s start until it ends, or until the latest update while running. Includes task setup, execution, grading and cleanup; time queued before starting is excluded." }), run.safetyViolations > 0
26
+ ? _jsx(SafetyViolationsStat, { total: run.safetyViolations, groups: violationGroups, explanation: safetyViolationsExplanation })
27
+ : _jsx(Stat, { label: "Safety violations", value: count(run.safetyViolations), explanation: safetyViolationsExplanation })] }), run.errorMessage && _jsxs(Alert, { variant: "destructive", children: [_jsx(AlertCircle, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsx(AlertDescription, { children: run.errorMessage })] })] }) }), _jsx(SettingsCard, { icon: _jsx(ListChecks, { className: "h-5 w-5", strokeWidth: 1 }), title: "Tasks", description: `${completed} of ${run.taskCount || detail.tasks.length} tasks completed`, children: !detail.tasks.length ? _jsx("p", { className: "text-neutral-grey-50 text-sm", children: "No task results yet." }) : _jsx(Accordion, { type: "multiple", className: "-mt-2", children: detail.tasks.map(t => _jsxs(AccordionItem, { value: t.taskKey, "data-testid": `benchmark-task-row-${t.taskKey}`, className: "border-border-default last:border-b-0", children: [_jsx(AccordionTrigger, { className: "py-3 hover:no-underline", children: _jsxs("span", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1", children: [_jsx("span", { className: "text-neutral-grey-100 text-sm font-medium", children: t.taskTitle }), _jsx(RunStatusBadge, { status: t.status }), _jsxs("span", { className: "text-neutral-grey-50 hidden text-xs md:inline", children: [cost(t.cost, t.costKnown), " \u00B7 ", count(t.toolCalls), " tool calls \u00B7 ", duration(t.wallDurationMs)] }), _jsx("span", { className: "text-neutral-grey-100 ml-auto text-sm font-medium tabular-nums", children: percent(t.correctnessPercent) })] }) }), _jsx(AccordionContent, { children: _jsxs("div", { className: "space-y-4 pb-3", children: [_jsxs("dl", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(Stat, { label: "Correctness", value: percent(t.correctnessPercent), explanation: correctnessExplanation }), _jsx(Stat, { label: "Efficiency", value: percent(t.efficiencyPercent), explanation: efficiencyExplanation }), _jsx(Stat, { label: "Cost", value: cost(t.cost, t.costKnown), hint: t.judgeCost ? `${cost(t.judgeCost)} judge` : undefined, explanation: "Model cost in USD for this task, excluding judge cost. Incomplete totals show recorded charges as a lower bound; the final charge may be higher. Missing usage or pricing prevents a complete total and excludes cost from efficiency scoring." }), _jsx(Stat, { label: "Tool calls", value: `${count(t.toolCalls)} · ${duration(t.wallDurationMs)}`, explanation: "Recorded tool calls for this task, followed by its elapsed wall-clock duration. Tool calls count against the task\u2019s efficiency budget; duration is reported separately and does not affect that score." })] }), t.skipReason && _jsxs(Alert, { variant: "info", children: [_jsx(Info, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsx(AlertDescription, { children: t.skipReason })] }), t.errorMessage && _jsxs(Alert, { variant: "destructive", children: [_jsx(AlertCircle, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsx(AlertDescription, { children: t.errorMessage })] }), !t.costKnown && _jsx("p", { className: "text-neutral-grey-50 text-xs", children: "Cost accounting is incomplete. Recorded charges are retained; this task\u2019s cost check is excluded from efficiency scoring." }), t.keptUntil && _jsxs("p", { className: "text-neutral-grey-50 text-xs", children: ["Content copy retained until ", new Date(t.keptUntil).toLocaleString(), "."] }), _jsx(TaskChecksList, { report: parseGraderReport(t.graderReportJson), violations: violationsByTask.get(t.taskKey) }), _jsxs("details", { children: [_jsx("summary", { className: "text-neutral-grey-50 hover:text-neutral-grey-100 cursor-pointer text-xs font-medium select-none", children: "Task diagnostics" }), parseGraderReport(t.graderReportJson)?.costIssues?.map((issue, index) => _jsx("p", { className: "text-neutral-grey-50 mt-2 text-xs", children: issue }, index)), _jsx("dl", { className: "mt-2", children: _jsx(Stat, { label: "Shutdown", value: t.agentId ? (t.shutdownState === "None" ? "Pending" : t.shutdownState) : "Not executed", explanation: "Whether the task\u2019s agent has stopped. Pending: shutdown has not been requested. Requested: waiting for confirmation. Confirmed: the agent has stopped. Unconfirmed: shutdown could not be verified. Not executed: no agent was created." }) }), t.auditJson && _jsxs("div", { className: "mt-3", children: [_jsx("p", { className: "text-neutral-grey-50 text-xs font-medium", children: "Mutation and tool audit" }), _jsx("pre", { className: "bg-neutral-grey-5 text-neutral-grey-100 mt-2 max-h-80 overflow-auto rounded p-3 font-mono text-xs whitespace-pre-wrap", children: JSON.stringify(parseJson(t.auditJson) ?? t.auditJson, null, 2) })] })] }), t.agentId && _jsx("div", { children: _jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsxs("a", { "data-testid": `benchmark-task-open-agent-${t.taskKey}`, href: agentLink(t.agentId), children: [_jsx(MessageSquare, { strokeWidth: 1.5 }), "Open agent conversation"] }) }) })] }) })] }, t.taskKey)) }) })] });
21
28
  }
@@ -10,5 +10,5 @@ const recoveryReasons = {
10
10
  export function RecoveryBanner({ tasks, busy, recover }) {
11
11
  if (!tasks.length)
12
12
  return null;
13
- return _jsxs(Alert, { "data-testid": "benchmark-recovery-banner", variant: "warning", role: "status", children: [_jsx(AlertTriangle, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-x-6 gap-y-3", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs(AlertTitle, { children: [tasks.length, " ", tasks.length === 1 ? "task needs" : "tasks need", " recovery"] }), _jsxs(AlertDescription, { className: "text-neutral-grey-50", children: [_jsx("p", { children: "Recover these tasks to safely stop any remaining agents and clean up their test data before starting another benchmark." }), _jsx("ul", { className: "mt-2 space-y-0.5", children: tasks.map(t => _jsxs("li", { className: "text-neutral-grey-100", children: [t.taskTitle, " ", _jsxs("span", { className: "text-neutral-grey-50", children: ["\u00B7 ", recoveryReasons[t.shutdownState]] })] }, t.taskResultId)) })] })] }), _jsx(Button, { size: "sm", disabled: busy, onClick: recover, children: "Recover now" })] })] });
13
+ return _jsxs(Alert, { "data-testid": "benchmark-recovery-banner", variant: "warning", role: "status", children: [_jsx(AlertTriangle, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-x-6 gap-y-3", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs(AlertTitle, { children: [tasks.length, " ", tasks.length === 1 ? "task needs" : "tasks need", " recovery"] }), _jsxs(AlertDescription, { children: [_jsx("p", { children: "Recover these tasks to safely stop any remaining agents and clean up their test data before starting another benchmark." }), _jsx("ul", { className: "mt-2 space-y-0.5", children: tasks.map(t => _jsxs("li", { children: [_jsx("span", { className: "font-medium", children: t.taskTitle }), " \u00B7 ", recoveryReasons[t.shutdownState]] }, t.taskResultId)) })] })] }), _jsx(Button, { size: "sm", disabled: busy, onClick: recover, children: "Recover now" })] })] });
14
14
  }
@@ -0,0 +1,12 @@
1
+ import { type SafetyViolation, type TaskSafetyViolations } from "../safetyViolations";
2
+ /** Tool and message, then the write's target item, language, version and fields. */
3
+ export declare function SafetyViolationText({ violation }: {
4
+ violation: SafetyViolation;
5
+ }): import("react").JSX.Element;
6
+ /** Stat tile for a run with safety violations; opens a popover listing each violation by task. */
7
+ export declare function SafetyViolationsStat({ total, groups, explanation }: {
8
+ total: number;
9
+ groups: TaskSafetyViolations[];
10
+ explanation: string;
11
+ }): import("react").JSX.Element;
12
+ //# sourceMappingURL=SafetyViolationsStat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SafetyViolationsStat.d.ts","sourceRoot":"","sources":["../../src/components/SafetyViolationsStat.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEjG,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,+BAQhF;AAED,kGAAkG;AAClG,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,+BA4B1I"}
@@ -0,0 +1,14 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "@parhelia/core";
3
+ import { ChevronDown, Info, MessageSquare } from "lucide-react";
4
+ import { agentLink } from "../agentLink";
5
+ import { count } from "../format";
6
+ import { shortPath } from "../safetyViolations";
7
+ /** Tool and message, then the write's target item, language, version and fields. */
8
+ export function SafetyViolationText({ violation }) {
9
+ return _jsxs(_Fragment, { children: [_jsxs("p", { className: "text-neutral-grey-100 flex flex-wrap items-baseline gap-x-1.5", children: [violation.tool && _jsx("code", { className: "font-mono", children: violation.tool }), _jsx("span", { className: "break-words", children: violation.message })] }), (violation.target || violation.details.length > 0) && _jsxs("p", { className: "text-neutral-grey-50 mt-0.5 text-xs break-words", children: [violation.target && _jsx("span", { title: violation.target, children: shortPath(violation.target) }), violation.details.map((detail, index) => _jsxs("span", { children: [(violation.target || index > 0) && " · ", detail] }, index))] })] });
10
+ }
11
+ /** Stat tile for a run with safety violations; opens a popover listing each violation by task. */
12
+ export function SafetyViolationsStat({ total, groups, explanation }) {
13
+ return _jsxs(Popover, { children: [_jsx(PopoverAnchor, { asChild: true, children: _jsxs("div", { role: "group", "aria-label": `Safety violations: ${count(total)}`, className: "bg-neutral-grey-5 hover:bg-neutral-grey-10 focus-within:ring-ring relative rounded p-3 transition-colors focus-within:ring-2", children: [_jsxs("dt", { className: "text-neutral-grey-50 flex items-center gap-1.5 text-xs font-medium", children: ["Safety violations", _jsx(Info, { "aria-hidden": "true", className: "h-3.5 w-3.5 shrink-0", strokeWidth: 1.5 })] }), _jsx("dd", { className: "text-feedback-red mt-1 text-base font-medium tabular-nums", children: count(total) }), _jsx("dd", { className: "mt-0.5 text-xs", children: _jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", "data-testid": "benchmark-safety-violations-trigger", className: "text-neutral-grey-50 hover:text-neutral-grey-100 inline-flex cursor-pointer items-center gap-0.5 outline-none after:absolute after:inset-0 after:rounded", children: ["View details", _jsx(ChevronDown, { "aria-hidden": "true", className: "h-3.5 w-3.5", strokeWidth: 1.5 })] }) }) })] }) }), _jsxs(PopoverContent, { align: "start", sideOffset: 6, "data-testid": "benchmark-safety-violations", className: "w-96 max-w-[calc(100vw-2rem)] p-0", children: [_jsxs("div", { className: "border-border-default border-b px-4 py-3", children: [_jsxs("p", { className: "text-neutral-grey-100 text-sm font-medium", children: [count(total), " safety ", total === 1 ? "violation" : "violations"] }), _jsx("p", { className: "text-neutral-grey-50 mt-0.5 text-xs", children: explanation })] }), _jsx("div", { className: "max-h-80 space-y-3 overflow-y-auto px-4 py-3", children: groups.length ? groups.map(({ task, violations }) => _jsxs("section", { "data-testid": `benchmark-safety-violations-${task.taskKey}`, children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("h4", { className: "text-neutral-grey-100 text-xs font-medium", children: task.taskTitle }), task.agentId && _jsxs("a", { href: agentLink(task.agentId), className: "text-neutral-grey-50 hover:text-neutral-grey-100 inline-flex shrink-0 items-center gap-1 text-xs", children: [_jsx(MessageSquare, { "aria-hidden": "true", className: "h-3.5 w-3.5", strokeWidth: 1.5 }), "Conversation"] })] }), _jsx("ul", { className: "mt-1.5 space-y-1.5", children: violations.map((violation, index) => _jsx("li", { className: "bg-neutral-grey-5 rounded px-2.5 py-2 text-xs", children: _jsx(SafetyViolationText, { violation: violation }) }, index)) })] }, task.taskKey)) : _jsx("p", { className: "text-neutral-grey-50 text-xs", children: "No violation details were recorded for this run." }) })] })] });
14
+ }
@@ -1,5 +1,7 @@
1
+ import type { SafetyViolation } from "../safetyViolations";
1
2
  import type { GraderReport } from "../types";
2
- export declare function TaskChecksList({ report }: {
3
+ export declare function TaskChecksList({ report, violations }: {
3
4
  report?: GraderReport;
5
+ violations?: SafetyViolation[];
4
6
  }): import("react").JSX.Element;
5
7
  //# sourceMappingURL=TaskChecksList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TaskChecksList.d.ts","sourceRoot":"","sources":["../../src/components/TaskChecksList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,UAAU,CAAC;AAQxD,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAE,+BAkBnE"}
1
+ {"version":3,"file":"TaskChecksList.d.ts","sourceRoot":"","sources":["../../src/components/TaskChecksList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,UAAU,CAAC;AAgBxD,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,UAAe,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,YAAY,CAAC;IAAC,UAAU,CAAC,EAAE,eAAe,EAAE,CAAA;CAAE,+BAyBpH"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Alert, AlertDescription, Badge } from "@parhelia/core";
3
- import { AlertCircle, CheckCircle2, MinusCircle, XCircle } from "lucide-react";
3
+ import { AlertCircle, CheckCircle2, MinusCircle, ShieldAlert, XCircle } from "lucide-react";
4
+ import { SafetyViolationText } from "./SafetyViolationsStat";
4
5
  const groups = [{ key: "work", label: "Work" }, { key: "preservation", label: "Preservation" }, { key: "efficiency", label: "Efficiency" }, { key: "judge", label: "Judge" }];
5
6
  const points = (value) => Number.isInteger(value) ? String(value) : value.toFixed(1);
6
7
  function CheckIcon({ check }) {
@@ -10,10 +11,19 @@ function CheckIcon({ check }) {
10
11
  return _jsx(CheckCircle2, { "aria-label": "Passed", className: "text-feedback-green mt-0.5 h-4 w-4 shrink-0", strokeWidth: 1.5 });
11
12
  return _jsx(XCircle, { "aria-label": "Failed", className: "text-feedback-red mt-0.5 h-4 w-4 shrink-0", strokeWidth: 1.5 });
12
13
  }
13
- export function TaskChecksList({ report }) {
14
+ /** Grading zeroes correctness for a failed critical check and for any safety violation; name whichever applied. */
15
+ function zeroReason(report, violations) {
16
+ const criticalCheck = report.checks.some(c => c.critical && !c.passed && !c.skipped);
17
+ if (violations && criticalCheck)
18
+ return "A critical check failed and safety violations were recorded.";
19
+ if (violations)
20
+ return violations === 1 ? "A safety violation was recorded." : `${violations} safety violations were recorded.`;
21
+ return "A critical check failed.";
22
+ }
23
+ export function TaskChecksList({ report, violations = [] }) {
14
24
  if (!report)
15
25
  return _jsx("p", { className: "text-neutral-grey-50 text-sm", children: "Grading is not available for this task." });
16
- return _jsxs("div", { className: "space-y-4", children: [report.criticalFailed && _jsxs(Alert, { variant: "destructive", children: [_jsx(AlertCircle, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsx(AlertDescription, { children: "A critical check failed. Correctness is zero." })] }), groups.map(group => {
26
+ return _jsxs("div", { className: "space-y-4", children: [report.criticalFailed && _jsxs(Alert, { variant: "destructive", children: [_jsx(AlertCircle, { className: "h-4 w-4", strokeWidth: 1.5 }), _jsxs(AlertDescription, { children: [zeroReason(report, violations.length), " Correctness is zero."] })] }), violations.length > 0 && _jsxs("section", { "data-testid": "benchmark-task-safety-violations", children: [_jsx("h4", { className: "text-neutral-grey-50 mb-1.5 text-xs font-medium tracking-wide uppercase", children: "Safety violations" }), _jsx("ul", { className: "border-border-default divide-border-default divide-y rounded border", children: violations.map((violation, index) => _jsxs("li", { className: "flex items-start gap-3 px-3 py-2 text-sm", children: [_jsx(ShieldAlert, { "aria-hidden": "true", className: "text-feedback-red mt-0.5 h-4 w-4 shrink-0", strokeWidth: 1.5 }), _jsx("div", { className: "min-w-0 flex-1", children: _jsx(SafetyViolationText, { violation: violation }) })] }, index)) })] }), groups.map(group => {
17
27
  const checks = report.checks.filter(c => c.class === group.key);
18
28
  if (!checks.length)
19
29
  return null;
package/dist/format.d.ts CHANGED
@@ -4,4 +4,5 @@ export declare const count: (value?: number) => string;
4
4
  export declare const duration: (milliseconds?: number) => string;
5
5
  export declare function parseJson<T>(value?: string): T | undefined;
6
6
  export declare function parseGraderReport(value?: string): import("./types").GraderReport | undefined;
7
+ export declare function parseAudit(value?: string): import("./types").TaskAudit | undefined;
7
8
  //# sourceMappingURL=format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAY,MAAM,GAAG,IAAI,WAAiD,CAAC;AAC/F,eAAO,MAAM,IAAI,WAAY,MAAM,GAAG,IAAI,4BAA2J,CAAC;AACtM,eAAO,MAAM,KAAK,4BAAwC,CAAC;AAC3D,eAAO,MAAM,QAAQ,mCAA6K,CAAC;AACnM,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAA2F;AACtJ,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,SAAS,EAAE,YAAY,GAAG,SAAS,CAS5F"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAY,MAAM,GAAG,IAAI,WAAiD,CAAC;AAC/F,eAAO,MAAM,IAAI,WAAY,MAAM,GAAG,IAAI,4BAA2J,CAAC;AACtM,eAAO,MAAM,KAAK,4BAAwC,CAAC;AAC3D,eAAO,MAAM,QAAQ,mCAA6K,CAAC;AACnM,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAA2F;AAItJ,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,SAAS,EAAE,YAAY,GAAG,SAAS,CAO5F;AACD,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,SAAS,EAAE,SAAS,GAAG,SAAS,CAKlF"}
package/dist/format.js CHANGED
@@ -8,15 +8,23 @@ export function parseJson(value) { try {
8
8
  catch {
9
9
  return undefined;
10
10
  } }
11
+ // Stored report and audit JSON use .NET property casing; the surrounding API uses camelCase.
12
+ const camel = (record) => Object.fromEntries(Object.entries(record).map(([key, entry]) => [key.charAt(0).toLowerCase() + key.slice(1), entry]));
13
+ const camelList = (value) => Array.isArray(value) ? value.map(entry => camel(entry)) : [];
11
14
  export function parseGraderReport(value) {
12
15
  const raw = parseJson(value);
13
16
  if (!raw)
14
17
  return undefined;
15
- // Stored report JSON uses .NET property casing; the surrounding API uses camelCase.
16
- const camel = (record) => Object.fromEntries(Object.entries(record).map(([key, entry]) => [key.charAt(0).toLowerCase() + key.slice(1), entry]));
17
18
  const report = camel(raw);
18
19
  if (!Array.isArray(report.checks))
19
20
  return undefined;
20
- report.checks = report.checks.map(check => camel(check));
21
+ report.checks = camelList(report.checks);
21
22
  return report;
22
23
  }
24
+ export function parseAudit(value) {
25
+ const raw = parseJson(value);
26
+ if (!raw || typeof raw !== "object")
27
+ return undefined;
28
+ const audit = camel(raw);
29
+ return { mutations: camelList(audit.mutations), toolCalls: camelList(audit.toolCalls), violations: Array.isArray(audit.violations) ? audit.violations : [] };
30
+ }
@@ -0,0 +1,22 @@
1
+ import type { BenchmarkTaskResult, TaskAudit } from "./types";
2
+ /** One recorded violation, matched back to the denied tool call or mutation in the task audit when possible. */
3
+ export type SafetyViolation = {
4
+ message: string;
5
+ tool?: string;
6
+ target?: string;
7
+ details: string[];
8
+ };
9
+ export type TaskSafetyViolations = {
10
+ task: BenchmarkTaskResult;
11
+ violations: SafetyViolation[];
12
+ };
13
+ /** Drops the per-run copy root so the path starts at the task's own folder. */
14
+ export declare const shortPath: (path: string) => string;
15
+ /**
16
+ * Violations are stored as plain messages: a denied mutation's reason, or "tool: error" for a
17
+ * write the ACLs rejected before any mutation event. Match each one to its audit record, in order,
18
+ * to recover which item, language, version and fields the write targeted.
19
+ */
20
+ export declare function describeViolations(violations: string[], audit?: TaskAudit): SafetyViolation[];
21
+ export declare function taskSafetyViolations(tasks: BenchmarkTaskResult[]): TaskSafetyViolations[];
22
+ //# sourceMappingURL=safetyViolations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safetyViolations.d.ts","sourceRoot":"","sources":["../src/safetyViolations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgC,mBAAmB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE5F,gHAAgH;AAChH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AACrG,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,UAAU,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AAGhG,+EAA+E;AAC/E,eAAO,MAAM,SAAS,SAAU,MAAM,WAAoC,CAAC;AAmB3E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,eAAe,EAAE,CAkB7F;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,oBAAoB,EAAE,CAMzF"}
@@ -0,0 +1,52 @@
1
+ import { parseAudit, parseGraderReport, parseJson } from "./format";
2
+ const runCopyRoot = /^\/sitecore\/(content|media library)\/Parhelia Benchmark Runs\/[0-9a-f]{32}\//i;
3
+ /** Drops the per-run copy root so the path starts at the task's own folder. */
4
+ export const shortPath = (path) => path.replace(runCopyRoot, "…/");
5
+ const normalizeId = (value) => value.trim().replace(/[{}]/g, "").toLowerCase();
6
+ const text = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
7
+ const fieldList = (fields) => fields.length ? [`${fields.length === 1 ? "Field" : "Fields"}: ${fields.join(", ")}`] : [];
8
+ function describeArguments(argumentsJson, paths) {
9
+ const parsed = parseJson(argumentsJson);
10
+ const args = parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
11
+ const id = [args.itemPath, args.path, args.itemId, args.id, args.parentId, args.documentId].map(text).find(Boolean);
12
+ const details = [];
13
+ const language = text(args.language);
14
+ if (language)
15
+ details.push(language);
16
+ if (typeof args.version === "number" && args.version > 0)
17
+ details.push(`version ${args.version}`);
18
+ const fields = Array.isArray(args.fields) ? args.fields.map(field => text(field) ?? (field && typeof field === "object" ? text(field.field) ?? text(field.name) : undefined)) : [];
19
+ details.push(...fieldList(fields.filter((field) => !!field)));
20
+ return { target: id && (paths.get(normalizeId(id)) ?? id), details };
21
+ }
22
+ /**
23
+ * Violations are stored as plain messages: a denied mutation's reason, or "tool: error" for a
24
+ * write the ACLs rejected before any mutation event. Match each one to its audit record, in order,
25
+ * to recover which item, language, version and fields the write targeted.
26
+ */
27
+ export function describeViolations(violations, audit) {
28
+ const mutations = audit?.mutations ?? [], calls = audit?.toolCalls ?? [];
29
+ const paths = new Map(mutations.filter(m => m.itemId && m.itemPath).map(m => [normalizeId(m.itemId), m.itemPath]));
30
+ const used = new Set();
31
+ return violations.map(message => {
32
+ const mutation = mutations.find(m => !m.allowed && !used.has(m) && (m.reason ?? "Scope violation") === message);
33
+ if (mutation) {
34
+ used.add(mutation);
35
+ const details = mutation.destinationPath ? [`to ${shortPath(mutation.destinationPath)}`] : [];
36
+ return { message, tool: mutation.toolName, target: mutation.itemPath, details: [...details, ...fieldList((mutation.changedFields ?? []).filter(f => !f.startsWith("__")))] };
37
+ }
38
+ const call = calls.find(c => c.error && !used.has(c) && `${c.functionName}: ${c.error}` === message);
39
+ if (call) {
40
+ used.add(call);
41
+ return { message: call.error, tool: call.functionName, ...describeArguments(call.argumentsJson, paths) };
42
+ }
43
+ return { message, details: [] };
44
+ });
45
+ }
46
+ export function taskSafetyViolations(tasks) {
47
+ return tasks.flatMap(task => {
48
+ const audit = parseAudit(task.auditJson);
49
+ const messages = parseGraderReport(task.graderReportJson)?.violations ?? audit?.violations ?? [];
50
+ return messages.length ? [{ task, violations: describeViolations(messages, audit) }] : [];
51
+ });
52
+ }
package/dist/types.d.ts CHANGED
@@ -50,6 +50,27 @@ export type GraderReport = {
50
50
  violations?: string[];
51
51
  costIssues?: string[];
52
52
  };
53
+ export type AuditMutation = {
54
+ itemId?: string;
55
+ itemPath?: string;
56
+ destinationPath?: string;
57
+ changedFields?: string[];
58
+ toolCallId?: string;
59
+ toolName?: string;
60
+ allowed: boolean;
61
+ reason?: string;
62
+ };
63
+ export type AuditToolCall = {
64
+ toolCallId?: string;
65
+ functionName: string;
66
+ argumentsJson?: string;
67
+ error?: string;
68
+ };
69
+ export type TaskAudit = {
70
+ mutations: AuditMutation[];
71
+ toolCalls: AuditToolCall[];
72
+ violations: string[];
73
+ };
53
74
  export type BenchmarkTaskResult = {
54
75
  taskResultId: string;
55
76
  taskKey: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,eAAe,CAAC;AACtG,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,CAAC;AAC/E,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAC1F,YAAY,EAAE,MAAM,CAAC;IAAC,sBAAsB,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAC1E,MAAM,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAC5F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAC/E,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAA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