diff --git a/src/resources/extensions/gsd/auto-recovery.ts b/src/resources/extensions/gsd/auto-recovery.ts index 5720d1b1f..715f9db79 100644 --- a/src/resources/extensions/gsd/auto-recovery.ts +++ b/src/resources/extensions/gsd/auto-recovery.ts @@ -112,8 +112,9 @@ function detectMainBranch(basePath: string): string { encoding: "utf-8", }); if (result.trim()) return "main"; - } catch { + } catch (_) { // Expected — main doesn't exist, try master next + void _; } try { const result = execFileSync("git", ["rev-parse", "--verify", "master"], { @@ -122,8 +123,9 @@ function detectMainBranch(basePath: string): string { encoding: "utf-8", }); if (result.trim()) return "master"; - } catch { + } catch (_) { // Expected — master doesn't exist either + void _; } // Neither main nor master found — warn and fall back logWarning("recovery", "neither main nor master branch found, defaulting to main"); diff --git a/src/resources/extensions/gsd/tests/workflow-logger.test.ts b/src/resources/extensions/gsd/tests/workflow-logger.test.ts index 69fd2dcd4..84c5d935f 100644 --- a/src/resources/extensions/gsd/tests/workflow-logger.test.ts +++ b/src/resources/extensions/gsd/tests/workflow-logger.test.ts @@ -240,13 +240,13 @@ describe("workflow-logger", () => { test("writes entry to .gsd/audit-log.jsonl after setLogBasePath", () => { setLogBasePath(dir); - logWarning("engine", "audit test entry"); + logError("engine", "audit test entry"); const auditPath = join(dir, ".gsd", "audit-log.jsonl"); assert.ok(existsSync(auditPath), "audit-log.jsonl should exist"); const content = readFileSync(auditPath, "utf-8"); const entry = JSON.parse(content.trim()); - assert.equal(entry.severity, "warn"); + assert.equal(entry.severity, "error"); assert.equal(entry.component, "engine"); assert.equal(entry.message, "audit test entry"); }); @@ -254,7 +254,7 @@ describe("workflow-logger", () => { test("_resetLogs does not clear the audit base path", () => { setLogBasePath(dir); _resetLogs(); - logWarning("engine", "post-reset entry"); + logError("engine", "post-reset entry"); const auditPath = join(dir, ".gsd", "audit-log.jsonl"); assert.ok(existsSync(auditPath), "audit-log.jsonl should exist after _resetLogs"); @@ -293,13 +293,13 @@ describe("workflow-logger", () => { test("writes entry to .gsd/audit-log.jsonl after setLogBasePath", () => { setLogBasePath(dir); - logWarning("engine", "audit test entry"); + logError("engine", "audit test entry"); const auditPath = join(dir, ".gsd", "audit-log.jsonl"); assert.ok(existsSync(auditPath), "audit-log.jsonl should exist"); const content = readFileSync(auditPath, "utf-8"); const entry = JSON.parse(content.trim()); - assert.equal(entry.severity, "warn"); + assert.equal(entry.severity, "error"); assert.equal(entry.component, "engine"); assert.equal(entry.message, "audit test entry"); }); @@ -307,7 +307,7 @@ describe("workflow-logger", () => { test("_resetLogs does not clear the audit base path", () => { setLogBasePath(dir); _resetLogs(); - logWarning("engine", "post-reset entry"); + logError("engine", "post-reset entry"); const auditPath = join(dir, ".gsd", "audit-log.jsonl"); assert.ok(existsSync(auditPath), "audit-log.jsonl should exist after _resetLogs");