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

Function formatDiscoveryReport

src/eval/discovery-harness.ts:481–521  ·  view source on GitHub ↗
({
  codebaseLabel,
  fixturePath,
  summary
}: FormatDiscoveryReportParams)

Source from the content-addressed store, hash-verified

479}
480
481export function formatDiscoveryReport({
482 codebaseLabel,
483 fixturePath,
484 summary
485}: FormatDiscoveryReportParams): string {
486 const lines: string[] = [];
487 lines.push(`\n=== Discovery Eval Report: ${codebaseLabel} ===`);
488 lines.push(`Fixture: ${fixturePath}`);
489 lines.push(`Tasks: ${summary.totalTasks}`);
490 lines.push(`Average usefulness: ${(summary.averageUsefulness * 100).toFixed(0)}%`);
491 lines.push(`Average payload: ${Math.round(summary.averagePayloadBytes)} bytes`);
492 lines.push(`Average estimated tokens: ${Math.round(summary.averageEstimatedTokens)}`);
493 lines.push(
494 `Average first relevant hit: ${
495 summary.averageFirstRelevantHit === null ? 'n/a' : summary.averageFirstRelevantHit.toFixed(2)
496 }`
497 );
498 lines.push(
499 `Best-example usefulness: ${
500 summary.bestExampleUsefulnessRate === null
501 ? 'n/a'
502 : `${(summary.bestExampleUsefulnessRate * 100).toFixed(0)}%`
503 }`
504 );
505 if (summary.gate) {
506 lines.push(`Gate: ${summary.gate.status.toUpperCase()}`);
507 lines.push(`Claim allowed: ${summary.gate.claimAllowed ? 'yes' : 'no'}`);
508 if (summary.gate.missingEvidence.length > 0) {
509 lines.push(`Missing evidence: ${summary.gate.missingEvidence.join('; ')}`);
510 }
511 }
512 lines.push('');
513 lines.push('Task results:');
514 for (const result of summary.results) {
515 lines.push(
516 `- ${result.taskId} [${result.job}/${result.surface}] usefulness ${(result.usefulnessScore * 100).toFixed(0)}%, payload ${result.payloadBytes}B/${result.estimatedTokens} tok`
517 );
518 }
519 lines.push('================================');
520 return lines.join('\n');
521}

Callers 3

runSingleEvaluationFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected