Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion packages/evals/src/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { runJudge, type JudgeOptions } from './judge.js';
import { runEvalSkill, type RunEvalOptions } from './runner.js';
import { evalPassed, type EvalMeta, type JudgeResponse } from './types.js';
import { usageToSummary } from './usage.js';
import { FindingSchema, type Finding, type SkillReport, type UsageStats } from '@sentry/warden';
import { FindingSchema, HunkFailureSchema, type Finding, type SkillReport, type UsageStats } from '@sentry/warden';

export const WardenEvalOutputSchema = z.object({
name: z.string(),
Expand All @@ -23,6 +23,7 @@ export const WardenEvalOutputSchema = z.object({
findings: z.array(FindingSchema),
failedHunks: z.number().int().nonnegative().optional(),
failedExtractions: z.number().int().nonnegative().optional(),
hunkFailures: z.array(HunkFailureSchema).optional(),
Comment thread
sentry-junior[bot] marked this conversation as resolved.
Resolved
});
export type WardenEvalOutput = z.infer<typeof WardenEvalOutputSchema>;

Expand All @@ -48,6 +49,7 @@ function reportToOutput(name: string, report: SkillReport): WardenEvalOutput {
findings: report.findings,
failedHunks: report.failedHunks,
failedExtractions: report.failedExtractions,
hunkFailures: report.hunkFailures,
};
}

Expand Down
3 changes: 2 additions & 1 deletion packages/evals/src/security-corpus.eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ describeEval(
// A failed run is an error, never a miss.
const output = WardenEvalOutputSchema.parse(result.output);
if (result.errors.length > 0 || output.failedHunks) {
throw new Error(`Warden did not finish: ${JSON.stringify(result.errors)} (${output.failedHunks ?? 0} failed hunks)`);
const hunks = (output.hunkFailures ?? []).map((f) => `${f.code}: ${f.message}`);
throw new Error(`Warden did not finish: ${JSON.stringify([...result.errors, ...hunks])}`);
}
});
}
Expand Down
Loading