(context: Metric.Context)
| 91 | Return JSON with 'score' (must be exactly 0 or 1) and a detailed rationale explaining your decision.`; |
| 92 | |
| 93 | export function createUserPrompt(context: Metric.Context) { |
| 94 | if (!context.beforeResults) throw new Error("No baseline results provided."); |
| 95 | if (!context.afterResults) |
| 96 | throw new Error("No after-agent results provided."); |
| 97 | if (context.beforeResults.length !== context.afterResults.length) |
| 98 | throw new Error("Number of baseline and after-agent results do not match."); |
| 99 | |
| 100 | const formatted = context.beforeResults |
| 101 | .map((result, index) => { |
| 102 | const before = formatExecution(result); |
| 103 | const after = formatExecution(context.afterResults![index]); |
| 104 | return [ |
| 105 | `Check ${index + 1}: ${result.command}`, |
| 106 | `Baseline: ${before}`, |
| 107 | `After agent: ${after}`, |
| 108 | ].join("\n"); |
| 109 | }) |
| 110 | .join("\n\n"); |
| 111 | |
| 112 | return `Evaluate the following project checks. Each check shows the command, its baseline result before the agent ran, and the result after the agent's changes.\n\n${formatted}\n\nDecide how well the agent preserved or improved the checks.`; |
| 113 | } |
| 114 | |
| 115 | function formatExecution(execution: Metric.CommandExecution) { |
| 116 | const status = execution.success ? "PASS" : "FAIL"; |
nothing calls this directly
no test coverage detected