MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / runSingleEvaluation

Function runSingleEvaluation

scripts/run-eval.mjs:106–179  ·  view source on GitHub ↗
({
  label,
  codebasePath,
  fixturePath,
  mode,
  skipReindex,
  noRerank,
  redactPaths
})

Source from the content-addressed store, hash-verified

104}
105
106async function runSingleEvaluation({
107 label,
108 codebasePath,
109 fixturePath,
110 mode,
111 skipReindex,
112 noRerank,
113 redactPaths
114}) {
115 const resolvedCodebase = path.resolve(codebasePath);
116 const resolvedFixture = path.resolve(fixturePath);
117 const fixture = loadFixture(resolvedFixture);
118
119 console.log(`\n=== Codebase: ${label} ===`);
120 console.log(`Target: ${resolvedCodebase}`);
121 console.log(`Fixture: ${resolvedFixture}`);
122 console.log(`Mode: ${mode}`);
123 if (mode === 'retrieval') {
124 console.log(
125 `Reranker: ${noRerank ? 'DISABLED' : 'enabled (ambiguity-triggered, Xenova/ms-marco-MiniLM-L-6-v2)'}`
126 );
127 }
128 console.log(`Path output: ${redactPaths ? 'REDACTED' : 'FULL'}`);
129
130 await maybeReindex(resolvedCodebase, skipReindex);
131
132 let summary;
133 let report;
134
135 if (mode === 'discovery') {
136 console.log(`\n--- Phase 2: Running ${fixture.tasks.length}-task discovery harness ---`);
137 summary = await evaluateDiscoveryFixture({
138 fixture,
139 rootPath: resolvedCodebase
140 });
141 report = formatDiscoveryReport({
142 codebaseLabel: label,
143 fixturePath: resolvedFixture,
144 summary
145 });
146 } else if (mode === 'edit-preflight') {
147 console.log(`\n--- Phase 2: Running ${fixture.tasks.length}-task edit-preflight harness ---`);
148 summary = await evaluateEditPreflightFixture({
149 fixture,
150 rootPath: resolvedCodebase
151 });
152 report = formatEditPreflightReport({
153 codebaseLabel: label,
154 fixturePath: resolvedFixture,
155 summary
156 });
157 } else {
158 console.log(`\n--- Phase 2: Running ${fixture.queries.length}-query eval harness ---`);
159 const searcher = new CodebaseSearcher(resolvedCodebase);
160 summary = await evaluateFixture({
161 fixture,
162 searcher,
163 limit: 5,

Callers 1

mainFunction · 0.85

Calls 8

loadFixtureFunction · 0.85
maybeReindexFunction · 0.85
evaluateDiscoveryFixtureFunction · 0.85
formatDiscoveryReportFunction · 0.85
evaluateFixtureFunction · 0.85
formatEvalReportFunction · 0.85

Tested by

no test coverage detected