From c442e2d97ef4d4e4c65861400d1bb939759bfa4a Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Wed, 18 Mar 2026 12:54:16 -0400 Subject: [PATCH] fix: treat auto-discovered verification failures as advisory, not blocking (#1188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the verification gate auto-discovers commands from package.json (typecheck, lint, test), failures on pre-existing errors create a doom loop: execute → fail → auto-fix → still fails → retry exhausted → pause. The agent can't fix pre-existing lint/test errors it didn't introduce. Now, when discoverySource is 'package-json', gate failures are logged as warnings and the task proceeds without triggering the retry loop. Explicitly configured checks (via preferences or task plan verify field) still trigger the full retry cycle. This preserves the safety of user-configured verification while preventing auto-discovered checks from blocking on inherited tech debt. Fixes #1186 --- src/resources/extensions/gsd/auto-verification.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/resources/extensions/gsd/auto-verification.ts b/src/resources/extensions/gsd/auto-verification.ts index 08aea1d60..519d94136 100644 --- a/src/resources/extensions/gsd/auto-verification.ts +++ b/src/resources/extensions/gsd/auto-verification.ts @@ -175,6 +175,20 @@ export async function runPostUnitVerification( s.verificationRetryCount.delete(s.currentUnit.id); s.pendingVerificationRetry = null; return "continue"; + } else if (result.discoverySource === "package-json") { + // Auto-discovered checks from package.json may fail on pre-existing errors + // that the current task didn't introduce. Don't trigger the retry loop — + // log a warning and let the task proceed (#1186). + process.stderr.write( + `verification-gate: auto-discovered checks failed (source: package-json) — treating as advisory, not blocking\n`, + ); + ctx.ui.notify( + `Verification: auto-discovered checks failed (pre-existing errors likely). Continuing without retry.`, + "warning", + ); + s.verificationRetryCount.delete(s.currentUnit.id); + s.pendingVerificationRetry = null; + return "continue"; } else if (autoFixEnabled && attempt + 1 <= maxRetries) { const nextAttempt = attempt + 1; s.verificationRetryCount.set(s.currentUnit.id, nextAttempt);