@kevinrabun/judges 3.23.10 → 3.23.13
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/CHANGELOG.md +82 -0
- package/dist/api.d.ts +3 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +3 -1
- package/dist/api.js.map +1 -1
- package/dist/ast/structural-parser.d.ts.map +1 -1
- package/dist/ast/structural-parser.js +148 -3
- package/dist/ast/structural-parser.js.map +1 -1
- package/dist/auto-tune.d.ts +147 -0
- package/dist/auto-tune.d.ts.map +1 -0
- package/dist/auto-tune.js +374 -0
- package/dist/auto-tune.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +7 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/auto-detect.js.map +1 -1
- package/dist/commands/benchmark-expanded-2.d.ts +13 -0
- package/dist/commands/benchmark-expanded-2.d.ts.map +1 -0
- package/dist/commands/benchmark-expanded-2.js +5531 -0
- package/dist/commands/benchmark-expanded-2.js.map +1 -0
- package/dist/commands/benchmark-expanded.d.ts +13 -0
- package/dist/commands/benchmark-expanded.d.ts.map +1 -0
- package/dist/commands/benchmark-expanded.js +2600 -0
- package/dist/commands/benchmark-expanded.js.map +1 -0
- package/dist/commands/benchmark.d.ts +1 -0
- package/dist/commands/benchmark.d.ts.map +1 -1
- package/dist/commands/benchmark.js +176 -3
- package/dist/commands/benchmark.js.map +1 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +13 -0
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/lsp.d.ts.map +1 -1
- package/dist/commands/lsp.js.map +1 -1
- package/dist/commands/review.d.ts +8 -0
- package/dist/commands/review.d.ts.map +1 -1
- package/dist/commands/review.js +175 -13
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/tune.js.map +1 -1
- package/dist/dedup.d.ts.map +1 -1
- package/dist/dedup.js +24 -2
- package/dist/dedup.js.map +1 -1
- package/dist/disk-cache.js.map +1 -1
- package/dist/evaluators/accessibility.d.ts.map +1 -1
- package/dist/evaluators/accessibility.js +18 -4
- package/dist/evaluators/accessibility.js.map +1 -1
- package/dist/evaluators/agent-instructions.d.ts.map +1 -1
- package/dist/evaluators/agent-instructions.js +52 -1
- package/dist/evaluators/agent-instructions.js.map +1 -1
- package/dist/evaluators/authentication.d.ts.map +1 -1
- package/dist/evaluators/authentication.js +51 -2
- package/dist/evaluators/authentication.js.map +1 -1
- package/dist/evaluators/caching.d.ts.map +1 -1
- package/dist/evaluators/caching.js +5 -4
- package/dist/evaluators/caching.js.map +1 -1
- package/dist/evaluators/ci-cd.d.ts.map +1 -1
- package/dist/evaluators/ci-cd.js +23 -0
- package/dist/evaluators/ci-cd.js.map +1 -1
- package/dist/evaluators/compliance.d.ts.map +1 -1
- package/dist/evaluators/compliance.js +5 -1
- package/dist/evaluators/compliance.js.map +1 -1
- package/dist/evaluators/concurrency.d.ts.map +1 -1
- package/dist/evaluators/concurrency.js +34 -0
- package/dist/evaluators/concurrency.js.map +1 -1
- package/dist/evaluators/cybersecurity.d.ts.map +1 -1
- package/dist/evaluators/cybersecurity.js +231 -0
- package/dist/evaluators/cybersecurity.js.map +1 -1
- package/dist/evaluators/false-positive-review.js +25 -20
- package/dist/evaluators/false-positive-review.js.map +1 -1
- package/dist/evaluators/hallucination-detection.d.ts +3 -0
- package/dist/evaluators/hallucination-detection.d.ts.map +1 -0
- package/dist/evaluators/hallucination-detection.js +463 -0
- package/dist/evaluators/hallucination-detection.js.map +1 -0
- package/dist/evaluators/iac-security.d.ts.map +1 -1
- package/dist/evaluators/iac-security.js +18 -1
- package/dist/evaluators/iac-security.js.map +1 -1
- package/dist/evaluators/index.d.ts.map +1 -1
- package/dist/evaluators/index.js +18 -6
- package/dist/evaluators/index.js.map +1 -1
- package/dist/evaluators/maintainability.d.ts.map +1 -1
- package/dist/evaluators/maintainability.js +46 -0
- package/dist/evaluators/maintainability.js.map +1 -1
- package/dist/evaluators/observability.d.ts.map +1 -1
- package/dist/evaluators/observability.js +19 -1
- package/dist/evaluators/observability.js.map +1 -1
- package/dist/evaluators/reliability.d.ts.map +1 -1
- package/dist/evaluators/reliability.js +17 -1
- package/dist/evaluators/reliability.js.map +1 -1
- package/dist/evaluators/scalability.js +1 -1
- package/dist/evaluators/scalability.js.map +1 -1
- package/dist/evaluators/security.d.ts +13 -0
- package/dist/evaluators/security.d.ts.map +1 -0
- package/dist/evaluators/security.js +529 -0
- package/dist/evaluators/security.js.map +1 -0
- package/dist/evaluators/shared.d.ts.map +1 -1
- package/dist/evaluators/shared.js +15 -3
- package/dist/evaluators/shared.js.map +1 -1
- package/dist/evaluators/software-practices.d.ts.map +1 -1
- package/dist/evaluators/software-practices.js +20 -0
- package/dist/evaluators/software-practices.js.map +1 -1
- package/dist/evaluators/testing.d.ts.map +1 -1
- package/dist/evaluators/testing.js +3 -3
- package/dist/evaluators/testing.js.map +1 -1
- package/dist/evaluators/ux.d.ts.map +1 -1
- package/dist/evaluators/ux.js +10 -2
- package/dist/evaluators/ux.js.map +1 -1
- package/dist/github-app.d.ts +96 -0
- package/dist/github-app.d.ts.map +1 -0
- package/dist/github-app.js +541 -0
- package/dist/github-app.js.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/judges/hallucination-detection.d.ts +3 -0
- package/dist/judges/hallucination-detection.d.ts.map +1 -0
- package/dist/judges/hallucination-detection.js +30 -0
- package/dist/judges/hallucination-detection.js.map +1 -0
- package/dist/judges/index.d.ts.map +1 -1
- package/dist/judges/index.js +8 -0
- package/dist/judges/index.js.map +1 -1
- package/dist/judges/security.d.ts +3 -0
- package/dist/judges/security.d.ts.map +1 -0
- package/dist/judges/security.js +28 -0
- package/dist/judges/security.js.map +1 -0
- package/dist/language-patterns.d.ts.map +1 -1
- package/dist/language-patterns.js +12 -4
- package/dist/language-patterns.js.map +1 -1
- package/dist/patches/index.d.ts.map +1 -1
- package/dist/patches/index.js +501 -0
- package/dist/patches/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-Tuning Engine
|
|
3
|
+
*
|
|
4
|
+
* Extends the confidence calibration system with:
|
|
5
|
+
*
|
|
6
|
+
* 1. **Time-Decay Weighting** — Recent feedback counts more than old feedback.
|
|
7
|
+
* A half-life of 30 days means feedback from 30 days ago counts 50%.
|
|
8
|
+
*
|
|
9
|
+
* 2. **Auto-Suppression** — Rules with FP rate ≥ 80% (after sufficient
|
|
10
|
+
* samples) are automatically suppressed entirely.
|
|
11
|
+
*
|
|
12
|
+
* 3. **Severity Auto-Downgrade** — Rules with moderate FP rates (50–80%)
|
|
13
|
+
* are downgraded by one severity level (critical→high, high→medium, etc.).
|
|
14
|
+
*
|
|
15
|
+
* 4. **Adaptive Thresholds** — As feedback volume grows, the calibration
|
|
16
|
+
* system becomes more aggressive (lower minSamples, tighter thresholds).
|
|
17
|
+
*
|
|
18
|
+
* 5. **Tuning Report** — `judges feedback tune` shows recommended actions.
|
|
19
|
+
*
|
|
20
|
+
* Used by the evaluation pipeline when `--calibrate` is enabled, and by the
|
|
21
|
+
* `judges feedback tune` subcommand for interactive tuning guidance.
|
|
22
|
+
*/
|
|
23
|
+
import type { Finding, Severity } from "./types.js";
|
|
24
|
+
import type { FeedbackStore } from "./commands/feedback.js";
|
|
25
|
+
export interface AutoTuneOptions {
|
|
26
|
+
/** FP rate threshold for auto-suppression (default: 0.8 = 80%) */
|
|
27
|
+
suppressionThreshold?: number;
|
|
28
|
+
/** FP rate threshold for severity downgrade (default: 0.5 = 50%) */
|
|
29
|
+
downgradeThreshold?: number;
|
|
30
|
+
/** Half-life in days for time-decay weighting (default: 30) */
|
|
31
|
+
halfLifeDays?: number;
|
|
32
|
+
/** Minimum samples before any auto-tuning applies (default: 5) */
|
|
33
|
+
minSamples?: number;
|
|
34
|
+
/** Enable time-decay weighting (default: true) */
|
|
35
|
+
enableDecay?: boolean;
|
|
36
|
+
/** Maximum number of rules to auto-suppress (safety cap, default: 20) */
|
|
37
|
+
maxSuppressed?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface AutoTuneAction {
|
|
40
|
+
/** The rule ID affected */
|
|
41
|
+
ruleId: string;
|
|
42
|
+
/** The action recommended */
|
|
43
|
+
action: "suppress" | "downgrade" | "boost" | "monitor";
|
|
44
|
+
/** Human-readable reason */
|
|
45
|
+
reason: string;
|
|
46
|
+
/** FP rate (time-decay weighted if enabled) */
|
|
47
|
+
fpRate: number;
|
|
48
|
+
/** Number of feedback entries for this rule */
|
|
49
|
+
sampleCount: number;
|
|
50
|
+
/** New severity if action is "downgrade" */
|
|
51
|
+
newSeverity?: Severity;
|
|
52
|
+
/** Current (most-common) severity */
|
|
53
|
+
currentSeverity?: Severity;
|
|
54
|
+
/** Confidence adjustment amount (for boost actions) */
|
|
55
|
+
confidenceAdjustment?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface AutoTuneReport {
|
|
58
|
+
/** Timestamp of the report */
|
|
59
|
+
timestamp: string;
|
|
60
|
+
/** Total feedback entries analyzed */
|
|
61
|
+
totalFeedback: number;
|
|
62
|
+
/** Time-decay enabled */
|
|
63
|
+
decayEnabled: boolean;
|
|
64
|
+
/** Rules recommended for auto-suppression */
|
|
65
|
+
suppressions: AutoTuneAction[];
|
|
66
|
+
/** Rules recommended for severity downgrade */
|
|
67
|
+
downgrades: AutoTuneAction[];
|
|
68
|
+
/** Rules with proven high TP rate (boosted confidence) */
|
|
69
|
+
boosts: AutoTuneAction[];
|
|
70
|
+
/** Rules being monitored (approaching a threshold) */
|
|
71
|
+
monitored: AutoTuneAction[];
|
|
72
|
+
/** Rules auto-suppressed (applied, not just recommended) */
|
|
73
|
+
appliedSuppressions: string[];
|
|
74
|
+
/** Summary statistics */
|
|
75
|
+
summary: {
|
|
76
|
+
totalRulesAnalyzed: number;
|
|
77
|
+
suppressed: number;
|
|
78
|
+
downgraded: number;
|
|
79
|
+
boosted: number;
|
|
80
|
+
monitored: number;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface DecayWeightedStats {
|
|
84
|
+
ruleId: string;
|
|
85
|
+
/** Time-decay weighted FP rate */
|
|
86
|
+
weightedFpRate: number;
|
|
87
|
+
/** Raw (unweighted) FP rate */
|
|
88
|
+
rawFpRate: number;
|
|
89
|
+
/** Total weighted samples */
|
|
90
|
+
weightedTotal: number;
|
|
91
|
+
/** Raw total */
|
|
92
|
+
rawTotal: number;
|
|
93
|
+
/** Feedback trend direction */
|
|
94
|
+
trend: "improving" | "worsening" | "stable";
|
|
95
|
+
/** Most-common severity seen */
|
|
96
|
+
commonSeverity?: Severity;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Compute exponential decay weight for a feedback entry based on its age.
|
|
100
|
+
*
|
|
101
|
+
* weight = 0.5 ^ (ageDays / halfLifeDays)
|
|
102
|
+
*
|
|
103
|
+
* - Entry from today: weight ≈ 1.0
|
|
104
|
+
* - Entry from halfLifeDays ago: weight = 0.5
|
|
105
|
+
* - Entry from 2× halfLifeDays ago: weight = 0.25
|
|
106
|
+
*/
|
|
107
|
+
export declare function computeDecayWeight(entryTimestamp: string, now: Date, halfLifeDays: number): number;
|
|
108
|
+
/**
|
|
109
|
+
* Compute time-decay weighted FP rates per rule.
|
|
110
|
+
*/
|
|
111
|
+
export declare function computeDecayWeightedStats(store: FeedbackStore, options?: AutoTuneOptions): Map<string, DecayWeightedStats>;
|
|
112
|
+
/**
|
|
113
|
+
* Downgrade a severity by one level.
|
|
114
|
+
*/
|
|
115
|
+
export declare function downgradeSeverity(severity: Severity): Severity;
|
|
116
|
+
/**
|
|
117
|
+
* Generate an auto-tune report from accumulated feedback data.
|
|
118
|
+
*
|
|
119
|
+
* This analyzes the feedback store with time-decay weighting and produces
|
|
120
|
+
* a report of recommended actions: suppressions, downgrades, boosts, and
|
|
121
|
+
* rules to monitor.
|
|
122
|
+
*/
|
|
123
|
+
export declare function generateAutoTuneReport(store: FeedbackStore, options?: AutoTuneOptions): AutoTuneReport;
|
|
124
|
+
/**
|
|
125
|
+
* Apply auto-tune adjustments to a list of findings:
|
|
126
|
+
*
|
|
127
|
+
* 1. Suppress findings whose rules are auto-suppressed
|
|
128
|
+
* 2. Downgrade severity for rules with moderate FP rates
|
|
129
|
+
* 3. Apply confidence calibration (via existing calibration engine)
|
|
130
|
+
*
|
|
131
|
+
* Returns the filtered and adjusted findings plus suppression count.
|
|
132
|
+
*/
|
|
133
|
+
export declare function applyAutoTune(findings: Finding[], store: FeedbackStore, options?: AutoTuneOptions): {
|
|
134
|
+
findings: Finding[];
|
|
135
|
+
suppressed: number;
|
|
136
|
+
downgraded: number;
|
|
137
|
+
report: AutoTuneReport;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Format an auto-tune report as a human-readable string.
|
|
141
|
+
*/
|
|
142
|
+
export declare function formatAutoTuneReport(report: AutoTuneReport): string;
|
|
143
|
+
/**
|
|
144
|
+
* Format auto-tune report as JSON.
|
|
145
|
+
*/
|
|
146
|
+
export declare function formatAutoTuneReportJson(report: AutoTuneReport): string;
|
|
147
|
+
//# sourceMappingURL=auto-tune.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-tune.d.ts","sourceRoot":"","sources":["../src/auto-tune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,wBAAwB,CAAC;AAM3E,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC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G;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CASvE"}
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-Tuning Engine
|
|
3
|
+
*
|
|
4
|
+
* Extends the confidence calibration system with:
|
|
5
|
+
*
|
|
6
|
+
* 1. **Time-Decay Weighting** — Recent feedback counts more than old feedback.
|
|
7
|
+
* A half-life of 30 days means feedback from 30 days ago counts 50%.
|
|
8
|
+
*
|
|
9
|
+
* 2. **Auto-Suppression** — Rules with FP rate ≥ 80% (after sufficient
|
|
10
|
+
* samples) are automatically suppressed entirely.
|
|
11
|
+
*
|
|
12
|
+
* 3. **Severity Auto-Downgrade** — Rules with moderate FP rates (50–80%)
|
|
13
|
+
* are downgraded by one severity level (critical→high, high→medium, etc.).
|
|
14
|
+
*
|
|
15
|
+
* 4. **Adaptive Thresholds** — As feedback volume grows, the calibration
|
|
16
|
+
* system becomes more aggressive (lower minSamples, tighter thresholds).
|
|
17
|
+
*
|
|
18
|
+
* 5. **Tuning Report** — `judges feedback tune` shows recommended actions.
|
|
19
|
+
*
|
|
20
|
+
* Used by the evaluation pipeline when `--calibrate` is enabled, and by the
|
|
21
|
+
* `judges feedback tune` subcommand for interactive tuning guidance.
|
|
22
|
+
*/
|
|
23
|
+
import { computeFeedbackStats } from "./commands/feedback.js";
|
|
24
|
+
import { buildCalibrationProfile, calibrateFindings } from "./calibration.js";
|
|
25
|
+
// ─── Constants ──────────────────────────────────────────────────────────────
|
|
26
|
+
const DEFAULT_SUPPRESSION_THRESHOLD = 0.8;
|
|
27
|
+
const DEFAULT_DOWNGRADE_THRESHOLD = 0.5;
|
|
28
|
+
const DEFAULT_HALF_LIFE_DAYS = 30;
|
|
29
|
+
const DEFAULT_MIN_SAMPLES = 5;
|
|
30
|
+
const DEFAULT_MAX_SUPPRESSED = 20;
|
|
31
|
+
const SEVERITY_ORDER = ["critical", "high", "medium", "low", "info"];
|
|
32
|
+
// ─── Time-Decay Weighting ───────────────────────────────────────────────────
|
|
33
|
+
/**
|
|
34
|
+
* Compute exponential decay weight for a feedback entry based on its age.
|
|
35
|
+
*
|
|
36
|
+
* weight = 0.5 ^ (ageDays / halfLifeDays)
|
|
37
|
+
*
|
|
38
|
+
* - Entry from today: weight ≈ 1.0
|
|
39
|
+
* - Entry from halfLifeDays ago: weight = 0.5
|
|
40
|
+
* - Entry from 2× halfLifeDays ago: weight = 0.25
|
|
41
|
+
*/
|
|
42
|
+
export function computeDecayWeight(entryTimestamp, now, halfLifeDays) {
|
|
43
|
+
const entryDate = new Date(entryTimestamp);
|
|
44
|
+
const ageDays = (now.getTime() - entryDate.getTime()) / (1000 * 60 * 60 * 24);
|
|
45
|
+
if (ageDays <= 0)
|
|
46
|
+
return 1.0;
|
|
47
|
+
return Math.pow(0.5, ageDays / halfLifeDays);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Compute time-decay weighted FP rates per rule.
|
|
51
|
+
*/
|
|
52
|
+
export function computeDecayWeightedStats(store, options) {
|
|
53
|
+
const halfLife = options?.halfLifeDays ?? DEFAULT_HALF_LIFE_DAYS;
|
|
54
|
+
const now = new Date();
|
|
55
|
+
// Group by rule
|
|
56
|
+
const byRule = new Map();
|
|
57
|
+
for (const entry of store.entries) {
|
|
58
|
+
const entries = byRule.get(entry.ruleId) ?? [];
|
|
59
|
+
entries.push(entry);
|
|
60
|
+
byRule.set(entry.ruleId, entries);
|
|
61
|
+
}
|
|
62
|
+
const result = new Map();
|
|
63
|
+
for (const [ruleId, entries] of byRule) {
|
|
64
|
+
let weightedFp = 0;
|
|
65
|
+
let weightedTotal = 0;
|
|
66
|
+
let rawFp = 0;
|
|
67
|
+
const severityCounts = {};
|
|
68
|
+
// Split entries into recent half and older half for trend detection
|
|
69
|
+
const sorted = [...entries].sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
|
|
70
|
+
const midpoint = Math.floor(sorted.length / 2);
|
|
71
|
+
let olderFpRate = 0;
|
|
72
|
+
let recentFpRate = 0;
|
|
73
|
+
if (sorted.length >= 4) {
|
|
74
|
+
const older = sorted.slice(0, midpoint);
|
|
75
|
+
const recent = sorted.slice(midpoint);
|
|
76
|
+
const olderFp = older.filter((e) => e.verdict === "fp").length;
|
|
77
|
+
const recentFp = recent.filter((e) => e.verdict === "fp").length;
|
|
78
|
+
olderFpRate = older.length > 0 ? olderFp / older.length : 0;
|
|
79
|
+
recentFpRate = recent.length > 0 ? recentFp / recent.length : 0;
|
|
80
|
+
}
|
|
81
|
+
for (const entry of entries) {
|
|
82
|
+
const weight = computeDecayWeight(entry.timestamp, now, halfLife);
|
|
83
|
+
weightedTotal += weight;
|
|
84
|
+
if (entry.verdict === "fp") {
|
|
85
|
+
weightedFp += weight;
|
|
86
|
+
rawFp++;
|
|
87
|
+
}
|
|
88
|
+
if (entry.severity) {
|
|
89
|
+
severityCounts[entry.severity] = (severityCounts[entry.severity] ?? 0) + 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const weightedFpRate = weightedTotal > 0 ? weightedFp / weightedTotal : 0;
|
|
93
|
+
const rawFpRate = entries.length > 0 ? rawFp / entries.length : 0;
|
|
94
|
+
// Determine trend
|
|
95
|
+
let trend = "stable";
|
|
96
|
+
if (sorted.length >= 4) {
|
|
97
|
+
const delta = recentFpRate - olderFpRate;
|
|
98
|
+
if (delta < -0.1)
|
|
99
|
+
trend = "improving";
|
|
100
|
+
else if (delta > 0.1)
|
|
101
|
+
trend = "worsening";
|
|
102
|
+
}
|
|
103
|
+
// Find most common severity
|
|
104
|
+
let commonSeverity;
|
|
105
|
+
let maxCount = 0;
|
|
106
|
+
for (const [sev, count] of Object.entries(severityCounts)) {
|
|
107
|
+
if (count > maxCount) {
|
|
108
|
+
maxCount = count;
|
|
109
|
+
commonSeverity = sev;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
result.set(ruleId, {
|
|
113
|
+
ruleId,
|
|
114
|
+
weightedFpRate,
|
|
115
|
+
rawFpRate,
|
|
116
|
+
weightedTotal,
|
|
117
|
+
rawTotal: entries.length,
|
|
118
|
+
trend,
|
|
119
|
+
commonSeverity,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
// ─── Severity Downgrade ─────────────────────────────────────────────────────
|
|
125
|
+
/**
|
|
126
|
+
* Downgrade a severity by one level.
|
|
127
|
+
*/
|
|
128
|
+
export function downgradeSeverity(severity) {
|
|
129
|
+
const idx = SEVERITY_ORDER.indexOf(severity);
|
|
130
|
+
if (idx < 0 || idx >= SEVERITY_ORDER.length - 1)
|
|
131
|
+
return severity;
|
|
132
|
+
return SEVERITY_ORDER[idx + 1];
|
|
133
|
+
}
|
|
134
|
+
// ─── Auto-Tune Engine ───────────────────────────────────────────────────────
|
|
135
|
+
/**
|
|
136
|
+
* Generate an auto-tune report from accumulated feedback data.
|
|
137
|
+
*
|
|
138
|
+
* This analyzes the feedback store with time-decay weighting and produces
|
|
139
|
+
* a report of recommended actions: suppressions, downgrades, boosts, and
|
|
140
|
+
* rules to monitor.
|
|
141
|
+
*/
|
|
142
|
+
export function generateAutoTuneReport(store, options) {
|
|
143
|
+
const suppressionThreshold = options?.suppressionThreshold ?? DEFAULT_SUPPRESSION_THRESHOLD;
|
|
144
|
+
const downgradeThreshold = options?.downgradeThreshold ?? DEFAULT_DOWNGRADE_THRESHOLD;
|
|
145
|
+
const minSamples = options?.minSamples ?? DEFAULT_MIN_SAMPLES;
|
|
146
|
+
const maxSuppressed = options?.maxSuppressed ?? DEFAULT_MAX_SUPPRESSED;
|
|
147
|
+
const enableDecay = options?.enableDecay !== false;
|
|
148
|
+
const suppressions = [];
|
|
149
|
+
const downgrades = [];
|
|
150
|
+
const boosts = [];
|
|
151
|
+
const monitored = [];
|
|
152
|
+
// Compute stats (with or without decay)
|
|
153
|
+
const decayStats = enableDecay ? computeDecayWeightedStats(store, options) : null;
|
|
154
|
+
const rawStats = computeFeedbackStats(store);
|
|
155
|
+
for (const [ruleId, ruleStats] of rawStats.perRule) {
|
|
156
|
+
const sampleCount = ruleStats.total;
|
|
157
|
+
if (sampleCount < minSamples)
|
|
158
|
+
continue;
|
|
159
|
+
// Use decay-weighted rate if available, else raw
|
|
160
|
+
const ds = decayStats?.get(ruleId);
|
|
161
|
+
const effectiveFpRate = ds ? ds.weightedFpRate : ruleStats.fpRate;
|
|
162
|
+
const trend = ds?.trend ?? "stable";
|
|
163
|
+
const commonSeverity = ds?.commonSeverity;
|
|
164
|
+
// Auto-suppress: FP rate ≥ suppressionThreshold
|
|
165
|
+
if (effectiveFpRate >= suppressionThreshold) {
|
|
166
|
+
suppressions.push({
|
|
167
|
+
ruleId,
|
|
168
|
+
action: "suppress",
|
|
169
|
+
reason: `FP rate ${(effectiveFpRate * 100).toFixed(0)}% (≥ ${(suppressionThreshold * 100).toFixed(0)}% threshold) with ${sampleCount} samples${trend === "improving" ? " — trending ↓ improving" : trend === "worsening" ? " — trending ↑ worsening" : ""}`,
|
|
170
|
+
fpRate: effectiveFpRate,
|
|
171
|
+
sampleCount,
|
|
172
|
+
currentSeverity: commonSeverity,
|
|
173
|
+
});
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
// Auto-downgrade: FP rate ≥ downgradeThreshold
|
|
177
|
+
if (effectiveFpRate >= downgradeThreshold && commonSeverity) {
|
|
178
|
+
const newSev = downgradeSeverity(commonSeverity);
|
|
179
|
+
if (newSev !== commonSeverity) {
|
|
180
|
+
downgrades.push({
|
|
181
|
+
ruleId,
|
|
182
|
+
action: "downgrade",
|
|
183
|
+
reason: `FP rate ${(effectiveFpRate * 100).toFixed(0)}% (≥ ${(downgradeThreshold * 100).toFixed(0)}% threshold) — downgrade ${commonSeverity} → ${newSev}`,
|
|
184
|
+
fpRate: effectiveFpRate,
|
|
185
|
+
sampleCount,
|
|
186
|
+
currentSeverity: commonSeverity,
|
|
187
|
+
newSeverity: newSev,
|
|
188
|
+
});
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// Boost: FP rate < 15% with enough data → high confidence rule
|
|
193
|
+
if (effectiveFpRate < 0.15 && sampleCount >= minSamples) {
|
|
194
|
+
const adjustment = 0.15 * ((0.15 - effectiveFpRate) / 0.15);
|
|
195
|
+
boosts.push({
|
|
196
|
+
ruleId,
|
|
197
|
+
action: "boost",
|
|
198
|
+
reason: `FP rate ${(effectiveFpRate * 100).toFixed(0)}% — proven high-TP rule, confidence boosted by +${(adjustment * 100).toFixed(0)}%`,
|
|
199
|
+
fpRate: effectiveFpRate,
|
|
200
|
+
sampleCount,
|
|
201
|
+
currentSeverity: commonSeverity,
|
|
202
|
+
confidenceAdjustment: adjustment,
|
|
203
|
+
});
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
// Monitor: FP rate between 35–50% (approaching downgrade threshold)
|
|
207
|
+
if (effectiveFpRate >= 0.35 && effectiveFpRate < downgradeThreshold) {
|
|
208
|
+
monitored.push({
|
|
209
|
+
ruleId,
|
|
210
|
+
action: "monitor",
|
|
211
|
+
reason: `FP rate ${(effectiveFpRate * 100).toFixed(0)}% — approaching downgrade threshold${trend === "worsening" ? " ⚠ trending up" : ""}`,
|
|
212
|
+
fpRate: effectiveFpRate,
|
|
213
|
+
sampleCount,
|
|
214
|
+
currentSeverity: commonSeverity,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// Sort suppressions by FP rate descending and cap
|
|
219
|
+
suppressions.sort((a, b) => b.fpRate - a.fpRate);
|
|
220
|
+
const appliedSuppressions = suppressions.slice(0, maxSuppressed).map((s) => s.ruleId);
|
|
221
|
+
return {
|
|
222
|
+
timestamp: new Date().toISOString(),
|
|
223
|
+
totalFeedback: store.entries.length,
|
|
224
|
+
decayEnabled: enableDecay,
|
|
225
|
+
suppressions,
|
|
226
|
+
downgrades,
|
|
227
|
+
boosts,
|
|
228
|
+
monitored,
|
|
229
|
+
appliedSuppressions,
|
|
230
|
+
summary: {
|
|
231
|
+
totalRulesAnalyzed: rawStats.perRule.size,
|
|
232
|
+
suppressed: suppressions.length,
|
|
233
|
+
downgraded: downgrades.length,
|
|
234
|
+
boosted: boosts.length,
|
|
235
|
+
monitored: monitored.length,
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
// ─── Apply Auto-Tune to Findings ────────────────────────────────────────────
|
|
240
|
+
/**
|
|
241
|
+
* Apply auto-tune adjustments to a list of findings:
|
|
242
|
+
*
|
|
243
|
+
* 1. Suppress findings whose rules are auto-suppressed
|
|
244
|
+
* 2. Downgrade severity for rules with moderate FP rates
|
|
245
|
+
* 3. Apply confidence calibration (via existing calibration engine)
|
|
246
|
+
*
|
|
247
|
+
* Returns the filtered and adjusted findings plus suppression count.
|
|
248
|
+
*/
|
|
249
|
+
export function applyAutoTune(findings, store, options) {
|
|
250
|
+
const report = generateAutoTuneReport(store, options);
|
|
251
|
+
const suppressedSet = new Set(report.appliedSuppressions);
|
|
252
|
+
const downgradeMap = new Map();
|
|
253
|
+
for (const d of report.downgrades) {
|
|
254
|
+
if (d.newSeverity)
|
|
255
|
+
downgradeMap.set(d.ruleId, d.newSeverity);
|
|
256
|
+
}
|
|
257
|
+
let suppressed = 0;
|
|
258
|
+
let downgraded = 0;
|
|
259
|
+
// Step 1: Suppress and downgrade
|
|
260
|
+
let adjusted = findings.filter((f) => {
|
|
261
|
+
if (suppressedSet.has(f.ruleId)) {
|
|
262
|
+
suppressed++;
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
return true;
|
|
266
|
+
});
|
|
267
|
+
adjusted = adjusted.map((f) => {
|
|
268
|
+
const newSev = downgradeMap.get(f.ruleId);
|
|
269
|
+
if (newSev && f.severity !== newSev) {
|
|
270
|
+
downgraded++;
|
|
271
|
+
return {
|
|
272
|
+
...f,
|
|
273
|
+
severity: newSev,
|
|
274
|
+
provenance: f.provenance ? `${f.provenance}, auto-tuned-downgrade` : "auto-tuned-downgrade",
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
return f;
|
|
278
|
+
});
|
|
279
|
+
// Step 2: Apply confidence calibration
|
|
280
|
+
const profile = buildCalibrationProfile(store);
|
|
281
|
+
if (profile.isActive) {
|
|
282
|
+
adjusted = calibrateFindings(adjusted, profile);
|
|
283
|
+
}
|
|
284
|
+
return { findings: adjusted, suppressed, downgraded, report };
|
|
285
|
+
}
|
|
286
|
+
// ─── Formatting ─────────────────────────────────────────────────────────────
|
|
287
|
+
/**
|
|
288
|
+
* Format an auto-tune report as a human-readable string.
|
|
289
|
+
*/
|
|
290
|
+
export function formatAutoTuneReport(report) {
|
|
291
|
+
const lines = [];
|
|
292
|
+
lines.push("╔══════════════════════════════════════════════════════════════╗");
|
|
293
|
+
lines.push("║ Judges Panel — Auto-Tune Report ║");
|
|
294
|
+
lines.push("╚══════════════════════════════════════════════════════════════╝");
|
|
295
|
+
lines.push("");
|
|
296
|
+
lines.push(` Feedback entries : ${report.totalFeedback}`);
|
|
297
|
+
lines.push(` Rules analyzed : ${report.summary.totalRulesAnalyzed}`);
|
|
298
|
+
lines.push(` Time-decay : ${report.decayEnabled ? "enabled (30-day half-life)" : "disabled"}`);
|
|
299
|
+
lines.push("");
|
|
300
|
+
// Suppressions
|
|
301
|
+
if (report.suppressions.length > 0) {
|
|
302
|
+
lines.push(" 🔇 Auto-Suppressed Rules (FP rate ≥ 80%):");
|
|
303
|
+
lines.push(" " + "─".repeat(55));
|
|
304
|
+
for (const s of report.suppressions) {
|
|
305
|
+
const rate = `${(s.fpRate * 100).toFixed(0)}%`.padStart(5);
|
|
306
|
+
lines.push(` ${s.ruleId.padEnd(14)} FP: ${rate} (${s.sampleCount} samples) ${s.reason.includes("trending") ? (s.reason.split("—")[1]?.trim() ?? "") : ""}`);
|
|
307
|
+
}
|
|
308
|
+
lines.push("");
|
|
309
|
+
}
|
|
310
|
+
// Downgrades
|
|
311
|
+
if (report.downgrades.length > 0) {
|
|
312
|
+
lines.push(" 📉 Severity Downgrades (FP rate 50–80%):");
|
|
313
|
+
lines.push(" " + "─".repeat(55));
|
|
314
|
+
for (const d of report.downgrades) {
|
|
315
|
+
const rate = `${(d.fpRate * 100).toFixed(0)}%`.padStart(5);
|
|
316
|
+
lines.push(` ${d.ruleId.padEnd(14)} FP: ${rate} ${d.currentSeverity} → ${d.newSeverity}`);
|
|
317
|
+
}
|
|
318
|
+
lines.push("");
|
|
319
|
+
}
|
|
320
|
+
// Boosts
|
|
321
|
+
if (report.boosts.length > 0) {
|
|
322
|
+
lines.push(" 📈 Confidence Boosts (FP rate < 15%):");
|
|
323
|
+
lines.push(" " + "─".repeat(55));
|
|
324
|
+
for (const b of report.boosts) {
|
|
325
|
+
const rate = `${(b.fpRate * 100).toFixed(0)}%`.padStart(5);
|
|
326
|
+
const adj = b.confidenceAdjustment ? `+${(b.confidenceAdjustment * 100).toFixed(0)}%` : "";
|
|
327
|
+
lines.push(` ${b.ruleId.padEnd(14)} FP: ${rate} confidence ${adj} (${b.sampleCount} samples)`);
|
|
328
|
+
}
|
|
329
|
+
lines.push("");
|
|
330
|
+
}
|
|
331
|
+
// Monitored
|
|
332
|
+
if (report.monitored.length > 0) {
|
|
333
|
+
lines.push(" 👁️ Monitored Rules (FP rate 35–50%, approaching threshold):");
|
|
334
|
+
lines.push(" " + "─".repeat(55));
|
|
335
|
+
for (const m of report.monitored) {
|
|
336
|
+
const rate = `${(m.fpRate * 100).toFixed(0)}%`.padStart(5);
|
|
337
|
+
const badge = m.reason.includes("trending up") ? " ⚠" : "";
|
|
338
|
+
lines.push(` ${m.ruleId.padEnd(14)} FP: ${rate} (${m.sampleCount} samples)${badge}`);
|
|
339
|
+
}
|
|
340
|
+
lines.push("");
|
|
341
|
+
}
|
|
342
|
+
// Summary
|
|
343
|
+
if (report.suppressions.length === 0 &&
|
|
344
|
+
report.downgrades.length === 0 &&
|
|
345
|
+
report.boosts.length === 0 &&
|
|
346
|
+
report.monitored.length === 0) {
|
|
347
|
+
lines.push(" ✅ No tuning actions needed — all rules within healthy FP rates.");
|
|
348
|
+
lines.push("");
|
|
349
|
+
}
|
|
350
|
+
// Config suggestion
|
|
351
|
+
if (report.appliedSuppressions.length > 0) {
|
|
352
|
+
lines.push(" 📄 Suggested .judgesrc.json additions:");
|
|
353
|
+
lines.push("");
|
|
354
|
+
const cfg = {
|
|
355
|
+
disabledRules: report.appliedSuppressions,
|
|
356
|
+
ruleOverrides: Object.fromEntries(report.downgrades.map((d) => [d.ruleId, { severity: d.newSeverity }])),
|
|
357
|
+
};
|
|
358
|
+
for (const line of JSON.stringify(cfg, null, 2).split("\n")) {
|
|
359
|
+
lines.push(` ${line}`);
|
|
360
|
+
}
|
|
361
|
+
lines.push("");
|
|
362
|
+
}
|
|
363
|
+
return lines.join("\n");
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Format auto-tune report as JSON.
|
|
367
|
+
*/
|
|
368
|
+
export function formatAutoTuneReportJson(report) {
|
|
369
|
+
return JSON.stringify({
|
|
370
|
+
...report,
|
|
371
|
+
summary: report.summary,
|
|
372
|
+
}, null, 2);
|
|
373
|
+
}
|
|
374
|
+
//# sourceMappingURL=auto-tune.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-tune.js","sourceRoot":"","sources":["../src/auto-tune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAiF9E,+EAA+E;AAE/E,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAC1C,MAAM,2BAA2B,GAAG,GAAG,CAAC;AACxC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,MAAM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IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAsB;IAC7D,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,GAAG,MAAM;QACT,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AA2YH;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAcnD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAQzE;AAiBD,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,MAAM,EAAE,CAiBnF;AAsOD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqe1D"}
|
package/dist/cli.js
CHANGED
|
@@ -230,6 +230,7 @@ USAGE:
|
|
|
230
230
|
judges config Export/import shared team configs
|
|
231
231
|
judges compare Compare judges vs other tools
|
|
232
232
|
judges review Post inline review comments on a GitHub PR
|
|
233
|
+
judges app serve Start GitHub App webhook server (zero-config PR reviews)
|
|
233
234
|
judges tune Analyze project and suggest optimal config
|
|
234
235
|
judges list List all available judges
|
|
235
236
|
judges version Show version information
|
|
@@ -746,6 +747,12 @@ export async function runCli(argv) {
|
|
|
746
747
|
await runReview(argv);
|
|
747
748
|
return;
|
|
748
749
|
}
|
|
750
|
+
// ─── App Command (GitHub App) ─────────────────────────────────────
|
|
751
|
+
if (args.command === "app") {
|
|
752
|
+
const { runAppCommand } = await import("./github-app.js");
|
|
753
|
+
runAppCommand(argv.slice(3));
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
749
756
|
// ─── Tune Command ─────────────────────────────────────────────────
|
|
750
757
|
if (args.command === "tune") {
|
|
751
758
|
const { runTune } = await import("./commands/tune.js");
|