@codacy/verity-cli 0.34.0-experimental.d4649a0 → 0.34.0-experimental.e086ee3

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/bin/verity.js +291 -110
  2. package/package.json +1 -1
package/bin/verity.js CHANGED
@@ -6975,10 +6975,10 @@ var require_resolve_block_map = __commonJS2({
6975
6975
  let offset = bm.offset;
6976
6976
  let commentEnd = null;
6977
6977
  for (const collItem of bm.items) {
6978
- const { start: start2, key, sep: sep5, value } = collItem;
6978
+ const { start: start2, key, sep: sep6, value } = collItem;
6979
6979
  const keyProps = resolveProps.resolveProps(start2, {
6980
6980
  indicator: "explicit-key-ind",
6981
- next: key ?? sep5?.[0],
6981
+ next: key ?? sep6?.[0],
6982
6982
  offset,
6983
6983
  onError,
6984
6984
  parentIndent: bm.indent,
@@ -6992,7 +6992,7 @@ var require_resolve_block_map = __commonJS2({
6992
6992
  else if ("indent" in key && key.indent !== bm.indent)
6993
6993
  onError(offset, "BAD_INDENT", startColMsg);
6994
6994
  }
6995
- if (!keyProps.anchor && !keyProps.tag && !sep5) {
6995
+ if (!keyProps.anchor && !keyProps.tag && !sep6) {
6996
6996
  commentEnd = keyProps.end;
6997
6997
  if (keyProps.comment) {
6998
6998
  if (map.comment)
@@ -7016,7 +7016,7 @@ var require_resolve_block_map = __commonJS2({
7016
7016
  ctx.atKey = false;
7017
7017
  if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
7018
7018
  onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
7019
- const valueProps = resolveProps.resolveProps(sep5 ?? [], {
7019
+ const valueProps = resolveProps.resolveProps(sep6 ?? [], {
7020
7020
  indicator: "map-value-ind",
7021
7021
  next: value,
7022
7022
  offset: keyNode.range[2],
@@ -7032,7 +7032,7 @@ var require_resolve_block_map = __commonJS2({
7032
7032
  if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
7033
7033
  onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
7034
7034
  }
7035
- const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep5, null, valueProps, onError);
7035
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep6, null, valueProps, onError);
7036
7036
  if (ctx.schema.compat)
7037
7037
  utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
7038
7038
  offset = valueNode.range[2];
@@ -7123,7 +7123,7 @@ var require_resolve_end = __commonJS2({
7123
7123
  let comment = "";
7124
7124
  if (end) {
7125
7125
  let hasSpace = false;
7126
- let sep5 = "";
7126
+ let sep6 = "";
7127
7127
  for (const token of end) {
7128
7128
  const { source: source2, type } = token;
7129
7129
  switch (type) {
@@ -7137,13 +7137,13 @@ var require_resolve_end = __commonJS2({
7137
7137
  if (!comment)
7138
7138
  comment = cb;
7139
7139
  else
7140
- comment += sep5 + cb;
7141
- sep5 = "";
7140
+ comment += sep6 + cb;
7141
+ sep6 = "";
7142
7142
  break;
7143
7143
  }
7144
7144
  case "newline":
7145
7145
  if (comment)
7146
- sep5 += source2;
7146
+ sep6 += source2;
7147
7147
  hasSpace = true;
7148
7148
  break;
7149
7149
  default:
@@ -7186,18 +7186,18 @@ var require_resolve_flow_collection = __commonJS2({
7186
7186
  let offset = fc.offset + fc.start.source.length;
7187
7187
  for (let i2 = 0; i2 < fc.items.length; ++i2) {
7188
7188
  const collItem = fc.items[i2];
7189
- const { start: start2, key, sep: sep5, value } = collItem;
7189
+ const { start: start2, key, sep: sep6, value } = collItem;
7190
7190
  const props = resolveProps.resolveProps(start2, {
7191
7191
  flow: fcName,
7192
7192
  indicator: "explicit-key-ind",
7193
- next: key ?? sep5?.[0],
7193
+ next: key ?? sep6?.[0],
7194
7194
  offset,
7195
7195
  onError,
7196
7196
  parentIndent: fc.indent,
7197
7197
  startOnNewline: false
7198
7198
  });
7199
7199
  if (!props.found) {
7200
- if (!props.anchor && !props.tag && !sep5 && !value) {
7200
+ if (!props.anchor && !props.tag && !sep6 && !value) {
7201
7201
  if (i2 === 0 && props.comma)
7202
7202
  onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
7203
7203
  else if (i2 < fc.items.length - 1)
@@ -7251,8 +7251,8 @@ var require_resolve_flow_collection = __commonJS2({
7251
7251
  }
7252
7252
  }
7253
7253
  }
7254
- if (!isMap && !sep5 && !props.found) {
7255
- const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep5, null, props, onError);
7254
+ if (!isMap && !sep6 && !props.found) {
7255
+ const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep6, null, props, onError);
7256
7256
  coll.items.push(valueNode);
7257
7257
  offset = valueNode.range[2];
7258
7258
  if (isBlock(value))
@@ -7264,7 +7264,7 @@ var require_resolve_flow_collection = __commonJS2({
7264
7264
  if (isBlock(key))
7265
7265
  onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
7266
7266
  ctx.atKey = false;
7267
- const valueProps = resolveProps.resolveProps(sep5 ?? [], {
7267
+ const valueProps = resolveProps.resolveProps(sep6 ?? [], {
7268
7268
  flow: fcName,
7269
7269
  indicator: "map-value-ind",
7270
7270
  next: value,
@@ -7275,8 +7275,8 @@ var require_resolve_flow_collection = __commonJS2({
7275
7275
  });
7276
7276
  if (valueProps.found) {
7277
7277
  if (!isMap && !props.found && ctx.options.strict) {
7278
- if (sep5)
7279
- for (const st of sep5) {
7278
+ if (sep6)
7279
+ for (const st of sep6) {
7280
7280
  if (st === valueProps.found)
7281
7281
  break;
7282
7282
  if (st.type === "newline") {
@@ -7293,7 +7293,7 @@ var require_resolve_flow_collection = __commonJS2({
7293
7293
  else
7294
7294
  onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
7295
7295
  }
7296
- const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep5, null, valueProps, onError) : null;
7296
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep6, null, valueProps, onError) : null;
7297
7297
  if (valueNode) {
7298
7298
  if (isBlock(value))
7299
7299
  onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
@@ -7473,7 +7473,7 @@ var require_resolve_block_scalar = __commonJS2({
7473
7473
  chompStart = i2 + 1;
7474
7474
  }
7475
7475
  let value = "";
7476
- let sep5 = "";
7476
+ let sep6 = "";
7477
7477
  let prevMoreIndented = false;
7478
7478
  for (let i2 = 0; i2 < contentStart; ++i2)
7479
7479
  value += lines[i2][0].slice(trimIndent) + "\n";
@@ -7490,24 +7490,24 @@ var require_resolve_block_scalar = __commonJS2({
7490
7490
  indent = "";
7491
7491
  }
7492
7492
  if (type === Scalar.Scalar.BLOCK_LITERAL) {
7493
- value += sep5 + indent.slice(trimIndent) + content;
7494
- sep5 = "\n";
7493
+ value += sep6 + indent.slice(trimIndent) + content;
7494
+ sep6 = "\n";
7495
7495
  } else if (indent.length > trimIndent || content[0] === " ") {
7496
- if (sep5 === " ")
7497
- sep5 = "\n";
7498
- else if (!prevMoreIndented && sep5 === "\n")
7499
- sep5 = "\n\n";
7500
- value += sep5 + indent.slice(trimIndent) + content;
7501
- sep5 = "\n";
7496
+ if (sep6 === " ")
7497
+ sep6 = "\n";
7498
+ else if (!prevMoreIndented && sep6 === "\n")
7499
+ sep6 = "\n\n";
7500
+ value += sep6 + indent.slice(trimIndent) + content;
7501
+ sep6 = "\n";
7502
7502
  prevMoreIndented = true;
7503
7503
  } else if (content === "") {
7504
- if (sep5 === "\n")
7504
+ if (sep6 === "\n")
7505
7505
  value += "\n";
7506
7506
  else
7507
- sep5 = "\n";
7507
+ sep6 = "\n";
7508
7508
  } else {
7509
- value += sep5 + content;
7510
- sep5 = " ";
7509
+ value += sep6 + content;
7510
+ sep6 = " ";
7511
7511
  prevMoreIndented = false;
7512
7512
  }
7513
7513
  }
@@ -7689,25 +7689,25 @@ var require_resolve_flow_scalar = __commonJS2({
7689
7689
  if (!match)
7690
7690
  return source2;
7691
7691
  let res = match[1];
7692
- let sep5 = " ";
7692
+ let sep6 = " ";
7693
7693
  let pos = first.lastIndex;
7694
7694
  line2.lastIndex = pos;
7695
7695
  while (match = line2.exec(source2)) {
7696
7696
  if (match[1] === "") {
7697
- if (sep5 === "\n")
7698
- res += sep5;
7697
+ if (sep6 === "\n")
7698
+ res += sep6;
7699
7699
  else
7700
- sep5 = "\n";
7700
+ sep6 = "\n";
7701
7701
  } else {
7702
- res += sep5 + match[1];
7703
- sep5 = " ";
7702
+ res += sep6 + match[1];
7703
+ sep6 = " ";
7704
7704
  }
7705
7705
  pos = line2.lastIndex;
7706
7706
  }
7707
7707
  const last = /[ \t]*(.*)/sy;
7708
7708
  last.lastIndex = pos;
7709
7709
  match = last.exec(source2);
7710
- return res + sep5 + (match?.[1] ?? "");
7710
+ return res + sep6 + (match?.[1] ?? "");
7711
7711
  }
7712
7712
  function doubleQuotedValue(source2, onError) {
7713
7713
  let res = "";
@@ -8514,14 +8514,14 @@ var require_cst_stringify = __commonJS2({
8514
8514
  }
8515
8515
  }
8516
8516
  }
8517
- function stringifyItem({ start: start2, key, sep: sep5, value }) {
8517
+ function stringifyItem({ start: start2, key, sep: sep6, value }) {
8518
8518
  let res = "";
8519
8519
  for (const st of start2)
8520
8520
  res += st.source;
8521
8521
  if (key)
8522
8522
  res += stringifyToken(key);
8523
- if (sep5)
8524
- for (const st of sep5)
8523
+ if (sep6)
8524
+ for (const st of sep6)
8525
8525
  res += st.source;
8526
8526
  if (value)
8527
8527
  res += stringifyToken(value);
@@ -9671,18 +9671,18 @@ var require_parser = __commonJS2({
9671
9671
  if (this.type === "map-value-ind") {
9672
9672
  const prev = getPrevProps(this.peek(2));
9673
9673
  const start2 = getFirstKeyStartProps(prev);
9674
- let sep5;
9674
+ let sep6;
9675
9675
  if (scalar.end) {
9676
- sep5 = scalar.end;
9677
- sep5.push(this.sourceToken);
9676
+ sep6 = scalar.end;
9677
+ sep6.push(this.sourceToken);
9678
9678
  delete scalar.end;
9679
9679
  } else
9680
- sep5 = [this.sourceToken];
9680
+ sep6 = [this.sourceToken];
9681
9681
  const map = {
9682
9682
  type: "block-map",
9683
9683
  offset: scalar.offset,
9684
9684
  indent: scalar.indent,
9685
- items: [{ start: start2, key: scalar, sep: sep5 }]
9685
+ items: [{ start: start2, key: scalar, sep: sep6 }]
9686
9686
  };
9687
9687
  this.onKeyLine = true;
9688
9688
  this.stack[this.stack.length - 1] = map;
@@ -9835,15 +9835,15 @@ var require_parser = __commonJS2({
9835
9835
  } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
9836
9836
  const start3 = getFirstKeyStartProps(it.start);
9837
9837
  const key = it.key;
9838
- const sep5 = it.sep;
9839
- sep5.push(this.sourceToken);
9838
+ const sep6 = it.sep;
9839
+ sep6.push(this.sourceToken);
9840
9840
  delete it.key;
9841
9841
  delete it.sep;
9842
9842
  this.stack.push({
9843
9843
  type: "block-map",
9844
9844
  offset: this.offset,
9845
9845
  indent: this.indent,
9846
- items: [{ start: start3, key, sep: sep5 }]
9846
+ items: [{ start: start3, key, sep: sep6 }]
9847
9847
  });
9848
9848
  } else if (start2.length > 0) {
9849
9849
  it.sep = it.sep.concat(start2, this.sourceToken);
@@ -10037,13 +10037,13 @@ var require_parser = __commonJS2({
10037
10037
  const prev = getPrevProps(parent);
10038
10038
  const start2 = getFirstKeyStartProps(prev);
10039
10039
  fixFlowSeqItems(fc);
10040
- const sep5 = fc.end.splice(1, fc.end.length);
10041
- sep5.push(this.sourceToken);
10040
+ const sep6 = fc.end.splice(1, fc.end.length);
10041
+ sep6.push(this.sourceToken);
10042
10042
  const map = {
10043
10043
  type: "block-map",
10044
10044
  offset: fc.offset,
10045
10045
  indent: fc.indent,
10046
- items: [{ start: start2, key: fc, sep: sep5 }]
10046
+ items: [{ start: start2, key: fc, sep: sep6 }]
10047
10047
  };
10048
10048
  this.onKeyLine = true;
10049
10049
  this.stack[this.stack.length - 1] = map;
@@ -19476,8 +19476,8 @@ function ensureVerityGitignore() {
19476
19476
  }
19477
19477
  let text = next.join("\n");
19478
19478
  if (!hasMarker) {
19479
- const sep5 = text === "" ? "" : text.endsWith("\n") ? "\n" : "\n\n";
19480
- text = text + sep5 + VERITY_GITIGNORE_BLOCK;
19479
+ const sep6 = text === "" ? "" : text.endsWith("\n") ? "\n" : "\n\n";
19480
+ text = text + sep6 + VERITY_GITIGNORE_BLOCK;
19481
19481
  }
19482
19482
  if (text !== content) (0, import_node_fs19.writeFileSync)(".gitignore", text);
19483
19483
  return verified(
@@ -19507,8 +19507,8 @@ function writeFencedBlock() {
19507
19507
  lines = fenceMemoryLines(lines);
19508
19508
  let text = lines.join("\n");
19509
19509
  if (!hasMarker) {
19510
- const sep5 = text === "" ? "" : text.endsWith("\n") ? "\n" : "\n\n";
19511
- text = text + sep5 + VERITY_GITIGNORE_BLOCK;
19510
+ const sep6 = text === "" ? "" : text.endsWith("\n") ? "\n" : "\n\n";
19511
+ text = text + sep6 + VERITY_GITIGNORE_BLOCK;
19512
19512
  }
19513
19513
  try {
19514
19514
  (0, import_node_fs19.writeFileSync)(".gitignore", text);
@@ -19558,8 +19558,8 @@ function keepMemoryTracked() {
19558
19558
  }
19559
19559
  if (content.includes(MEMORY_OPT_OUT_MARKER)) return "already";
19560
19560
  try {
19561
- const sep5 = content === "" ? "" : content.endsWith("\n") ? "\n" : "\n\n";
19562
- (0, import_node_fs19.writeFileSync)(".gitignore", content + sep5 + MEMORY_OPT_OUT_STANZA);
19561
+ const sep6 = content === "" ? "" : content.endsWith("\n") ? "\n" : "\n\n";
19562
+ (0, import_node_fs19.writeFileSync)(".gitignore", content + sep6 + MEMORY_OPT_OUT_STANZA);
19563
19563
  } catch {
19564
19564
  return "failed";
19565
19565
  }
@@ -23064,6 +23064,41 @@ function setupDataPath(file) {
23064
23064
  var import_node_child_process9 = require("node:child_process");
23065
23065
  var import_node_fs31 = require("node:fs");
23066
23066
  var import_node_path28 = require("node:path");
23067
+
23068
+ // src/lib/self-scope.ts
23069
+ var LEGACY_GATE_SKILLS = /* @__PURE__ */ new Set([
23070
+ "gate-setup",
23071
+ "gate-analyze",
23072
+ "gate-review",
23073
+ "gate-status",
23074
+ "gate-feedback",
23075
+ "gate-insights",
23076
+ "gate-learn",
23077
+ "gate-memory",
23078
+ "gate-reflect"
23079
+ ]);
23080
+ function isVerityOwned(path) {
23081
+ const segments = path.replace(/\\/g, "/").split("/");
23082
+ for (let i2 = 0; i2 < segments.length; i2++) {
23083
+ const seg = segments[i2];
23084
+ if (seg === ".verity" || seg === ".codacy") return true;
23085
+ if (i2 === segments.length - 1 && (seg === "VERITY.md" || seg === "GATE.md")) return true;
23086
+ if (seg === ".claude" && segments[i2 + 1] === "skills" && typeof segments[i2 + 2] === "string") {
23087
+ const skill = segments[i2 + 2];
23088
+ if (skill.startsWith("verity-") || LEGACY_GATE_SKILLS.has(skill)) return true;
23089
+ }
23090
+ if (seg === ".claude" && segments[i2 + 1] === "settings.json") return true;
23091
+ }
23092
+ return false;
23093
+ }
23094
+ function partitionVerityOwned(paths) {
23095
+ const kept = [];
23096
+ const owned = [];
23097
+ for (const p of paths) (isVerityOwned(p) ? owned : kept).push(p);
23098
+ return { kept, owned };
23099
+ }
23100
+
23101
+ // src/lib/detect.ts
23067
23102
  var TOOLED_LANGUAGES = /* @__PURE__ */ new Set([
23068
23103
  "typescript",
23069
23104
  "javascript",
@@ -23098,19 +23133,22 @@ function isIgnored2(path) {
23098
23133
  const parts2 = path.split("/");
23099
23134
  return parts2.some((p) => IGNORED_SEGMENTS.includes(p));
23100
23135
  }
23136
+ function isProjectFile(path) {
23137
+ return !isIgnored2(path) && !isVerityOwned(path);
23138
+ }
23101
23139
  function listProjectFiles(root) {
23102
23140
  try {
23103
- const out2 = (0, import_node_child_process9.execSync)("git ls-files -z", {
23141
+ const out2 = (0, import_node_child_process9.execSync)("git ls-files -z --cached --others --exclude-standard", {
23104
23142
  cwd: root,
23105
23143
  encoding: "utf-8",
23106
23144
  maxBuffer: 32 * 1024 * 1024,
23107
23145
  stdio: ["pipe", "pipe", "pipe"]
23108
23146
  });
23109
- const tracked = out2.split("\0").filter(Boolean).filter((p) => !isIgnored2(p));
23147
+ const tracked = out2.split("\0").filter(Boolean).filter(isProjectFile);
23110
23148
  if (tracked.length > 0) return tracked;
23111
23149
  } catch {
23112
23150
  }
23113
- return walk(root);
23151
+ return walk(root).filter(isProjectFile);
23114
23152
  }
23115
23153
  var WALK_MAX_FILES = 2e4;
23116
23154
  var WALK_MAX_DEPTH = 8;
@@ -26928,7 +26966,7 @@ function sanitizeCommandWithLoss(rawCmd) {
26928
26966
  const lost = lines.slice(1).some((l) => l.trim().length > 0);
26929
26967
  const first = lines[0];
26930
26968
  const cmd = sanitizeCommand(first);
26931
- const hadSeparator = SEPARATORS.some((sep5) => first.indexOf(sep5) > 0);
26969
+ const hadSeparator = SEPARATORS.some((sep6) => first.indexOf(sep6) > 0);
26932
26970
  return { cmd, lost: lost || !hadSeparator && first.length > MAX_COMMAND_CHARS };
26933
26971
  }
26934
26972
  var SEPARATORS = [" | ", " > ", " >> ", " 2>", " && ", " ; "];
@@ -26937,11 +26975,11 @@ function sanitizeCommand(rawCmd) {
26937
26975
  let cmd = rawCmd.split("\n")[0];
26938
26976
  let cut = -1;
26939
26977
  let marker = "";
26940
- for (const sep5 of SEPARATORS) {
26941
- const idx = cmd.indexOf(sep5);
26978
+ for (const sep6 of SEPARATORS) {
26979
+ const idx = cmd.indexOf(sep6);
26942
26980
  if (idx > 0 && (cut === -1 || idx < cut)) {
26943
26981
  cut = idx;
26944
- marker = sep5.trim();
26982
+ marker = sep6.trim();
26945
26983
  }
26946
26984
  }
26947
26985
  if (cut > -1) cmd = cmd.slice(0, cut);
@@ -27040,39 +27078,6 @@ async function bootstrap(run4) {
27040
27078
  Object.assign(run4, { actionSummary, assistantResponse, baseline, baselineSessionId, reachability, sessionId, stopReason, tokenResult, transcriptPath, turnId });
27041
27079
  }
27042
27080
 
27043
- // src/lib/self-scope.ts
27044
- var LEGACY_GATE_SKILLS = /* @__PURE__ */ new Set([
27045
- "gate-setup",
27046
- "gate-analyze",
27047
- "gate-review",
27048
- "gate-status",
27049
- "gate-feedback",
27050
- "gate-insights",
27051
- "gate-learn",
27052
- "gate-memory",
27053
- "gate-reflect"
27054
- ]);
27055
- function isVerityOwned(path) {
27056
- const segments = path.replace(/\\/g, "/").split("/");
27057
- for (let i2 = 0; i2 < segments.length; i2++) {
27058
- const seg = segments[i2];
27059
- if (seg === ".verity" || seg === ".codacy") return true;
27060
- if (i2 === segments.length - 1 && (seg === "VERITY.md" || seg === "GATE.md")) return true;
27061
- if (seg === ".claude" && segments[i2 + 1] === "skills" && typeof segments[i2 + 2] === "string") {
27062
- const skill = segments[i2 + 2];
27063
- if (skill.startsWith("verity-") || LEGACY_GATE_SKILLS.has(skill)) return true;
27064
- }
27065
- if (seg === ".claude" && segments[i2 + 1] === "settings.json") return true;
27066
- }
27067
- return false;
27068
- }
27069
- function partitionVerityOwned(paths) {
27070
- const kept = [];
27071
- const owned = [];
27072
- for (const p of paths) (isVerityOwned(p) ? owned : kept).push(p);
27073
- return { kept, owned };
27074
- }
27075
-
27076
27081
  // src/lib/knowledge-note-state.ts
27077
27082
  var stateDir = () => projectPath(VERITY_DIR);
27078
27083
  var STATE_FILE2 = "knowledge-note-state.json";
@@ -27252,7 +27257,7 @@ function channelSilence(input) {
27252
27257
  // src/lib/cli-version.ts
27253
27258
  function cliVersion() {
27254
27259
  try {
27255
- return true ? "0.34.0-experimental.d4649a0" : "dev";
27260
+ return true ? "0.34.0-experimental.e086ee3" : "dev";
27256
27261
  } catch {
27257
27262
  return "dev";
27258
27263
  }
@@ -27294,6 +27299,170 @@ async function sendSkipBeacon(ctx, reason) {
27294
27299
  // src/lib/static-analysis.ts
27295
27300
  var import_node_child_process12 = require("node:child_process");
27296
27301
  var import_node_fs42 = require("node:fs");
27302
+
27303
+ // src/lib/environment-globals.ts
27304
+ var NODE = [
27305
+ "process",
27306
+ "Buffer",
27307
+ "global",
27308
+ "require",
27309
+ "module",
27310
+ "exports",
27311
+ "__dirname",
27312
+ "__filename",
27313
+ "console",
27314
+ "setTimeout",
27315
+ "clearTimeout",
27316
+ "setInterval",
27317
+ "clearInterval",
27318
+ "setImmediate",
27319
+ "clearImmediate",
27320
+ "queueMicrotask",
27321
+ "structuredClone",
27322
+ "performance",
27323
+ "fetch",
27324
+ "Request",
27325
+ "Response",
27326
+ "Headers",
27327
+ "FormData",
27328
+ "Blob",
27329
+ "File",
27330
+ "URL",
27331
+ "URLSearchParams",
27332
+ "TextEncoder",
27333
+ "TextDecoder",
27334
+ "TextEncoderStream",
27335
+ "TextDecoderStream",
27336
+ "AbortController",
27337
+ "AbortSignal",
27338
+ "Event",
27339
+ "EventTarget",
27340
+ "CustomEvent",
27341
+ "MessageChannel",
27342
+ "MessagePort",
27343
+ "MessageEvent",
27344
+ "BroadcastChannel",
27345
+ "WebSocket",
27346
+ "WebAssembly",
27347
+ "crypto",
27348
+ "Crypto",
27349
+ "CryptoKey",
27350
+ "SubtleCrypto",
27351
+ "atob",
27352
+ "btoa",
27353
+ "navigator",
27354
+ "DOMException",
27355
+ "ReadableStream",
27356
+ "WritableStream",
27357
+ "TransformStream",
27358
+ "CompressionStream",
27359
+ "DecompressionStream",
27360
+ "ByteLengthQueuingStrategy",
27361
+ "CountQueuingStrategy",
27362
+ "PerformanceObserver",
27363
+ "PerformanceEntry",
27364
+ "PerformanceMark",
27365
+ "PerformanceMeasure"
27366
+ ];
27367
+ var BROWSER = [
27368
+ "window",
27369
+ "self",
27370
+ "document",
27371
+ "location",
27372
+ "history",
27373
+ "localStorage",
27374
+ "sessionStorage",
27375
+ "screen",
27376
+ "alert",
27377
+ "confirm",
27378
+ "prompt",
27379
+ "requestAnimationFrame",
27380
+ "cancelAnimationFrame",
27381
+ "requestIdleCallback",
27382
+ "cancelIdleCallback",
27383
+ "getComputedStyle",
27384
+ "matchMedia",
27385
+ "getSelection",
27386
+ "scrollTo",
27387
+ "scrollBy",
27388
+ "innerWidth",
27389
+ "innerHeight",
27390
+ "outerWidth",
27391
+ "outerHeight",
27392
+ "devicePixelRatio",
27393
+ "visualViewport",
27394
+ "postMessage",
27395
+ "addEventListener",
27396
+ "removeEventListener",
27397
+ "dispatchEvent",
27398
+ "customElements",
27399
+ "indexedDB",
27400
+ "IDBKeyRange",
27401
+ "caches",
27402
+ "XMLHttpRequest",
27403
+ "EventSource",
27404
+ "FileReader",
27405
+ "Image",
27406
+ "Audio",
27407
+ "Worker",
27408
+ "SharedWorker",
27409
+ "Notification",
27410
+ "MutationObserver",
27411
+ "IntersectionObserver",
27412
+ "ResizeObserver",
27413
+ "DOMParser",
27414
+ "XMLSerializer",
27415
+ "Node",
27416
+ "Element",
27417
+ "HTMLElement",
27418
+ "SVGElement",
27419
+ "NodeList",
27420
+ "HTMLCollection",
27421
+ "DocumentFragment",
27422
+ "ShadowRoot",
27423
+ "Range",
27424
+ "Selection",
27425
+ "KeyboardEvent",
27426
+ "MouseEvent",
27427
+ "PointerEvent",
27428
+ "FocusEvent",
27429
+ "InputEvent",
27430
+ "TouchEvent",
27431
+ "UIEvent",
27432
+ "ErrorEvent",
27433
+ "ProgressEvent",
27434
+ "StorageEvent",
27435
+ "CloseEvent",
27436
+ "CSS",
27437
+ "CSSStyleSheet",
27438
+ "FontFace",
27439
+ "ImageData",
27440
+ "ImageBitmap",
27441
+ "createImageBitmap",
27442
+ "OffscreenCanvas",
27443
+ "Path2D",
27444
+ "CanvasRenderingContext2D",
27445
+ "AudioContext",
27446
+ "MediaStream",
27447
+ "MediaRecorder",
27448
+ "RTCPeerConnection",
27449
+ "ClipboardItem",
27450
+ "isSecureContext",
27451
+ "crossOriginIsolated",
27452
+ "reportError",
27453
+ "speechSynthesis"
27454
+ ];
27455
+ var ENVIRONMENT_GLOBALS = /* @__PURE__ */ new Set([...NODE, ...BROWSER]);
27456
+ var NOT_DEFINED = /^'([^']+)' is not defined\.?$/;
27457
+ var COMMONJS_ONLY = /* @__PURE__ */ new Set(["require", "module", "exports", "__dirname", "__filename"]);
27458
+ function isEnvironmentGlobalNoUndef(ruleId, message, filePath = "") {
27459
+ if (!/(^|_)no-undef$/.test(ruleId)) return false;
27460
+ const name2 = message.trim().match(NOT_DEFINED)?.[1];
27461
+ if (name2 === void 0 || !ENVIRONMENT_GLOBALS.has(name2)) return false;
27462
+ return !(COMMONJS_ONLY.has(name2) && /\.m[jt]s$/.test(filePath));
27463
+ }
27464
+
27465
+ // src/lib/static-analysis.ts
27297
27466
  var SEVERITY_ORDER = {
27298
27467
  Error: 0,
27299
27468
  Critical: 0,
@@ -27381,7 +27550,10 @@ function interpretAnalyzerRun(run4) {
27381
27550
  } catch {
27382
27551
  return withFailure("unparseable_output", output);
27383
27552
  }
27384
- const issues = parsed.issues ?? [];
27553
+ const reported = parsed.issues ?? [];
27554
+ const issues = reported.filter(
27555
+ (i2) => !isEnvironmentGlobalNoUndef(i2.patternId ?? "", i2.message ?? "", i2.filePath ?? "")
27556
+ );
27385
27557
  const findings = issues.map((issue) => ({
27386
27558
  rule_id: issue.patternId ?? "",
27387
27559
  tool: issue.toolId ?? "",
@@ -27404,7 +27576,7 @@ function interpretAnalyzerRun(run4) {
27404
27576
  );
27405
27577
  const analyzerErrors = parsed.errors ?? [];
27406
27578
  let failure;
27407
- if (findings.length === 0) {
27579
+ if (reported.length === 0) {
27408
27580
  if (analyzerErrors.length > 0) {
27409
27581
  const first = analyzerErrors[0];
27410
27582
  failure = {
@@ -38020,6 +38192,7 @@ var import_node_fs67 = require("node:fs");
38020
38192
  var import_promises20 = require("node:fs/promises");
38021
38193
  var import_yaml6 = __toESM2(require_dist());
38022
38194
  var import_node_path52 = require("node:path");
38195
+ var import_node_os11 = require("node:os");
38023
38196
  var import_node_child_process19 = require("node:child_process");
38024
38197
 
38025
38198
  // src/lib/banner.ts
@@ -38665,8 +38838,8 @@ function mergeGlobalCredentials(gateCreds, verityCreds) {
38665
38838
  toAppend.push(line2.replace(/\r$/, ""));
38666
38839
  }
38667
38840
  if (toAppend.length > 0) {
38668
- const sep5 = verityContent.endsWith("\n") || verityContent === "" ? "" : "\n";
38669
- (0, import_node_fs64.writeFileSync)(verityCreds, verityContent + sep5 + toAppend.join("\n") + "\n");
38841
+ const sep6 = verityContent.endsWith("\n") || verityContent === "" ? "" : "\n";
38842
+ (0, import_node_fs64.writeFileSync)(verityCreds, verityContent + sep6 + toAppend.join("\n") + "\n");
38670
38843
  }
38671
38844
  (0, import_node_fs64.rmSync)(gateCreds, { force: true });
38672
38845
  return toAppend.length;
@@ -39909,7 +40082,15 @@ async function offerFormalVerification(defaultsOnly, pluginMode) {
39909
40082
  console.log(" At push, Verity picks the riskiest changed function, checks a small model of");
39910
40083
  console.log(" it, and replays any counterexample on the real code (its source is sent to");
39911
40084
  console.log(" Verity for that). Only a reproduced bug can block; most pushes get no model.");
39912
- console.log(` Adds /verity-prove <worry> to check any code on demand.${toolchain ? "" : ` Needs to install Lean 4 (${LEAN_DOWNLOAD_SIZE}) on "yes".`}`);
40085
+ console.log(" Adds /verity-prove <worry> to check any code on demand, e.g.");
40086
+ console.log(` ${DIM}/verity-prove can the webhook handler charge twice on a retried event?${NC}`);
40087
+ if (!toolchain) {
40088
+ const dir = pinnedVersionDir();
40089
+ const home = (0, import_node_os11.homedir)();
40090
+ const shown = dir.startsWith(home + import_node_path52.sep) ? `~${dir.slice(home.length)}` : dir;
40091
+ console.log("");
40092
+ console.log(` "yes" installs Lean 4 (${LEAN_DOWNLOAD_SIZE}) into ${shown}`);
40093
+ }
39913
40094
  console.log("");
39914
40095
  const wants = await promptChoice("Formal verification at push?", FORMAL_CHOICES, "no");
39915
40096
  if (wants === "yes" && pluginMode) printInfo(" Plugin: the push check works now; /verity:verity-prove arrives with the plugin's next release.");
@@ -40019,7 +40200,7 @@ function registerInitCommand(program2) {
40019
40200
  const claudeInstalled = await checkPrerequisites(step);
40020
40201
  console.log("");
40021
40202
  if (pluginMode) {
40022
- printInfo("Skipping skills \u2014 the Verity plugin provides them, namespaced as /verity:<name>.");
40203
+ step("Skills already installed by the plugin, namespaced as /verity:<name>");
40023
40204
  } else {
40024
40205
  await installSkills(force, step);
40025
40206
  }
@@ -40173,7 +40354,7 @@ function registerInitCommand(program2) {
40173
40354
  ...telemetryChoice ? { telemetry: telemetryChoice } : {},
40174
40355
  init: {
40175
40356
  completed_at: (/* @__PURE__ */ new Date()).toISOString(),
40176
- cli_version: true ? "0.34.0-experimental.d4649a0" : "dev"
40357
+ cli_version: true ? "0.34.0-experimental.e086ee3" : "dev"
40177
40358
  }
40178
40359
  });
40179
40360
  } catch (err2) {
@@ -41587,7 +41768,7 @@ function refreshScaffold(root) {
41587
41768
  // src/commands/lean.ts
41588
41769
  var import_node_fs73 = require("node:fs");
41589
41770
  var import_node_child_process20 = require("node:child_process");
41590
- var import_node_os11 = require("node:os");
41771
+ var import_node_os12 = require("node:os");
41591
41772
  var import_node_path56 = require("node:path");
41592
41773
  function registerLeanCommand(program2) {
41593
41774
  const lean = program2.command("lean").description("The Lean 4 toolchain formal verification needs (managed download, pinned by this CLI)");
@@ -41619,7 +41800,7 @@ function registerLeanCommand(program2) {
41619
41800
  lean.command("install").description("Download and unpack the pinned Lean 4 into ~/.verity/lean/<version> (official release, \u2248800 MB, 2.7 GB on disk)").option("--yes", "Do not ask").option("--force", "Reinstall even if present").action(async (opts) => {
41620
41801
  const asset = leanAssetName();
41621
41802
  if (!asset) {
41622
- printError(`no Lean release for ${(0, import_node_os11.platform)()}/${(0, import_node_os11.arch)()}`);
41803
+ printError(`no Lean release for ${(0, import_node_os12.platform)()}/${(0, import_node_os12.arch)()}`);
41623
41804
  process.exit(2);
41624
41805
  }
41625
41806
  const dir = pinnedVersionDir();
@@ -41669,8 +41850,8 @@ function registerLeanCommand(program2) {
41669
41850
  }
41670
41851
 
41671
41852
  // src/cli.ts
41672
- program.name("verity").description("CLI for Verity quality gate service").version("0.34.0-experimental.d4649a0").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr").hook("preAction", async (_thisCommand, actionCommand) => {
41673
- installStderrLog(actionCommand.name(), process.argv.slice(2), "0.34.0-experimental.d4649a0");
41853
+ program.name("verity").description("CLI for Verity quality gate service").version("0.34.0-experimental.e086ee3").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr").hook("preAction", async (_thisCommand, actionCommand) => {
41854
+ installStderrLog(actionCommand.name(), process.argv.slice(2), "0.34.0-experimental.e086ee3");
41674
41855
  setUserNamedServiceUrl(program.opts().serviceUrl);
41675
41856
  try {
41676
41857
  await foldLegacyLocalCredential();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/verity-cli",
3
- "version": "0.34.0-experimental.d4649a0",
3
+ "version": "0.34.0-experimental.e086ee3",
4
4
  "description": "CLI for Verity quality gate service",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://verity.md",