MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / main

Function main

graph-ui/tools/eval-check.mjs:141–582  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139}
140
141async function main() {
142 const startedAt = Date.now();
143 const { out } = parseArgs(process.argv.slice(2));
144 let serverChild = null;
145 let home = null;
146 let runtimeDir = null;
147 let serverPort = 0;
148 let failure = null;
149 const serverLog = [];
150 const measured = [];
151 const extras = { leftovers: [], perQuestion: [] };
152
153 /*
154 * Die Ports, die dieser Lauf selbst belegt hat, in der Reihenfolge der
155 * Belegung. Nur sie werden am Ende auf Reste geprueft. Sie stehen hier und
156 * nicht als Konstante, weil `findFreePort` sie zur Laufzeit waehlt: welcher
157 * Port es wird, weiss der Lauf erst, wenn er ihn hat.
158 */
159 const ownPorts = [];
160
161 try {
162 if (!existsSync(BINARY)) {
163 throw new Error(`Binary fehlt: ${BINARY} (erst 'make -f Makefile.cbm cbm-with-ui' im cbm-Clone bauen)`);
164 }
165 if (!existsSync(FIXTURE)) {
166 throw new Error(`Fixture fehlt: ${FIXTURE}`);
167 }
168 if (!existsSync(BASELINE)) {
169 throw new Error(`${BASELINE} fehlt: erst 'npm run eval:llm' fahren.`);
170 }
171
172 const baseline = JSON.parse(await readFile(BASELINE, 'utf8'));
173 /*
174 * Wer gefahren wird, steht in der Aufzeichnung und nicht hier.
175 *
176 * Ein hartkodierter Modellname waere die eine Stelle, an der dieser Lauf
177 * gegen ein anderes Modell messen koennte als das, das ausgewaehlt wurde,
178 * und niemand saehe es: die Datei nennt die Zahlen des Siegers, der Lauf
179 * fuehre einen anderen, und die Toleranz verdeckte den Rest.
180 */
181 const winners = [
182 { modelClass: 'A', recorded: baseline.winnerClassA },
183 { modelClass: 'B', recorded: baseline.winnerClassB },
184 ];
185 for (const entry of winners) {
186 if (entry.recorded === undefined || entry.recorded === null) {
187 throw new Error(`eval.json nennt keinen Sieger der Klasse ${entry.modelClass}`);
188 }
189 if (!existsSync(join(ROOT, 'models', entry.recorded.file))) {
190 throw new Error(`Modell fehlt: models/${entry.recorded.file}`);
191 }
192 }
193 extras.baseline = {
194 generatedAt: baseline.generatedAt ?? '',
195 temperature: baseline.temperature,
196 seed: baseline.seed,
197 questionCount: baseline.questionCount,
198 };

Callers 1

eval-check.mjsFile · 0.70

Calls 15

indexRepositoryFunction · 0.90
findFreePortFunction · 0.90
startServerFunction · 0.90
loadCompilerFunction · 0.90
startLlamaFunction · 0.90
llamaPropsFunction · 0.90
stopLlamaFunction · 0.90
sleepFunction · 0.90
citationComplianceOfFunction · 0.90
stopServerFunction · 0.90
countListenersFunction · 0.90
violationsOfFunction · 0.90

Tested by

no test coverage detected