MCPcopy
hub / github.com/rpamis/comet / parseDesignVerdict

Function parseDesignVerdict

scripts/context-execution-benchmark.mjs:374–389  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

372 * Looks for the JSON block at the end of the Design Doc.
373 */
374export function parseDesignVerdict(text) {
375 const match = text.match(/\{[\s\S]*"requirementsCovered"[\s\S]*\}/);
376 if (!match) return null;
377 try {
378 const data = JSON.parse(match[0]);
379 return {
380 requirementsCovered: Number(data.requirementsCovered ?? 0),
381 requirementsTotal: Number(data.requirementsTotal ?? 0),
382 decisionsCount: Number(data.decisionsCount ?? 0),
383 risksIdentified: Number(data.risksIdentified ?? 0),
384 coverageRate: safeRatio(Number(data.requirementsCovered ?? 0), Number(data.requirementsTotal ?? 0)),
385 };
386 } catch {
387 return null;
388 }
389}
390
391async function runL1({ claudeCommand, model, cwd, mode, contextFile, contextText }) {
392 const prompt = buildDesignPrompt(mode, contextFile, contextText);

Callers 3

runL1Function · 0.85
runL3DesignFunction · 0.85

Calls 1

safeRatioFunction · 0.90

Tested by

no test coverage detected