MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / summarizeEvaluation

Function summarizeEvaluation

src/eval/harness.ts:142–164  ·  view source on GitHub ↗
(results: EvalResult[], gate: EvalGate = 0.7)

Source from the content-addressed store, hash-verified

140}
141
142export function summarizeEvaluation(results: EvalResult[], gate: EvalGate = 0.7): EvalSummary {
143 const total = results.length;
144 const top1Correct = results.filter((result) => result.top1Correct).length;
145 const top3RecallCount = results.filter((result) => result.top3Recall).length;
146 const specContaminatedCount = results.filter((result) => result.specContaminated).length;
147 const avgTopScore =
148 total > 0 ? results.reduce((sum, result) => sum + result.score, 0) / total : 0;
149 const gateThreshold = resolveGateThreshold(total, gate);
150
151 return {
152 total,
153 top1Correct,
154 top1Accuracy: total > 0 ? top1Correct / total : 0,
155 top3RecallCount,
156 top3Recall: total > 0 ? top3RecallCount / total : 0,
157 specContaminatedCount,
158 specContaminationRate: total > 0 ? specContaminatedCount / total : 0,
159 avgTopScore,
160 gateThreshold,
161 passesGate: total > 0 && top1Correct >= gateThreshold,
162 results
163 };
164}
165
166export function formatEvalReport({
167 codebaseLabel,

Callers 2

evaluateFixtureFunction · 0.85

Calls 1

resolveGateThresholdFunction · 0.85

Tested by

no test coverage detected