| 36 | const analyzerModelId = "opencode/claude-sonnet-4-5"; |
| 37 | |
| 38 | function buildDynamicContext(runs: EvaluationRunExport[]): string { |
| 39 | const repo = runs[0].evaluation.repo; |
| 40 | const parts: string[] = []; |
| 41 | |
| 42 | parts.push(`# Evaluation |
| 43 | - Repository: ${repo} |
| 44 | - Total runs: ${runs.length} |
| 45 | `); |
| 46 | |
| 47 | parts.push("# Run Scoreboard"); |
| 48 | runs.forEach((run, index) => { |
| 49 | parts.push( |
| 50 | `${index + 1}. ${run.agent} (${ |
| 51 | run.model |
| 52 | }) — final ${run.finalScore.toFixed(3)}, base ${run.baseScore.toFixed( |
| 53 | 3, |
| 54 | )}, penalty ${run.variancePenalty.toFixed(3)}`, |
| 55 | ); |
| 56 | if (run.summary?.trim()) { |
| 57 | parts.push(` Summary: ${run.summary.trim()}`); |
| 58 | } |
| 59 | }); |
| 60 | parts.push(""); |
| 61 | |
| 62 | return parts.join("\n"); |
| 63 | } |
| 64 | |
| 65 | function formatFallbackSummary(runs: EvaluationRunExport[]): string { |
| 66 | const repo = runs[0].evaluation.repo; |