(runs: EvaluationRunExport[])
| 63 | } |
| 64 | |
| 65 | function formatFallbackSummary(runs: EvaluationRunExport[]): string { |
| 66 | const repo = runs[0].evaluation.repo; |
| 67 | const lines: string[] = []; |
| 68 | |
| 69 | lines.push(`Evaluation: ${repo}`); |
| 70 | lines.push(""); |
| 71 | lines.push("Runs (best to worst):"); |
| 72 | |
| 73 | runs.forEach((run, index) => { |
| 74 | lines.push( |
| 75 | `${index + 1}. ${run.agent} (${ |
| 76 | run.model |
| 77 | }) – final ${run.finalScore.toFixed(3)}, base ${run.baseScore.toFixed( |
| 78 | 3, |
| 79 | )}, penalty ${run.variancePenalty.toFixed(3)}`, |
| 80 | ); |
| 81 | |
| 82 | if (run.summary?.trim()) { |
| 83 | lines.push(` summary: ${run.summary.replace(/\s+/g, " ").trim()}`); |
| 84 | } |
| 85 | }); |
| 86 | |
| 87 | if (runs.length > 1) { |
| 88 | const leader = runs[0]; |
| 89 | const trailer = runs[runs.length - 1]; |
| 90 | const gap = leader.finalScore - trailer.finalScore; |
| 91 | lines.push(""); |
| 92 | lines.push(`Score gap (top vs bottom): ${gap.toFixed(3)}`); |
| 93 | } |
| 94 | |
| 95 | return lines.join("\n").trimEnd(); |
| 96 | } |
| 97 | |
| 98 | async function generateAnalysis(runs: EvaluationRunExport[]): Promise<string> { |
| 99 | const context = buildDynamicContext(runs); |
nothing calls this directly
no outgoing calls
no test coverage detected