@kevinrabun/judges 3.127.0 → 3.127.1
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/commands/llm-benchmark-optimizer.js +28 -25
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -109,6 +109,7 @@ function generateAmendment(prefix, precision, fpCount, total, snapshot) {
|
|
|
109
109
|
const domain = judge?.domain ?? "its domain";
|
|
110
110
|
// Analyze what the FPs look like — which categories get falsely flagged
|
|
111
111
|
const fpCategories = new Map();
|
|
112
|
+
const tpCategories = new Map();
|
|
112
113
|
// Collect specific FP case IDs for pattern extraction
|
|
113
114
|
const fpCaseExamples = [];
|
|
114
115
|
for (const c of snapshot.cases) {
|
|
@@ -120,35 +121,36 @@ function generateAmendment(prefix, precision, fpCount, total, snapshot) {
|
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
}
|
|
124
|
+
// Also track where this judge produces TRUE positives
|
|
125
|
+
for (const det of c.detectedRuleIds) {
|
|
126
|
+
if (det.startsWith(prefix + "-") && !c.falsePositiveRuleIds.includes(det)) {
|
|
127
|
+
tpCategories.set(c.category, (tpCategories.get(c.category) ?? 0) + 1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
123
130
|
}
|
|
124
|
-
|
|
131
|
+
// Identify categories that are FP-only (no TPs) — safe to suppress
|
|
132
|
+
const fpOnlyCategories = [...fpCategories.entries()]
|
|
133
|
+
.filter(([cat]) => !tpCategories.has(cat))
|
|
125
134
|
.sort((a, b) => b[1] - a[1])
|
|
126
135
|
.slice(0, 5)
|
|
127
136
|
.map(([cat]) => cat);
|
|
128
|
-
// Build
|
|
129
|
-
const categoryBlocklist = topFpCategories.length > 0
|
|
130
|
-
? `\nDo NOT report ${prefix}- findings on code in these categories: ${topFpCategories.join(", ")}. ` +
|
|
131
|
-
`These categories fall outside ${domain} and historically produce false positives.`
|
|
132
|
-
: "";
|
|
133
|
-
// Extract specific FP patterns for concrete guidance
|
|
134
|
-
const fpRuleIds = new Set(fpCaseExamples.map((e) => e.ruleId));
|
|
135
|
-
const specificRules = [...fpRuleIds].slice(0, 5).join(", ");
|
|
136
|
-
const ruleWarning = specificRules
|
|
137
|
-
? `\nSpecific rule IDs with high FP rates: ${specificRules}. Require >=80% confidence with exact line citations before reporting these.`
|
|
138
|
-
: "";
|
|
139
|
-
// Identify if clean cases are a problem for this judge
|
|
137
|
+
// Build targeted anti-FP instructions — only suppress on clean/FP-only categories
|
|
140
138
|
const cleanFPs = fpCaseExamples.filter((e) => e.category === "clean" || e.category.startsWith("ai-negative")).length;
|
|
139
|
+
const nonCleanFPOnlyWarning = fpOnlyCategories.length > 0
|
|
140
|
+
? `\nHistorically produces false positives on: ${fpOnlyCategories.join(", ")}. Apply extra scrutiny on these categories — require concrete evidence before reporting.`
|
|
141
|
+
: "";
|
|
141
142
|
const cleanWarning = cleanFPs > 0
|
|
142
|
-
? `\nThis judge produced ${cleanFPs} false
|
|
143
|
+
? `\nThis judge produced ${cleanFPs} false positive(s) on CLEAN code. If code uses standard patterns correctly (proper error handling, established libraries, framework conventions), report ZERO ${prefix}- findings. Clean, well-written code exists — do not manufacture findings.`
|
|
143
144
|
: "";
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
`
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
// IMPORTANT: Do NOT restrict the judge from detecting real issues in vulnerable code.
|
|
146
|
+
// Only add caution for clean-code patterns, not a blanket confidence floor.
|
|
147
|
+
const amendment = `PRECISION CALIBRATION for ${judgeName} (${prefix}-): ` +
|
|
148
|
+
`Empirical precision: ${pct(precision)} in recent benchmarks. ` +
|
|
149
|
+
`IMPORTANT: Continue detecting genuine ${domain} issues in vulnerable code — do NOT reduce sensitivity to real problems. ` +
|
|
150
|
+
`CALIBRATION: The false positives come from flagging well-written code that correctly uses established patterns. ` +
|
|
151
|
+
`Before reporting ${prefix}- findings, verify the code actually has a deficiency — not just a theoretical improvement opportunity.` +
|
|
150
152
|
cleanWarning +
|
|
151
|
-
|
|
153
|
+
nonCleanFPOnlyWarning;
|
|
152
154
|
return {
|
|
153
155
|
judgePrefix: prefix,
|
|
154
156
|
amendment,
|
|
@@ -167,11 +169,12 @@ export function formatAmendmentSection(amendments) {
|
|
|
167
169
|
if (amendments.length === 0)
|
|
168
170
|
return "";
|
|
169
171
|
const lines = [
|
|
170
|
-
"## Precision
|
|
172
|
+
"## Precision Calibration — Based on Empirical Benchmark Data",
|
|
171
173
|
"",
|
|
172
|
-
"The following judges have
|
|
173
|
-
"Apply
|
|
174
|
-
"
|
|
174
|
+
"The following judges have historically produced false positives on clean code. " +
|
|
175
|
+
"Apply the calibration guidance below to avoid repeating these errors. " +
|
|
176
|
+
"IMPORTANT: These calibrations target CLEAN CODE false positives only — " +
|
|
177
|
+
"continue detecting genuine issues in vulnerable code with full sensitivity.",
|
|
175
178
|
"",
|
|
176
179
|
];
|
|
177
180
|
for (const a of amendments) {
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"mimeType": "image/png"
|
|
17
17
|
}
|
|
18
18
|
],
|
|
19
|
-
"version": "3.127.
|
|
19
|
+
"version": "3.127.1",
|
|
20
20
|
"packages": [
|
|
21
21
|
{
|
|
22
22
|
"registryType": "npm",
|
|
23
23
|
"identifier": "@kevinrabun/judges",
|
|
24
|
-
"version": "3.127.
|
|
24
|
+
"version": "3.127.1",
|
|
25
25
|
"transport": {
|
|
26
26
|
"type": "stdio"
|
|
27
27
|
}
|