@oddessentials/odd-ai-reviewers 1.7.4 → 1.9.0
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/agents/ai_semantic_review.d.ts.map +1 -1
- package/dist/agents/ai_semantic_review.js +7 -1
- package/dist/agents/ai_semantic_review.js.map +1 -1
- package/dist/agents/control_flow/safe-source-detector.d.ts +48 -0
- package/dist/agents/control_flow/safe-source-detector.d.ts.map +1 -0
- package/dist/agents/control_flow/safe-source-detector.js +434 -0
- package/dist/agents/control_flow/safe-source-detector.js.map +1 -0
- package/dist/agents/control_flow/safe-source-patterns.d.ts +61 -0
- package/dist/agents/control_flow/safe-source-patterns.d.ts.map +1 -0
- package/dist/agents/control_flow/safe-source-patterns.js +137 -0
- package/dist/agents/control_flow/safe-source-patterns.js.map +1 -0
- package/dist/agents/control_flow/scope-stack.d.ts +167 -0
- package/dist/agents/control_flow/scope-stack.d.ts.map +1 -0
- package/dist/agents/control_flow/scope-stack.js +448 -0
- package/dist/agents/control_flow/scope-stack.js.map +1 -0
- package/dist/agents/control_flow/vulnerability-detector.d.ts +13 -0
- package/dist/agents/control_flow/vulnerability-detector.d.ts.map +1 -1
- package/dist/agents/control_flow/vulnerability-detector.js +630 -35
- package/dist/agents/control_flow/vulnerability-detector.js.map +1 -1
- package/dist/agents/opencode.d.ts.map +1 -1
- package/dist/agents/opencode.js +7 -1
- package/dist/agents/opencode.js.map +1 -1
- package/dist/agents/pr_agent.d.ts.map +1 -1
- package/dist/agents/pr_agent.js +8 -2
- package/dist/agents/pr_agent.js.map +1 -1
- package/dist/agents/security.d.ts.map +1 -1
- package/dist/agents/security.js +1 -0
- package/dist/agents/security.js.map +1 -1
- package/dist/agents/types.d.ts +6 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/benchmark/adapter.d.ts +87 -0
- package/dist/benchmark/adapter.d.ts.map +1 -0
- package/dist/benchmark/adapter.js +298 -0
- package/dist/benchmark/adapter.js.map +1 -0
- package/dist/benchmark/scoring.d.ts +100 -0
- package/dist/benchmark/scoring.d.ts.map +1 -0
- package/dist/benchmark/scoring.js +195 -0
- package/dist/benchmark/scoring.js.map +1 -0
- package/dist/cli/dependencies/schemas.d.ts +3 -3
- package/dist/context-loader.d.ts +80 -0
- package/dist/context-loader.d.ts.map +1 -0
- package/dist/context-loader.js +202 -0
- package/dist/context-loader.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +131 -4
- package/dist/main.js.map +1 -1
- package/dist/phases/index.d.ts +1 -1
- package/dist/phases/index.d.ts.map +1 -1
- package/dist/phases/index.js +1 -1
- package/dist/phases/index.js.map +1 -1
- package/dist/phases/report.d.ts +8 -1
- package/dist/phases/report.d.ts.map +1 -1
- package/dist/phases/report.js +52 -5
- package/dist/phases/report.js.map +1 -1
- package/dist/report/ado.d.ts +2 -0
- package/dist/report/ado.d.ts.map +1 -1
- package/dist/report/ado.js +9 -23
- package/dist/report/ado.js.map +1 -1
- package/dist/report/finding-validator.d.ts +130 -0
- package/dist/report/finding-validator.d.ts.map +1 -0
- package/dist/report/finding-validator.js +347 -0
- package/dist/report/finding-validator.js.map +1 -0
- package/dist/report/framework-pattern-filter.d.ts +53 -0
- package/dist/report/framework-pattern-filter.d.ts.map +1 -0
- package/dist/report/framework-pattern-filter.js +189 -0
- package/dist/report/framework-pattern-filter.js.map +1 -0
- package/dist/report/github.d.ts +2 -0
- package/dist/report/github.d.ts.map +1 -1
- package/dist/report/github.js +9 -23
- package/dist/report/github.js.map +1 -1
- package/dist/trust.d.ts +6 -0
- package/dist/trust.d.ts.map +1 -1
- package/dist/trust.js +2 -0
- package/dist/trust.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding Validator Module
|
|
3
|
+
*
|
|
4
|
+
* Post-processing validation for findings before they are posted to platforms.
|
|
5
|
+
* Implements FR-011 (line validation), FR-012 (classification), FR-013 (self-contradiction),
|
|
6
|
+
* and FR-014 (validation summary).
|
|
7
|
+
*/
|
|
8
|
+
import { canonicalizeDiffFiles } from '../diff.js';
|
|
9
|
+
import { buildLineResolver, normalizeFindingsForDiff, computeDriftSignal, computeInlineDriftSignal, } from './line-resolver.js';
|
|
10
|
+
/**
|
|
11
|
+
* Patterns that indicate a finding is self-dismissing.
|
|
12
|
+
* When combined with info severity and no actionable suggestion,
|
|
13
|
+
* the finding is likely a false positive.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Strip zero-width and invisible Unicode characters that can bypass word-boundary regex matching.
|
|
17
|
+
* Only strips invisible characters — visible non-Latin characters are preserved.
|
|
18
|
+
*
|
|
19
|
+
* Characters stripped: U+200B (ZWSP), U+200C (ZWNJ), U+200D (ZWJ), U+200E (LRM),
|
|
20
|
+
* U+200F (RLM), U+2028 (Line Sep), U+2029 (Para Sep), U+FEFF (BOM/ZWNBS)
|
|
21
|
+
*/
|
|
22
|
+
export function normalizeUnicode(text) {
|
|
23
|
+
return text.replace(/[\u200B-\u200F\u2028\u2029\uFEFF]/g, '');
|
|
24
|
+
}
|
|
25
|
+
const DISMISSIVE_PATTERNS = [
|
|
26
|
+
/\bno action required\b/i,
|
|
27
|
+
/\bacceptable as[- ]is\b/i,
|
|
28
|
+
/\bnot blocking\b/i,
|
|
29
|
+
/\bno change needed\b/i,
|
|
30
|
+
/\bcan be ignored\b/i,
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* Check if a suggestion is actionable (contains concrete guidance beyond dismissive language).
|
|
34
|
+
*/
|
|
35
|
+
function hasActionableSuggestion(suggestion) {
|
|
36
|
+
if (!suggestion || suggestion.trim().length === 0) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
const trimmed = suggestion.trim();
|
|
40
|
+
const dismissiveFragments = DISMISSIVE_PATTERNS.map((pattern) => pattern.exec(trimmed)?.[0] ?? '').filter((fragment) => fragment.length > 0);
|
|
41
|
+
if (dismissiveFragments.length === 0) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
const residual = dismissiveFragments
|
|
45
|
+
.reduce((remaining, fragment) => remaining.replace(fragment, ' '), trimmed)
|
|
46
|
+
.replace(/[.,;:()-]/g, ' ')
|
|
47
|
+
.replace(/\s+/g, ' ')
|
|
48
|
+
.trim();
|
|
49
|
+
return residual.length > 0;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Regex to extract action signals from PR title/description.
|
|
53
|
+
* Captures a verb (add, fix, remove, rename, update, refactor) followed by a subject.
|
|
54
|
+
*/
|
|
55
|
+
const PR_INTENT_PATTERN = /\b(add|fix|remove|rename|update|refactor)\s+(.+)/i;
|
|
56
|
+
/**
|
|
57
|
+
* FR-014: Diagnostic PR intent contradiction logging.
|
|
58
|
+
*
|
|
59
|
+
* Extracts action signals from PR title/description and logs warnings when
|
|
60
|
+
* finding messages appear to contradict the stated PR intent.
|
|
61
|
+
* DIAGNOSTIC ONLY — no suppression, no filtering, no modification of findings.
|
|
62
|
+
*
|
|
63
|
+
* @param findings - Array of findings to check against PR intent
|
|
64
|
+
* @param prDescription - Combined PR title and description text
|
|
65
|
+
*/
|
|
66
|
+
export function logPRIntentContradictions(findings, prDescription) {
|
|
67
|
+
const match = PR_INTENT_PATTERN.exec(prDescription);
|
|
68
|
+
if (!match)
|
|
69
|
+
return;
|
|
70
|
+
const verb = (match[1] ?? '').toLowerCase();
|
|
71
|
+
const subject = (match[2] ?? '').toLowerCase().trim();
|
|
72
|
+
for (const finding of findings) {
|
|
73
|
+
const messageLower = finding.message.toLowerCase();
|
|
74
|
+
// Check if the finding message references the same subject as the PR intent
|
|
75
|
+
// and appears to contradict the action (e.g., PR says "add X" but finding says "remove X")
|
|
76
|
+
if (!messageLower.includes(subject.slice(0, Math.min(subject.length, 30))))
|
|
77
|
+
continue;
|
|
78
|
+
const contradictionVerbs = {
|
|
79
|
+
add: ['remove', 'delete', 'drop', 'unnecessary'],
|
|
80
|
+
fix: ['break', 'revert', 'undo'],
|
|
81
|
+
remove: ['add', 'keep', 'preserve', 'missing'],
|
|
82
|
+
rename: ['revert', 'undo', 'original name'],
|
|
83
|
+
update: ['revert', 'downgrade', 'old version'],
|
|
84
|
+
refactor: ['revert', 'undo', 'original'],
|
|
85
|
+
};
|
|
86
|
+
const opposites = contradictionVerbs[verb] ?? [];
|
|
87
|
+
const hasContradiction = opposites.some((opp) => messageLower.includes(opp));
|
|
88
|
+
if (hasContradiction) {
|
|
89
|
+
console.log('[router] [finding-validator] [pr-intent]', {
|
|
90
|
+
warning: 'Finding may contradict PR intent',
|
|
91
|
+
prIntent: `${verb} ${subject}`,
|
|
92
|
+
findingFile: finding.file,
|
|
93
|
+
findingLine: finding.line,
|
|
94
|
+
findingMessage: finding.message.slice(0, 120),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Stage 1: Semantic-only validation (no lineResolver needed).
|
|
101
|
+
*
|
|
102
|
+
* Performs ONLY normalization-independent checks:
|
|
103
|
+
* - Classification (inline / file-level / global / cross-file)
|
|
104
|
+
* - Self-contradiction detection (info severity + dismissive language + no suggestion)
|
|
105
|
+
* - PR intent contradiction logging (FR-014, diagnostic only)
|
|
106
|
+
* - NO line validation, NO path validation against diff
|
|
107
|
+
*
|
|
108
|
+
* Used in processFindings() BEFORE platform reporters run normalizeFindingsForDiff().
|
|
109
|
+
* This ensures renamed-file and stale-line findings survive to be salvaged by normalization.
|
|
110
|
+
*
|
|
111
|
+
* @param findings - Array of findings to validate
|
|
112
|
+
* @param prDescription - Optional PR title/description for intent contradiction logging
|
|
113
|
+
* @returns Validation summary with valid findings, filtered findings, and stats
|
|
114
|
+
*/
|
|
115
|
+
export function validateFindingsSemantics(findings, prDescription) {
|
|
116
|
+
const results = [];
|
|
117
|
+
const stats = {
|
|
118
|
+
total: findings.length,
|
|
119
|
+
valid: 0,
|
|
120
|
+
filteredByLine: 0,
|
|
121
|
+
filteredBySelfContradiction: 0,
|
|
122
|
+
byClassification: {
|
|
123
|
+
inline: 0,
|
|
124
|
+
'file-level': 0,
|
|
125
|
+
global: 0,
|
|
126
|
+
'cross-file': 0,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
// Pass 1: Classify each finding (no diff file set — classification is best-effort)
|
|
130
|
+
for (const finding of findings) {
|
|
131
|
+
let classification;
|
|
132
|
+
if (!finding.file) {
|
|
133
|
+
classification = 'global';
|
|
134
|
+
}
|
|
135
|
+
else if (finding.line === undefined) {
|
|
136
|
+
classification = 'file-level';
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
classification = 'inline';
|
|
140
|
+
}
|
|
141
|
+
stats.byClassification[classification]++;
|
|
142
|
+
results.push({
|
|
143
|
+
finding,
|
|
144
|
+
classification,
|
|
145
|
+
valid: true,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Pass 2 (line validation): SKIPPED — deferred to Stage 2 after normalization
|
|
149
|
+
// Pass 3: Self-contradiction detection
|
|
150
|
+
for (const result of results) {
|
|
151
|
+
if (!result.valid)
|
|
152
|
+
continue;
|
|
153
|
+
// Only filter info severity - NEVER filter warning/error
|
|
154
|
+
if (result.finding.severity !== 'info')
|
|
155
|
+
continue;
|
|
156
|
+
// FR-015: Normalize Unicode before matching to prevent zero-width character bypass
|
|
157
|
+
const normalizedMessage = normalizeUnicode(result.finding.message);
|
|
158
|
+
const matchedPattern = DISMISSIVE_PATTERNS.find((p) => p.test(normalizedMessage));
|
|
159
|
+
if (!matchedPattern)
|
|
160
|
+
continue;
|
|
161
|
+
const normalizedSuggestion = result.finding.suggestion
|
|
162
|
+
? normalizeUnicode(result.finding.suggestion)
|
|
163
|
+
: undefined;
|
|
164
|
+
if (hasActionableSuggestion(normalizedSuggestion))
|
|
165
|
+
continue;
|
|
166
|
+
// All 3 conditions met: info + dismissive + no actionable suggestion
|
|
167
|
+
result.valid = false;
|
|
168
|
+
result.filterReason = `Self-contradicting: info severity with dismissive language (${matchedPattern.source})`;
|
|
169
|
+
result.filterType = 'self_contradicting';
|
|
170
|
+
stats.filteredBySelfContradiction++;
|
|
171
|
+
console.log('[router] [finding-validator] [filtered:semantic]', {
|
|
172
|
+
file: result.finding.file,
|
|
173
|
+
line: result.finding.line,
|
|
174
|
+
reason: result.filterReason,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
// Build final arrays
|
|
178
|
+
const validFindings = [];
|
|
179
|
+
const filtered = [];
|
|
180
|
+
for (const result of results) {
|
|
181
|
+
if (result.valid) {
|
|
182
|
+
validFindings.push(result.finding);
|
|
183
|
+
stats.valid++;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
filtered.push(result);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// FR-014: Diagnostic PR intent logging (no suppression, no filtering)
|
|
190
|
+
if (prDescription) {
|
|
191
|
+
logPRIntentContradictions(validFindings, prDescription);
|
|
192
|
+
}
|
|
193
|
+
return { validFindings, filtered, stats };
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Stage 2: Diff-bound validation (for use AFTER normalizeFindingsForDiff()).
|
|
197
|
+
*
|
|
198
|
+
* Performs line validation against normalized diff positions and path validation.
|
|
199
|
+
* Runs only after normalization has had a chance to remap renamed paths and snap stale lines.
|
|
200
|
+
*
|
|
201
|
+
* @param findings - Array of findings (already normalized by normalizeFindingsForDiff)
|
|
202
|
+
* @param lineResolver - Resolver for validating line numbers against diff
|
|
203
|
+
* @param diffFiles - Array of file paths present in the diff
|
|
204
|
+
* @returns Validation summary with valid findings, filtered findings, and stats
|
|
205
|
+
*/
|
|
206
|
+
export function validateNormalizedFindings(findings, lineResolver, diffFiles) {
|
|
207
|
+
const diffFileSet = new Set(diffFiles ?? []);
|
|
208
|
+
const results = [];
|
|
209
|
+
const stats = {
|
|
210
|
+
total: findings.length,
|
|
211
|
+
valid: 0,
|
|
212
|
+
filteredByLine: 0,
|
|
213
|
+
filteredBySelfContradiction: 0,
|
|
214
|
+
byClassification: {
|
|
215
|
+
inline: 0,
|
|
216
|
+
'file-level': 0,
|
|
217
|
+
global: 0,
|
|
218
|
+
'cross-file': 0,
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
// Pass 1: Classify each finding
|
|
222
|
+
for (const finding of findings) {
|
|
223
|
+
let classification;
|
|
224
|
+
if (!finding.file) {
|
|
225
|
+
classification = 'global';
|
|
226
|
+
}
|
|
227
|
+
else if (diffFileSet.size > 0 && !diffFileSet.has(finding.file)) {
|
|
228
|
+
classification = 'cross-file';
|
|
229
|
+
console.log(`[router] [finding-validator] cross-file finding for ${finding.file}`);
|
|
230
|
+
}
|
|
231
|
+
else if (finding.line === undefined) {
|
|
232
|
+
classification = 'file-level';
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
classification = 'inline';
|
|
236
|
+
}
|
|
237
|
+
stats.byClassification[classification]++;
|
|
238
|
+
results.push({
|
|
239
|
+
finding,
|
|
240
|
+
classification,
|
|
241
|
+
valid: true,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
// Pass 2: Line validation (inline findings only)
|
|
245
|
+
for (const result of results) {
|
|
246
|
+
if (result.classification === 'inline' && result.finding.line !== undefined) {
|
|
247
|
+
const validation = lineResolver.validateLine(result.finding.file, result.finding.line);
|
|
248
|
+
if (!validation.valid) {
|
|
249
|
+
result.valid = false;
|
|
250
|
+
result.filterReason = `Line ${result.finding.line} not in diff range for ${result.finding.file}`;
|
|
251
|
+
result.filterType = 'invalid_line';
|
|
252
|
+
stats.filteredByLine++;
|
|
253
|
+
console.log('[router] [finding-validator] [filtered:unplaceable]', {
|
|
254
|
+
file: result.finding.file,
|
|
255
|
+
line: result.finding.line,
|
|
256
|
+
reason: result.filterReason,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// Pass 3: Self-contradiction detection (all findings that passed Pass 2)
|
|
262
|
+
for (const result of results) {
|
|
263
|
+
if (!result.valid)
|
|
264
|
+
continue;
|
|
265
|
+
if (result.finding.severity !== 'info')
|
|
266
|
+
continue;
|
|
267
|
+
// FR-015: Normalize Unicode before matching to prevent zero-width character bypass
|
|
268
|
+
const normalizedMessage = normalizeUnicode(result.finding.message);
|
|
269
|
+
const matchedPattern = DISMISSIVE_PATTERNS.find((p) => p.test(normalizedMessage));
|
|
270
|
+
if (!matchedPattern)
|
|
271
|
+
continue;
|
|
272
|
+
const normalizedSuggestion = result.finding.suggestion
|
|
273
|
+
? normalizeUnicode(result.finding.suggestion)
|
|
274
|
+
: undefined;
|
|
275
|
+
if (hasActionableSuggestion(normalizedSuggestion))
|
|
276
|
+
continue;
|
|
277
|
+
result.valid = false;
|
|
278
|
+
result.filterReason = `Self-contradicting: info severity with dismissive language (${matchedPattern.source})`;
|
|
279
|
+
result.filterType = 'self_contradicting';
|
|
280
|
+
stats.filteredBySelfContradiction++;
|
|
281
|
+
console.log('[router] [finding-validator] [filtered:semantic]', {
|
|
282
|
+
file: result.finding.file,
|
|
283
|
+
line: result.finding.line,
|
|
284
|
+
reason: result.filterReason,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
// Build final arrays
|
|
288
|
+
const validFindings = [];
|
|
289
|
+
const filtered = [];
|
|
290
|
+
for (const result of results) {
|
|
291
|
+
if (result.valid) {
|
|
292
|
+
validFindings.push(result.finding);
|
|
293
|
+
stats.valid++;
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
filtered.push(result);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return { validFindings, filtered, stats };
|
|
300
|
+
}
|
|
301
|
+
export function normalizeAndValidateFindings(findings, diffFiles, platform) {
|
|
302
|
+
const canonicalFiles = canonicalizeDiffFiles(diffFiles);
|
|
303
|
+
const lineResolver = buildLineResolver(canonicalFiles);
|
|
304
|
+
const normalizationResult = normalizeFindingsForDiff(findings, lineResolver);
|
|
305
|
+
if (normalizationResult.stats.dropped > 0 || normalizationResult.stats.normalized > 0) {
|
|
306
|
+
console.log(`[${platform}] Line validation: ${normalizationResult.stats.valid} valid, ` +
|
|
307
|
+
`${normalizationResult.stats.normalized} normalized, ${normalizationResult.stats.dropped} dropped`);
|
|
308
|
+
}
|
|
309
|
+
const diffFilePaths = canonicalFiles.map((f) => f.path);
|
|
310
|
+
const stage2Result = validateNormalizedFindings(normalizationResult.findings, lineResolver, diffFilePaths);
|
|
311
|
+
if (stage2Result.filtered.length > 0) {
|
|
312
|
+
console.log(`[${platform}] Stage 2 validation: ${stage2Result.stats.valid} valid, ` +
|
|
313
|
+
`${stage2Result.stats.filteredByLine} filtered by line, ` +
|
|
314
|
+
`${stage2Result.stats.filteredBySelfContradiction} self-contradicting`);
|
|
315
|
+
}
|
|
316
|
+
const driftSignal = computeDriftSignal(normalizationResult.stats, normalizationResult.invalidDetails);
|
|
317
|
+
const inlineDriftSignal = computeInlineDriftSignal(normalizationResult.stats, normalizationResult.invalidDetails);
|
|
318
|
+
return {
|
|
319
|
+
validatedFindings: stage2Result.validFindings,
|
|
320
|
+
canonicalFiles,
|
|
321
|
+
driftSignal,
|
|
322
|
+
inlineDriftSignal,
|
|
323
|
+
normalizationStats: normalizationResult.stats,
|
|
324
|
+
invalidDetails: normalizationResult.invalidDetails,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Validate and classify findings, filtering out invalid lines and self-contradicting findings.
|
|
329
|
+
*
|
|
330
|
+
* Three-pass validation:
|
|
331
|
+
* 1. Classify each finding (inline, file-level, global, cross-file)
|
|
332
|
+
* 2. Validate line numbers for inline findings
|
|
333
|
+
* 3. Detect self-contradicting findings (info + dismissive + no suggestion)
|
|
334
|
+
*
|
|
335
|
+
* @deprecated Use validateFindingsSemantics() in processFindings and
|
|
336
|
+
* validateNormalizedFindings() in platform reporters after normalization.
|
|
337
|
+
* Kept for backward compatibility (benchmark adapter).
|
|
338
|
+
*
|
|
339
|
+
* @param findings - Array of findings to validate
|
|
340
|
+
* @param lineResolver - Resolver for validating line numbers against diff
|
|
341
|
+
* @param diffFiles - Array of file paths present in the diff
|
|
342
|
+
* @returns Validation summary with valid findings, filtered findings, and stats
|
|
343
|
+
*/
|
|
344
|
+
export function validateFindings(findings, lineResolver, diffFiles) {
|
|
345
|
+
return validateNormalizedFindings(findings, lineResolver, diffFiles);
|
|
346
|
+
}
|
|
347
|
+
//# sourceMappingURL=finding-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finding-validator.js","sourceRoot":"","sources":["../../src/report/finding-validator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,GAIzB,MAAM,oBAAoB,CAAC;AAqC5B;;;;GAIG;AACH;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,oCAAoC,EAAE,EAAE,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,mBAAmB,GAAa;IACpC,yBAAyB;IACzB,0BAA0B;IAC1B,mBAAmB;IACnB,uBAAuB;IACvB,qBAAqB;CACtB,CAAC;AAEF;;GAEG;AACH,SAAS,uBAAuB,CAAC,UAA8B;IAC7D,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IAClC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,GAAG,CACjD,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAC9C,CAAC,MAAM,CAAC,CAAC,QAAQ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AEpB,OAAO,0BAA0B,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework Pattern Filter (FR-013)
|
|
3
|
+
*
|
|
4
|
+
* Deterministic post-processing filter that catches Pattern B false positives
|
|
5
|
+
* using a closed, default-deny matcher table. Runs in Stage 1 validation
|
|
6
|
+
* (after self-contradiction filter, before Stage 2 diff-bound validation).
|
|
7
|
+
*
|
|
8
|
+
* The matcher table is CLOSED: only these 3 matchers exist.
|
|
9
|
+
* Adding a new matcher requires a spec amendment.
|
|
10
|
+
*/
|
|
11
|
+
import type { Finding } from '../agents/types.js';
|
|
12
|
+
export interface FrameworkPatternMatcher {
|
|
13
|
+
/** Unique matcher identifier */
|
|
14
|
+
readonly id: string;
|
|
15
|
+
/** Human-readable name */
|
|
16
|
+
readonly name: string;
|
|
17
|
+
/** Regex that triggers evaluation when matched against finding.message */
|
|
18
|
+
readonly messagePattern: RegExp;
|
|
19
|
+
/**
|
|
20
|
+
* Validates structural evidence in diff content.
|
|
21
|
+
* Returns true if evidence confirms the framework pattern (suppress finding).
|
|
22
|
+
* Returns false if evidence is missing or ambiguous (pass finding through).
|
|
23
|
+
*/
|
|
24
|
+
evidenceValidator: (finding: Finding, diffContent: string) => boolean;
|
|
25
|
+
/** Diagnostic reason logged when finding is suppressed */
|
|
26
|
+
readonly suppressionReason: string;
|
|
27
|
+
}
|
|
28
|
+
export interface FrameworkFilterResult {
|
|
29
|
+
finding: Finding;
|
|
30
|
+
suppressed: boolean;
|
|
31
|
+
matcherId?: string;
|
|
32
|
+
reason?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface FrameworkFilterSummary {
|
|
35
|
+
total: number;
|
|
36
|
+
suppressed: number;
|
|
37
|
+
passed: number;
|
|
38
|
+
results: FrameworkFilterResult[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Evaluate findings against the closed matcher table.
|
|
42
|
+
* Default-deny: only exact matches with validated evidence are suppressed.
|
|
43
|
+
*
|
|
44
|
+
* @param findings - Findings that passed Stage 1 semantic validation
|
|
45
|
+
* @param diffContent - Raw diff content for evidence validation
|
|
46
|
+
* @returns Summary with suppressed/passed findings and diagnostic details
|
|
47
|
+
*/
|
|
48
|
+
export declare function filterFrameworkConventionFindings(findings: Finding[], diffContent: string): FrameworkFilterSummary;
|
|
49
|
+
/**
|
|
50
|
+
* Get the list of valid findings (non-suppressed) from a filter summary.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getValidFindings(summary: FrameworkFilterSummary): Finding[];
|
|
53
|
+
//# sourceMappingURL=framework-pattern-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-pattern-filter.d.ts","sourceRoot":"","sources":["../../src/report/framework-pattern-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAMlD,MAAM,WAAW,uBAAuB;IACtC,gCAAgC;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC;IACtE,0DAA0D;IAC1D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAkKD;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,OAAO,EAAE,EACnB,WAAW,EAAE,MAAM,GAClB,sBAAsB,CAuCxB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,EAAE,CAE3E"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework Pattern Filter (FR-013)
|
|
3
|
+
*
|
|
4
|
+
* Deterministic post-processing filter that catches Pattern B false positives
|
|
5
|
+
* using a closed, default-deny matcher table. Runs in Stage 1 validation
|
|
6
|
+
* (after self-contradiction filter, before Stage 2 diff-bound validation).
|
|
7
|
+
*
|
|
8
|
+
* The matcher table is CLOSED: only these 3 matchers exist.
|
|
9
|
+
* Adding a new matcher requires a spec amendment.
|
|
10
|
+
*/
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// Evidence Helpers
|
|
13
|
+
// =============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Extract lines near a finding's line from diff content, scoped to the finding's file.
|
|
16
|
+
* Returns the relevant file's diff section for evidence scanning.
|
|
17
|
+
*/
|
|
18
|
+
function extractFileDiffSection(finding, diffContent) {
|
|
19
|
+
if (!finding.file || !diffContent)
|
|
20
|
+
return '';
|
|
21
|
+
// Normalize Windows backslashes to forward slashes for diff header matching
|
|
22
|
+
const normalizedPath = finding.file.replace(/\\/g, '/');
|
|
23
|
+
// Split diff by file boundaries
|
|
24
|
+
const fileSections = diffContent.split(/^diff --git /m);
|
|
25
|
+
for (const section of fileSections) {
|
|
26
|
+
// Match against the finding's file path (check both a/ and b/ paths)
|
|
27
|
+
if (section.includes(`a/${normalizedPath} `) ||
|
|
28
|
+
section.includes(`b/${normalizedPath}`) ||
|
|
29
|
+
section.includes(`a/${normalizedPath}\n`) ||
|
|
30
|
+
section.includes(`b/${normalizedPath}\n`)) {
|
|
31
|
+
return section;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return '';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Extract lines near a specific line number from a diff section.
|
|
38
|
+
* Returns lines within a window around the target line.
|
|
39
|
+
*/
|
|
40
|
+
function extractLinesNearFinding(diffSection, findingLine, windowSize = 10) {
|
|
41
|
+
if (findingLine === undefined)
|
|
42
|
+
return diffSection.split('\n');
|
|
43
|
+
const lines = diffSection.split('\n');
|
|
44
|
+
const result = [];
|
|
45
|
+
let currentLine = 0;
|
|
46
|
+
for (const line of lines) {
|
|
47
|
+
// Track line numbers from hunk headers
|
|
48
|
+
const hunkMatch = line.match(/^@@ -\d+(?:,\d+)? \+(\d+)/);
|
|
49
|
+
if (hunkMatch?.[1]) {
|
|
50
|
+
currentLine = parseInt(hunkMatch[1], 10) - 1;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (line.startsWith('-'))
|
|
54
|
+
continue; // Skip removed lines
|
|
55
|
+
currentLine++;
|
|
56
|
+
if (currentLine >= findingLine - windowSize && currentLine <= findingLine + windowSize) {
|
|
57
|
+
// Strip diff prefix for content analysis
|
|
58
|
+
const content = line.startsWith('+')
|
|
59
|
+
? line.slice(1)
|
|
60
|
+
: line.startsWith(' ')
|
|
61
|
+
? line.slice(1)
|
|
62
|
+
: line;
|
|
63
|
+
result.push(content);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
// =============================================================================
|
|
69
|
+
// Closed Matcher Table — DEFAULT DENY
|
|
70
|
+
// Only these 3 matchers. No additions without spec change.
|
|
71
|
+
// =============================================================================
|
|
72
|
+
const FRAMEWORK_MATCHERS = [
|
|
73
|
+
// T019: Express Error Middleware
|
|
74
|
+
{
|
|
75
|
+
id: 'express-error-mw',
|
|
76
|
+
name: 'Express Error Middleware',
|
|
77
|
+
messagePattern: /unused.*param/i,
|
|
78
|
+
evidenceValidator(finding, diffContent) {
|
|
79
|
+
const fileSection = extractFileDiffSection(finding, diffContent);
|
|
80
|
+
if (!fileSection)
|
|
81
|
+
return false;
|
|
82
|
+
// Must have a 4-parameter function near the finding line
|
|
83
|
+
// Express error middleware signature: (err, req, res, next) or variants
|
|
84
|
+
const nearbyLines = extractLinesNearFinding(fileSection, finding.line, 5);
|
|
85
|
+
const nearbyText = nearbyLines.join('\n');
|
|
86
|
+
// Match 4-param function: (param1, param2, param3, param4) with optional type annotations
|
|
87
|
+
const fourParamPattern = /\(\s*\w+\s*(?::\s*[^,)]+)?\s*,\s*\w+\s*(?::\s*[^,)]+)?\s*,\s*\w+\s*(?::\s*[^,)]+)?\s*,\s*\w+\s*(?::\s*[^,)]+)?\s*\)/;
|
|
88
|
+
const hasFourParams = fourParamPattern.test(nearbyText);
|
|
89
|
+
if (!hasFourParams)
|
|
90
|
+
return false;
|
|
91
|
+
// At least one Express indicator required (in the file section):
|
|
92
|
+
// - .use() middleware registration call
|
|
93
|
+
// - import from 'express' package
|
|
94
|
+
// - Express type annotations (Request, Response, NextFunction, ErrorRequestHandler)
|
|
95
|
+
const hasUseCall = /\.use\s*\(/.test(fileSection);
|
|
96
|
+
const hasExpressImport = /from\s+['"]express['"]/.test(fileSection);
|
|
97
|
+
const hasExpressTypes = /:\s*(?:Request|Response|NextFunction|ErrorRequestHandler)\b/.test(nearbyText);
|
|
98
|
+
return hasUseCall || hasExpressImport || hasExpressTypes;
|
|
99
|
+
},
|
|
100
|
+
suppressionReason: 'Express 4-param error middleware — unused params required by framework',
|
|
101
|
+
},
|
|
102
|
+
// T020: TypeScript Unused Prefix
|
|
103
|
+
{
|
|
104
|
+
id: 'ts-unused-prefix',
|
|
105
|
+
name: 'TypeScript Unused Prefix',
|
|
106
|
+
messagePattern: /unused.*(variable|parameter|binding|import)/i,
|
|
107
|
+
evidenceValidator(finding, _diffContent) {
|
|
108
|
+
// Extract identifier names from the finding message.
|
|
109
|
+
// Look for words that could be binding names (alphanumeric + underscore).
|
|
110
|
+
// Confirm at least one is underscore-prefixed (the TS convention).
|
|
111
|
+
const words = finding.message.match(/\b(\w+)\b/g);
|
|
112
|
+
if (!words)
|
|
113
|
+
return false;
|
|
114
|
+
// The binding name must start with underscore and have at least one more char
|
|
115
|
+
return words.some((word) => /^_\w+$/.test(word));
|
|
116
|
+
},
|
|
117
|
+
suppressionReason: 'TypeScript _prefix convention for intentionally unused bindings',
|
|
118
|
+
},
|
|
119
|
+
// T021: Exhaustive Switch
|
|
120
|
+
{
|
|
121
|
+
id: 'exhaustive-switch',
|
|
122
|
+
name: 'Exhaustive Switch',
|
|
123
|
+
messagePattern: /missing.*case|unhandled.*case|default.*unreachable/i,
|
|
124
|
+
evidenceValidator(finding, diffContent) {
|
|
125
|
+
const fileSection = extractFileDiffSection(finding, diffContent);
|
|
126
|
+
if (!fileSection)
|
|
127
|
+
return false;
|
|
128
|
+
// Scan near finding line for assertNever( or exhaustive throw
|
|
129
|
+
const nearbyLines = extractLinesNearFinding(fileSection, finding.line, 8);
|
|
130
|
+
const nearbyText = nearbyLines.join('\n');
|
|
131
|
+
const hasAssertNever = /assertNever\s*\(/.test(nearbyText);
|
|
132
|
+
const hasExhaustiveThrow = /throw\s+new\s+\w*[Ee]rror\s*\(\s*['"`].*(?:exhaustive|unreachable|unexpected)/i.test(nearbyText);
|
|
133
|
+
return hasAssertNever || hasExhaustiveThrow;
|
|
134
|
+
},
|
|
135
|
+
suppressionReason: 'Exhaustive switch with assertNever/throw — all cases handled at compile time',
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
// =============================================================================
|
|
139
|
+
// Public API
|
|
140
|
+
// =============================================================================
|
|
141
|
+
/**
|
|
142
|
+
* Evaluate findings against the closed matcher table.
|
|
143
|
+
* Default-deny: only exact matches with validated evidence are suppressed.
|
|
144
|
+
*
|
|
145
|
+
* @param findings - Findings that passed Stage 1 semantic validation
|
|
146
|
+
* @param diffContent - Raw diff content for evidence validation
|
|
147
|
+
* @returns Summary with suppressed/passed findings and diagnostic details
|
|
148
|
+
*/
|
|
149
|
+
export function filterFrameworkConventionFindings(findings, diffContent) {
|
|
150
|
+
const results = [];
|
|
151
|
+
let suppressed = 0;
|
|
152
|
+
for (const finding of findings) {
|
|
153
|
+
let matched = false;
|
|
154
|
+
for (const matcher of FRAMEWORK_MATCHERS) {
|
|
155
|
+
// Step 1: Does the message pattern match?
|
|
156
|
+
if (!matcher.messagePattern.test(finding.message))
|
|
157
|
+
continue;
|
|
158
|
+
// Step 2: Does structural evidence confirm the pattern?
|
|
159
|
+
if (matcher.evidenceValidator(finding, diffContent)) {
|
|
160
|
+
results.push({
|
|
161
|
+
finding,
|
|
162
|
+
suppressed: true,
|
|
163
|
+
matcherId: matcher.id,
|
|
164
|
+
reason: matcher.suppressionReason,
|
|
165
|
+
});
|
|
166
|
+
suppressed++;
|
|
167
|
+
matched = true;
|
|
168
|
+
console.log(`[router] [framework-filter] Suppressed: ${matcher.id} — ${finding.file}:${finding.line ?? '?'} — ${matcher.suppressionReason}`);
|
|
169
|
+
break; // First matching matcher wins
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (!matched) {
|
|
173
|
+
results.push({ finding, suppressed: false });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
total: findings.length,
|
|
178
|
+
suppressed,
|
|
179
|
+
passed: findings.length - suppressed,
|
|
180
|
+
results,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Get the list of valid findings (non-suppressed) from a filter summary.
|
|
185
|
+
*/
|
|
186
|
+
export function getValidFindings(summary) {
|
|
187
|
+
return summary.results.filter((r) => !r.suppressed).map((r) => r.finding);
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=framework-pattern-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-pattern-filter.js","sourceRoot":"","sources":["../../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AAC;gBACb,OAAO,GAAG,IAAI,CAAC;gBACf,OAAO,CAAC,GAAG,CACT,2CAA2C,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,IAAI,GAAG,MAAM,OAAO,CAAC,iBAAiB,EAAE,CAChI,CAAC;gBACF,MAAM,CAAC,8BAA8B;YACvC,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,MAAM;QACtB,UAAU;QACV,MAAM,EAAE,QAAQ,CAAC,MAAM,GAAG,UAAU;QACpC,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAA+B;IAC9D,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC5E,CAAC"}
|
package/dist/report/github.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export interface ReportResult {
|
|
|
31
31
|
invalidLineDetails?: InvalidLineDetail[];
|
|
32
32
|
/** Whether inline comments were suppressed by drift gate */
|
|
33
33
|
inlineCommentsGated?: boolean;
|
|
34
|
+
/** Post-normalization validated findings for gating (after Stage 2) */
|
|
35
|
+
postNormalizationFindings?: Finding[];
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Start a check run in 'in_progress' state
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/report/github.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,E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