vigthoria-cli 1.6.31 → 1.6.32

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.
@@ -105,9 +105,10 @@ class GenerateCommand {
105
105
  if (options.output) {
106
106
  await this.saveToFile(options.output, code);
107
107
  }
108
- else {
108
+ else if (process.stdout.isTTY) {
109
109
  await this.promptForAction(code, options.language);
110
110
  }
111
+ // Non-TTY: code was already printed above — skip interactive menu
111
112
  }
112
113
  catch (error) {
113
114
  spinner.stop();
package/dist/utils/api.js CHANGED
@@ -3588,9 +3588,10 @@ document.addEventListener('DOMContentLoaded', () => {
3588
3588
  'Rules:',
3589
3589
  '- Return concrete, line-specific issues with severity.',
3590
3590
  '- Every issue MUST reference a line number.',
3591
- '- If the score is below 50, list at least 2 specific issues.',
3591
+ '- Report each distinct bug ONCE. Do NOT report the same bug multiple times with different wording.',
3592
+ '- For trivial/short code (< 10 lines), report at most 2 issues unless there are genuinely more distinct bugs.',
3592
3593
  '- Prioritize REAL BUGS: wrong operators, logic errors, off-by-one, type mismatches.',
3593
- '- Only report style issues AFTER listing all real bugs.',
3594
+ '- Only report style/robustness issues if there are no real bugs to report.',
3594
3595
  '- Return ONLY the JSON object, no markdown fences or extra text.',
3595
3596
  ].join('\n');
3596
3597
  let raw = {};
@@ -3605,25 +3606,35 @@ document.addEventListener('DOMContentLoaded', () => {
3605
3606
  const score = typeof raw.score === 'number' ? raw.score : 0;
3606
3607
  const issues = Array.isArray(raw.issues) ? raw.issues : [];
3607
3608
  const suggestions = Array.isArray(raw.suggestions) ? raw.suggestions : [];
3608
- // Always run client-side heuristics and merge any findings the
3609
- // server missed. This ensures arithmetic/logic bugs are surfaced
3610
- // even when the server only reports style issues like console.log.
3609
+ // Merge client-side heuristics, but with tight dedup to avoid
3610
+ // redundant over-reporting when the model already found the bug.
3611
3611
  const heuristic = this.heuristicCodeIssues(code, language);
3612
3612
  for (const h of heuristic) {
3613
- // Always include critical logic bugs (severity error) from heuristics
3614
- // regardless of server results these catch wrong-operator bugs the
3615
- // server frequently misses.
3616
- if (h.severity === 'error') {
3617
- const exactDuplicate = issues.some((existing) => existing.line === h.line && existing.message === h.message);
3618
- if (!exactDuplicate) {
3619
- issues.push(h);
3613
+ // Semantic duplicate check: same line + (similar type OR overlapping
3614
+ // keywords in the message). This catches cases where the model
3615
+ // and heuristic describe the same bug with different wording.
3616
+ const hWords = new Set(h.message.toLowerCase().split(/\W+/).filter(w => w.length > 3));
3617
+ const hTypeNorm = h.type.toLowerCase().replace(/[^a-z]/g, '');
3618
+ const isSemanticallyDuplicate = issues.some((existing) => {
3619
+ if (existing.line !== h.line)
3620
+ return false;
3621
+ // Normalize types: "logic-error", "logic_error", "logic" all match
3622
+ const eTypeNorm = existing.type.toLowerCase().replace(/[^a-z]/g, '');
3623
+ if (eTypeNorm === hTypeNorm || eTypeNorm.startsWith(hTypeNorm) || hTypeNorm.startsWith(eTypeNorm))
3624
+ return true;
3625
+ // Both errors on same line about the same category of problem
3626
+ if (existing.severity === 'error' && h.severity === 'error')
3627
+ return true;
3628
+ // Check keyword overlap — if ≥2 significant words match, it's the same finding
3629
+ const eWords = existing.message.toLowerCase().split(/\W+/).filter(w => w.length > 3);
3630
+ let overlap = 0;
3631
+ for (const w of eWords) {
3632
+ if (hWords.has(w))
3633
+ overlap++;
3620
3634
  }
3621
- continue;
3622
- }
3623
- // For non-critical heuristics, avoid duplicating issues the server
3624
- // already reported on the same line with the same type.
3625
- const isDuplicate = issues.some((existing) => existing.line === h.line && existing.type === h.type);
3626
- if (!isDuplicate) {
3635
+ return overlap >= 2;
3636
+ });
3637
+ if (!isSemanticallyDuplicate) {
3627
3638
  issues.push(h);
3628
3639
  }
3629
3640
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigthoria-cli",
3
- "version": "1.6.31",
3
+ "version": "1.6.32",
4
4
  "description": "Vigthoria Coder CLI - AI-powered terminal coding assistant",
5
5
  "main": "dist/index.js",
6
6
  "files": [