From 39d8688245a701f11958c6069a03fbe6cb10025d Mon Sep 17 00:00:00 2001 From: odmrs Date: Sat, 28 Mar 2026 11:50:41 -0300 Subject: [PATCH] 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. --- sdk/src/phase-runner.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/src/phase-runner.ts b/sdk/src/phase-runner.ts index 37dc9051b..361e4efd5 100644 --- a/sdk/src/phase-runner.ts +++ b/sdk/src/phase-runner.ts @@ -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;