fix(verifier): use ROADMAP Success Criteria instead of deriving truths from Goal (#538)
The verifier was deriving verification truths from the vague one-line Goal field, allowing partial implementations to pass. Now extracts Success Criteria as a structured array from `roadmap get-phase` and uses them directly as truths, with Goal derivation as fallback for older ROADMAPs without Success Criteria. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -882,12 +882,19 @@ function cmdRoadmapGetPhase(cwd, phaseNum, raw) {
|
||||
const goalMatch = section.match(/\*\*Goal:\*\*\s*([^\n]+)/i);
|
||||
const goal = goalMatch ? goalMatch[1].trim() : null;
|
||||
|
||||
// Extract success criteria as structured array
|
||||
const criteriaMatch = section.match(/\*\*Success Criteria\*\*[^\n]*:\s*\n((?:\s*\d+\.\s*[^\n]+\n?)+)/i);
|
||||
const success_criteria = criteriaMatch
|
||||
? criteriaMatch[1].trim().split('\n').map(line => line.replace(/^\s*\d+\.\s*/, '').trim()).filter(Boolean)
|
||||
: [];
|
||||
|
||||
output(
|
||||
{
|
||||
found: true,
|
||||
phase_number: phaseNum,
|
||||
phase_name: phaseName,
|
||||
goal,
|
||||
success_criteria,
|
||||
section,
|
||||
},
|
||||
raw,
|
||||
|
||||
Reference in New Issue
Block a user