From f4c6dc67b772b26d447d44f82db024685ec1899b Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Wed, 25 Mar 2026 22:41:49 -0600 Subject: [PATCH] refine: remove unused basePath/unitId from verification gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove basePath and unitId from RunVerificationGateOptions — they were defined in the interface and passed by callers but never read by runVerificationGate(). This eliminates false coupling where callers compute values that have zero effect. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../extensions/gsd/auto-verification.ts | 2 -- .../gsd/tests/verification-gate.test.ts | 16 ---------------- .../extensions/gsd/verification-gate.ts | 2 -- 3 files changed, 20 deletions(-) diff --git a/src/resources/extensions/gsd/auto-verification.ts b/src/resources/extensions/gsd/auto-verification.ts index 8a0c6ca55..2637bfdb3 100644 --- a/src/resources/extensions/gsd/auto-verification.ts +++ b/src/resources/extensions/gsd/auto-verification.ts @@ -71,8 +71,6 @@ export async function runPostUnitVerification( } const result = runVerificationGate({ - basePath: s.basePath, - unitId: s.currentUnit.id, cwd: s.basePath, preferenceCommands: prefs?.verification_commands, taskPlanVerify, diff --git a/src/resources/extensions/gsd/tests/verification-gate.test.ts b/src/resources/extensions/gsd/tests/verification-gate.test.ts index c87f07a6b..b15d539ad 100644 --- a/src/resources/extensions/gsd/tests/verification-gate.test.ts +++ b/src/resources/extensions/gsd/tests/verification-gate.test.ts @@ -226,8 +226,6 @@ describe("verification-gate: execution", () => { test("all commands pass → gate passes", () => { const result = runVerificationGate({ - basePath: tmp, - unitId: "T01", cwd: tmp, preferenceCommands: ["echo hello", "echo world"], }); @@ -243,8 +241,6 @@ describe("verification-gate: execution", () => { test("one command fails → gate fails with exit code + stderr", () => { const result = runVerificationGate({ - basePath: tmp, - unitId: "T01", cwd: tmp, preferenceCommands: ["echo ok", "sh -c 'echo err >&2; exit 1'"], }); @@ -257,8 +253,6 @@ describe("verification-gate: execution", () => { test("no commands discovered → gate passes with 0 checks", () => { const result = runVerificationGate({ - basePath: tmp, - unitId: "T01", cwd: tmp, }); assert.equal(result.passed, true); @@ -268,8 +262,6 @@ describe("verification-gate: execution", () => { test("command not found → exit code 127", () => { const result = runVerificationGate({ - basePath: tmp, - unitId: "T01", cwd: tmp, preferenceCommands: ["__nonexistent_command_xyz_42__"], }); @@ -289,8 +281,6 @@ describe("verification-gate: execution", () => { const script = [ `import { runVerificationGate } from ${JSON.stringify(pathToFileURL(gatePath).href)};`, `runVerificationGate({`, - ` basePath: ${JSON.stringify(tmp)},`, - ` unitId: "T-DEP",`, ` cwd: ${JSON.stringify(tmp)},`, ` preferenceCommands: ["echo dep0190-check"],`, `});`, @@ -317,8 +307,6 @@ describe("verification-gate: execution", () => { test("each check has durationMs", () => { const result = runVerificationGate({ - basePath: tmp, - unitId: "T01", cwd: tmp, preferenceCommands: ["echo fast"], }); @@ -330,8 +318,6 @@ describe("verification-gate: execution", () => { test("one command fails — remaining commands still run (non-short-circuit)", () => { // First fails, second and third should still execute const result = runVerificationGate({ - basePath: tmp, - unitId: "T02", cwd: tmp, preferenceCommands: [ "sh -c 'exit 1'", @@ -351,8 +337,6 @@ describe("verification-gate: execution", () => { test("gate execution uses cwd for spawnSync", () => { // pwd should report the temp dir const result = runVerificationGate({ - basePath: tmp, - unitId: "T02", cwd: tmp, preferenceCommands: ["pwd"], }); diff --git a/src/resources/extensions/gsd/verification-gate.ts b/src/resources/extensions/gsd/verification-gate.ts index c744aee11..91f504df4 100644 --- a/src/resources/extensions/gsd/verification-gate.ts +++ b/src/resources/extensions/gsd/verification-gate.ts @@ -220,8 +220,6 @@ function sanitizeCommand(cmd: string): string | null { } export interface RunVerificationGateOptions { - basePath: string; - unitId: string; cwd: string; preferenceCommands?: string[]; taskPlanVerify?: string;