MCPcopy Create free account
hub / github.com/anomalyco/opencode-bench / createUserPrompt

Function createUserPrompt

src/metrics/checks.ts:93–113  ·  view source on GitHub ↗
(context: Metric.Context)

Source from the content-addressed store, hash-verified

91Return JSON with 'score' (must be exactly 0 or 1) and a detailed rationale explaining your decision.`;
92
93export 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
115function formatExecution(execution: Metric.CommandExecution) {
116 const status = execution.success ? "PASS" : "FAIL";

Callers

nothing calls this directly

Calls 1

formatExecutionFunction · 0.85

Tested by

no test coverage detected