guardvibe 2.9.7 → 2.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/cli/scan.js +20 -16
  2. package/package.json +1 -1
package/build/cli/scan.js CHANGED
@@ -34,7 +34,7 @@ export async function runScan() {
34
34
  else {
35
35
  console.log(result);
36
36
  }
37
- if (format !== "sarif") {
37
+ if (format !== "sarif" && flags["fail-on"]) {
38
38
  const failOn = getStringFlag(flags, "fail-on") ?? "critical";
39
39
  if (shouldFail(result, failOn))
40
40
  process.exit(1);
@@ -67,7 +67,7 @@ export async function runDirectoryScan(targetPath, flags) {
67
67
  : join(scanPath, ".guardvibe-baseline.json");
68
68
  safeWriteOutput(baselineFile, result);
69
69
  }
70
- if (format !== "sarif") {
70
+ if (format !== "sarif" && flags["fail-on"]) {
71
71
  const failOn = getStringFlag(flags, "fail-on") ?? "critical";
72
72
  if (shouldFail(result, failOn))
73
73
  process.exit(1);
@@ -150,17 +150,19 @@ export async function runDiffScan(base, flags) {
150
150
  else {
151
151
  console.log(result);
152
152
  }
153
- const failOn = getStringFlag(flags, "fail-on") ?? "critical";
154
- if (failOn !== "none") {
155
- const failLevels = {
156
- low: ["critical", "high", "medium", "low"],
157
- medium: ["critical", "high", "medium"],
158
- high: ["critical", "high"],
159
- critical: ["critical"],
160
- };
161
- const levels = failLevels[failOn] || failLevels.critical;
162
- if (allFindings.some(f => levels.includes(f.severity)))
163
- process.exit(1);
153
+ if (flags["fail-on"]) {
154
+ const failOn = getStringFlag(flags, "fail-on") ?? "critical";
155
+ if (failOn !== "none") {
156
+ const failLevels = {
157
+ low: ["critical", "high", "medium", "low"],
158
+ medium: ["critical", "high", "medium"],
159
+ high: ["critical", "high"],
160
+ critical: ["critical"],
161
+ };
162
+ const levels = failLevels[failOn] || failLevels.critical;
163
+ if (allFindings.some(f => levels.includes(f.severity)))
164
+ process.exit(1);
165
+ }
164
166
  }
165
167
  }
166
168
  export async function runFileCheck(filePath, flags) {
@@ -196,9 +198,11 @@ export async function runFileCheck(filePath, flags) {
196
198
  else {
197
199
  console.log(result);
198
200
  }
199
- const failOn = getStringFlag(flags, "fail-on") ?? "critical";
200
- if (shouldFail(result, failOn))
201
- process.exit(1);
201
+ if (flags["fail-on"]) {
202
+ const failOn = getStringFlag(flags, "fail-on") ?? "critical";
203
+ if (shouldFail(result, failOn))
204
+ process.exit(1);
205
+ }
202
206
  }
203
207
  export async function handleScanCommand(args) {
204
208
  const { flags, positional } = parseArgs(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guardvibe",
3
- "version": "2.9.7",
3
+ "version": "2.9.8",
4
4
  "mcpName": "io.github.goklab/guardvibe",
5
5
  "description": "Security MCP for vibe coding. 334 rules, 31 tools, CLI + doctor. Host security: CVE-2025-59536 hook injection, CVE-2026-21852 base URL hijack, MCP config audit, AI host hardening. Plus Next.js, Supabase, Clerk, Stripe, Prisma, tRPC, Hono, GraphQL, Convex, Turso, Uploadthing, AI SDK, and the full AI-generated stack.",
6
6
  "type": "module",