Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,9 @@ export function TaskInstanceViewer({
id: string;
score: number;
result: boolean;
message: string;
message?: string;
description?: string;
weight?: number;
title?: string;
justification?: string;
}[];
Expand Down Expand Up @@ -1084,6 +1086,9 @@ export function TaskInstanceViewer({
>
Score: {(v.score * 100).toFixed(0)}%
</span>
<code className="text-[10px] font-mono text-[var(--muted-foreground)]">
{verifierId}
</code>
</div>

{results.map((r, i) => (
Expand All @@ -1107,6 +1112,14 @@ export function TaskInstanceViewer({
<span className="text-sm font-semibold">
{(r.id ?? `check ${i + 1}`).replace(/_/g, ' ')}
</span>
{typeof r.weight === 'number' && r.weight < 0 && (
<span
className="text-[10px] font-semibold uppercase px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600"
title={`Penalty check (weight −${Math.abs(r.weight)}): weighted_average subtracts (1 − score) × ${Math.abs(r.weight)} from the weighted sum, ${Number(penaltySubtracted(r.score, r.result, r.weight).toFixed(2))} here`}
>
penalty −{Math.abs(r.weight)}
</span>
)}
{typeof r.score === 'number' && r.score !== 0 && r.score !== 1 && (
<span className="text-xs text-[var(--muted-foreground)]">
score:{' '}
Expand All @@ -1116,9 +1129,9 @@ export function TaskInstanceViewer({
</span>
)}
</div>
{r.message ? (
{(r.message ?? r.description) ? (
<p className="text-xs text-[var(--muted-foreground)] whitespace-pre-wrap">
{r.message}
{r.message ?? r.description}
</p>
) : null}
</div>
Expand Down Expand Up @@ -1387,6 +1400,12 @@ function AggregateScoreCard({
);
}

/** What weighted_average subtracts for a penalty check, as scoring.py computes it: (1 − score) × |weight|, the score
* the check's own or else 1 when it passed and 0 when it didn't. */
function penaltySubtracted(score: number | undefined, result: boolean, weight: number): number {
return (1 - (typeof score === 'number' ? score : result ? 1 : 0)) * Math.abs(weight);
}

/** Sandbox-side verifier outcomes from a `verify_sandbox` step. Per-criterion rows show the criterion
* `type` (probe_file_exists, bash_cmd_succeeds, …) and its `paths`/`cmd`. */
// Sandbox verifier — justification-string parsers. Each probe type emits its own `justification` format:
Expand Down
Loading