fix(sdk): skip advance step when verification finds gaps

Previously, the advance step ran unconditionally after verify,
marking phases as complete in ROADMAP.md even when gaps_found.
This caused subsequent auto runs to skip unfinished phases.

Now checks if all verify steps passed before advancing. When
verification fails, the phase remains incomplete so the next
auto run re-attempts it.
This commit is contained in:
odmrs
2026-03-28 11:50:41 -03:00
parent 1421dc07bc
commit 39d8688245

View File

@@ -250,9 +250,13 @@ export class PhaseRunner {
}
// ── Step 6: Advance ──
if (!halted) {
// Only advance if verify passed — never mark a phase complete when gaps were found.
const verifyPassed = steps.every(s => s.step !== PhaseStepType.Verify || s.success);
if (!halted && verifyPassed) {
const advanceResult = await this.runAdvanceStep(phaseNumber, sessionOpts, callbacks);
steps.push(advanceResult);
} else if (!halted && !verifyPassed) {
this.logger?.warn(`Skipping advance for phase ${phaseNumber}: verification found gaps`);
}
const totalDurationMs = Date.now() - startTime;