pumuki-ast-hooks 5.3.28 → 5.3.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki-ast-hooks",
3
- "version": "5.3.28",
3
+ "version": "5.3.29",
4
4
  "description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -123,4 +123,4 @@
123
123
  "./skills": "./skills/skill-rules.json",
124
124
  "./hooks": "./hooks/index.js"
125
125
  }
126
- }
126
+ }
@@ -368,18 +368,36 @@ function generateOutput(findings, context, project, root) {
368
368
 
369
369
  // Top violations
370
370
  const grouped = {};
371
+ const levelRank = { LOW: 1, MEDIUM: 2, HIGH: 3, CRITICAL: 4 };
372
+ const emojiForLevel = (level) => (level === 'CRITICAL' || level === 'HIGH' ? '🔴' : '🔵');
373
+
371
374
  findings.forEach(f => {
372
- grouped[f.ruleId] = (grouped[f.ruleId] || 0) + 1;
375
+ if (!f || !f.ruleId) return;
376
+ const level = mapToLevel(f.severity);
377
+ if (!grouped[f.ruleId]) {
378
+ grouped[f.ruleId] = { count: 0, worstLevel: level };
379
+ }
380
+ grouped[f.ruleId].count += 1;
381
+ if ((levelRank[level] || 0) > (levelRank[grouped[f.ruleId].worstLevel] || 0)) {
382
+ grouped[f.ruleId].worstLevel = level;
383
+ }
384
+ });
385
+
386
+ const entries = Object.entries(grouped)
387
+ .map(([ruleId, data]) => ({ ruleId, count: data.count, worstLevel: data.worstLevel }))
388
+ .sort((a, b) => b.count - a.count);
389
+
390
+ const blockers = entries.filter(e => e.worstLevel === 'CRITICAL' || e.worstLevel === 'HIGH');
391
+ const nonBlockers = entries.filter(e => e.worstLevel !== 'CRITICAL' && e.worstLevel !== 'HIGH');
392
+
393
+ blockers.forEach(({ ruleId, count, worstLevel }) => {
394
+ console.error(`${emojiForLevel(worstLevel)} ${ruleId} - ${count} violations`);
373
395
  });
374
396
 
375
- Object.entries(grouped)
376
- .sort((a, b) => b[1] - a[1])
377
- .slice(0, 20)
378
- .forEach(([ruleId, count]) => {
379
- const severity = ruleId.includes("types.any") || ruleId.includes("security.") || ruleId.includes("architecture.") ? "error" :
380
- ruleId.includes("performance.") || ruleId.includes("debug.") ? "warning" : "info";
381
- const emoji = severity === "error" ? "🔴" : severity === "warning" ? "🟡" : "🔵";
382
- console.error(`${emoji} ${ruleId} - ${count} violations`);
397
+ nonBlockers
398
+ .slice(0, Math.max(0, 20 - blockers.length))
399
+ .forEach(({ ruleId, count, worstLevel }) => {
400
+ console.error(`${emojiForLevel(worstLevel)} ${ruleId} - ${count} violations`);
383
401
  });
384
402
 
385
403
  // Summary