kodingo-cli 1.1.9 → 1.1.10

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.
@@ -66,6 +66,9 @@ const SUPPORTED_EXTENSIONS = [
66
66
  const IGNORED_DIRS = [
67
67
  "node_modules", ".git", ".kortex", "dist", "build",
68
68
  "out", ".next", "coverage", "__pycache__", "vendor",
69
+ ".venv", "venv", "env", ".env", "site-packages",
70
+ "virtualenv", ".tox", "eggs", ".eggs", "wheels",
71
+ "target", ".gradle", ".idea", ".vscode", "bin", "obj",
69
72
  ];
70
73
  const MAX_SYMBOLS = 200;
71
74
  const BATCH_SIZE = 5;
@@ -18,7 +18,7 @@ const graph_builder_1 = require("../utils/graph-builder");
18
18
  const security_code_analyzer_1 = require("../utils/security-code-analyzer");
19
19
  const context_assembler_1 = require("../utils/context-assembler");
20
20
  const ast_parser_1 = require("../utils/ast-parser");
21
- const IGNORED_DIRS = new Set(["node_modules", ".git", ".kortex", "dist", "build", "vendor", "out", ".next"]);
21
+ const IGNORED_DIRS = new Set(["node_modules", ".git", ".kortex", "dist", "build", "vendor", "out", ".next", ".venv", "venv", "env", "site-packages", "virtualenv", ".tox", "target", ".gradle", ".idea", ".vscode", "bin", "obj"]);
22
22
  const SUPPORTED_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".py", ".go", ".rs", ".php", ".java", ".kt", ".rb", ".c", ".cpp", ".html", ".phtml", ".twig", ".blade.php"];
23
23
  function walkFiles(dir) {
24
24
  const results = [];
@@ -131,13 +131,35 @@ async function securityScanCommand(options = {}) {
131
131
  }
132
132
  catch { }
133
133
  const allCandidates = (0, security_code_analyzer_1.analyzeForSecurityCandidates)(repoRoot, graph, symbols, dynamicRules);
134
- // Cap at 30 candidates for LLM judgment — prioritise critical and high severity
134
+ // Fetch already-confirmed open findings so we don't re-scan them —
135
+ // they stay visible in the dashboard as open until fixed, but we use
136
+ // our 30-candidate budget on NEW issues each week.
137
+ let confirmedFingerprints = new Set();
138
+ try {
139
+ const existingRes = await fetch(`${apiUrl}/security/findings?repo=${encodeURIComponent(repoName)}`, {
140
+ headers: { "X-Kodingo-Token": token },
141
+ });
142
+ if (existingRes.ok) {
143
+ const { findings: existingFindings } = await existingRes.json();
144
+ existingFindings.forEach((f) => {
145
+ confirmedFingerprints.add(`${f.finding_type}:${f.endpoint ?? f.symbol ?? ""}:${f.vulnerability_id ?? ""}`);
146
+ });
147
+ }
148
+ }
149
+ catch { }
150
+ // Filter out already-confirmed findings, then sort by severity and cap at 30
135
151
  const SEVERITY_ORDER = { critical: 0, high: 1, moderate: 2, low: 3 };
136
- const candidates = allCandidates
152
+ const newCandidates = allCandidates.filter(c => {
153
+ const fp = `${c.patternType}:${c.symbol ?? c.file}:${c.file}`;
154
+ return !confirmedFingerprints.has(fp);
155
+ });
156
+ const candidates = newCandidates
137
157
  .sort((a, b) => (SEVERITY_ORDER[a.severity ?? 'low'] ?? 3) - (SEVERITY_ORDER[b.severity ?? 'low'] ?? 3))
138
158
  .slice(0, 30);
139
- if (!options.silent && allCandidates.length > 30) {
140
- console.log(` Found ${allCandidates.length} candidates — reviewing top 30 by severity\n`);
159
+ if (!options.silent) {
160
+ if (allCandidates.length > 0) {
161
+ console.log(` Found ${allCandidates.length} candidates (${allCandidates.length - newCandidates.length} already tracked as open) — reviewing ${Math.min(candidates.length, 30)} new ones\n`);
162
+ }
141
163
  }
142
164
  if (candidates.length === 0) {
143
165
  if (!options.silent)
@@ -154,7 +154,7 @@ function parseComposerLock(repoRoot, filePath) {
154
154
  }
155
155
  return entries;
156
156
  }
157
- const IGNORED_DIRS = new Set(["node_modules", ".git", ".kortex", "dist", "build", "vendor", "out", ".next"]);
157
+ const IGNORED_DIRS = new Set(["node_modules", ".git", ".kortex", "dist", "build", "vendor", "out", ".next", ".venv", "venv", "env", "site-packages", "virtualenv", ".tox", "target", ".gradle", ".idea", ".vscode", "bin", "obj"]);
158
158
  function findManifestFiles(repoRoot) {
159
159
  const result = { packageJson: [], packageLock: [], composerJson: [], composerLock: [] };
160
160
  function walk(dir) {
@@ -70,6 +70,8 @@ const TS_JS_EXTENSIONS = new Set([".ts", ".tsx", ".js", ".jsx"]);
70
70
  const IGNORED_DIRS = [
71
71
  "node_modules", ".git", ".kortex", "dist", "build",
72
72
  "out", ".next", "coverage", "__pycache__", "vendor",
73
+ ".venv", "venv", "env", "site-packages", "virtualenv",
74
+ ".tox", "target", ".gradle", ".idea", ".vscode", "bin", "obj",
73
75
  ];
74
76
  function walkFiles(dir) {
75
77
  const results = [];
@@ -98,7 +98,7 @@ function analyzeForSecurityCandidates(repoRoot, graph, symbols, dynamicRules = [
98
98
  ".java": "java", ".kt": "kotlin", ".rb": "ruby", ".c": "c", ".cpp": "cpp",
99
99
  ".html": "html", ".js": "javascript", ".ts": "typescript", ".jsx": "javascript", ".tsx": "typescript"
100
100
  };
101
- const IGNORED_DIRS = new Set(["node_modules", ".git", "dist", "build", "vendor", "__pycache__", ".next", "out", "coverage"]);
101
+ const IGNORED_DIRS = new Set(["node_modules", ".git", "dist", "build", "vendor", "__pycache__", ".next", "out", "coverage", ".venv", "venv", "env", "site-packages", "virtualenv", ".tox", "target", ".gradle", ".idea", ".vscode", "bin", "obj"]);
102
102
  // Get recently changed files from git (last 30 days) — scan these first
103
103
  let priorityFiles = [];
104
104
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodingo-cli",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "Kodingo CLI",
5
5
  "license": "MIT",
6
6
  "private": false,