(text)
| 372 | * Looks for the JSON block at the end of the Design Doc. |
| 373 | */ |
| 374 | export 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 | |
| 391 | async function runL1({ claudeCommand, model, cwd, mode, contextFile, contextText }) { |
| 392 | const prompt = buildDesignPrompt(mode, contextFile, contextText); |
no test coverage detected