xploitscan-shared-rules 1.14.3 → 1.14.4

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.
package/dist/index.cjs CHANGED
@@ -8900,7 +8900,7 @@ function parseReviewResponse(text) {
8900
8900
  }
8901
8901
  }
8902
8902
  async function filterFalsePositives(findings, fileContents) {
8903
- const empty = { findings, filteredFindings: [], aiReviewed: false, removedCount: 0, totalBefore: findings.length };
8903
+ const empty = { findings, filteredFindings: [], aiReviewed: false, removedCount: 0, totalBefore: findings.length, unreviewedCount: 0 };
8904
8904
  if (!process.env.ANTHROPIC_API_KEY) return empty;
8905
8905
  if (findings.length === 0) return empty;
8906
8906
  const prioritized = [...findings].sort((a, b) => {
@@ -8927,6 +8927,7 @@ async function filterFalsePositives(findings, fileContents) {
8927
8927
  let reviewedAny = false;
8928
8928
  let firstError = null;
8929
8929
  let failedBatches = 0;
8930
+ let unreviewedCount = 0;
8930
8931
  const tasks = [];
8931
8932
  for (const [file, fileFindings] of byFile) {
8932
8933
  const content = fileContents.get(file);
@@ -8936,8 +8937,8 @@ async function filterFalsePositives(findings, fileContents) {
8936
8937
  }
8937
8938
  }
8938
8939
  const reviewBatch = async (task) => {
8940
+ const { batch, content } = task;
8939
8941
  try {
8940
- const { batch, content } = task;
8941
8942
  const prompt = buildReviewPrompt(batch, content);
8942
8943
  const response = await client.messages.create(
8943
8944
  {
@@ -8966,6 +8967,7 @@ async function filterFalsePositives(findings, fileContents) {
8966
8967
  }
8967
8968
  } catch (err) {
8968
8969
  failedBatches++;
8970
+ unreviewedCount += batch.length;
8969
8971
  if (!firstError) firstError = err;
8970
8972
  }
8971
8973
  };
@@ -9002,7 +9004,8 @@ async function filterFalsePositives(findings, fileContents) {
9002
9004
  filteredFindings,
9003
9005
  aiReviewed: reviewedAny,
9004
9006
  removedCount: fpMap.size,
9005
- totalBefore
9007
+ totalBefore,
9008
+ unreviewedCount
9006
9009
  };
9007
9010
  }
9008
9011