@kevinrabun/judges 3.126.0 → 3.126.2

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.
@@ -148,13 +148,15 @@ export function parseLlmRuleIds(response) {
148
148
  const validPrefixes = getValidRulePrefixes();
149
149
  const pattern = /\b([A-Z][A-Z0-9]+)-(\d{1,3})\b/g;
150
150
  const found = new Set();
151
- // Split response into paragraphs/sections and skip sections that explicitly
152
- // declare zero findings rule IDs mentioned in "zero findings" rationale
153
- // are explanatory references, not actual detections.
154
- const sections = response.split(/\n{2,}/);
155
- const zeroFindingsPattern = /\*?\*?(?:ZERO|zero|0|no)\s+findings?\*?\*?|(?:findings?|issues?)[\s:]*\*?\*?(?:none|0|zero)\*?\*?|no\s+(?:issues?|findings?|problems?|concerns?)\s+(?:found|detected|identified|reported)/i;
151
+ // Split response into judge sections (separated by --- dividers or ## headers)
152
+ // and skip entire sections that declare zero/no findings. This prevents rule
153
+ // IDs mentioned in rationale text or findings tables of "clean" judge sections
154
+ // from being counted as detections.
155
+ const sections = response.split(/(?:^|\n)---\s*\n|(?=^## )/m);
156
+ const zeroFindingsPattern = /\*?\*?(?:ZERO|zero|0|no)\s+findings?\*?\*?|(?:findings?|issues?)[\s:]*\*?\*?(?:none|0|zero)\*?\*?|no\s+(?:issues?|findings?|problems?|concerns?)\s+(?:found|detected|identified|reported)|report(?:ing)?\s+zero|Score\s*[|:]\s*\*?\*?100\s*\/?\s*100\*?\*?/i;
156
157
  for (const section of sections) {
157
- // If this section explicitly declares zero/no findings, skip rule ID extraction
158
+ // If this section explicitly declares zero/no findings or a perfect score,
159
+ // skip rule ID extraction — any rule IDs are explanatory references
158
160
  if (zeroFindingsPattern.test(section))
159
161
  continue;
160
162
  let match;
@@ -165,13 +167,17 @@ export function parseLlmRuleIds(response) {
165
167
  }
166
168
  }
167
169
  }
168
- // Secondary pass on full text: extract known prefixes from compound IDs like DEPS-TYPO-001
169
- // These are almost always in findings tables, not rationale
170
- const compoundPattern = /\b([A-Z][A-Z0-9]+)-[A-Z][A-Z0-9]+-(\d{1,3})\b/g;
171
- let match;
172
- while ((match = compoundPattern.exec(response)) !== null) {
173
- if (validPrefixes.has(match[1])) {
174
- found.add(`${match[1]}-${match[2]}`);
170
+ // Secondary pass: extract compound IDs like DEPS-TYPO-001 from sections
171
+ // that did NOT declare zero findings (reuse the filtered sections)
172
+ for (const section of sections) {
173
+ if (zeroFindingsPattern.test(section))
174
+ continue;
175
+ const compoundPattern = /\b([A-Z][A-Z0-9]+)-[A-Z][A-Z0-9]+-(\d{1,3})\b/g;
176
+ let match;
177
+ while ((match = compoundPattern.exec(section)) !== null) {
178
+ if (validPrefixes.has(match[1])) {
179
+ found.add(`${match[1]}-${match[2]}`);
180
+ }
175
181
  }
176
182
  }
177
183
  return [...found];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevinrabun/judges",
3
- "version": "3.126.0",
3
+ "version": "3.126.2",
4
4
  "description": "45 specialized judges that evaluate AI-generated code for security, cost, and quality.",
5
5
  "mcpName": "io.github.KevinRabun/judges",
6
6
  "type": "module",
package/server.json CHANGED
@@ -16,12 +16,12 @@
16
16
  "mimeType": "image/png"
17
17
  }
18
18
  ],
19
- "version": "3.126.0",
19
+ "version": "3.126.2",
20
20
  "packages": [
21
21
  {
22
22
  "registryType": "npm",
23
23
  "identifier": "@kevinrabun/judges",
24
- "version": "3.126.0",
24
+ "version": "3.126.2",
25
25
  "transport": {
26
26
  "type": "stdio"
27
27
  }