Skip to content

Commit bfef26b

Browse files
author
alpsla
committed
Revert "fix(critical): Complete 4-bug fix for report quality issues"
This reverts commit 64f7180.
1 parent 64f7180 commit bfef26b

5 files changed

Lines changed: 11 additions & 61 deletions

File tree

packages/agents/src/two-branch/analyzers/v9-grouped-report-formatter.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,8 +1370,7 @@ ${(() => {
13701370
const autoFixPercent = issues.length > 0 ? Math.round((autoFixableCount / issues.length) * 100) : 0;
13711371
13721372
if (autoFixableCount > 0) {
1373-
return `\n> 🚀 **Quick Win**: ${autoFixableCount.toLocaleString()} issues (${autoFixPercent}%) can be automatically fixed using IDE tools!
1374-
> ⚠️ **Note**: While all issues have automated fixes available, we recommend manually reviewing critical (${issues.filter(i => i.severity === 'critical').length}) and high (${issues.filter(i => i.severity === 'high').length}) severity issues before applying fixes.\n`;
1373+
return `\n> 🚀 **Quick Win**: ${autoFixableCount.toLocaleString()} issues (${autoFixPercent}%) can be automatically fixed using the attached manifest file!\n`;
13751374
}
13761375
return '';
13771376
})()}

packages/agents/src/two-branch/analyzers/v9-skill-score-manager.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export interface SkillScoreData {
1818
repository: string; // Will be stored as 'repo_name' in database
1919
prNumber: number;
2020
branch?: string;
21-
commitHash?: string; // BUG #4 FIX: Track commit to prevent duplicate trend entries
2221
overallScore: number;
2322
qualityScore?: number;
2423
categoryScores: {
@@ -94,11 +93,11 @@ export class SkillScoreManager {
9493
try {
9594
const { data, error } = await this.supabase
9695
.from('skill_scores')
97-
.select('overall_score, commit_hash') // BUG #4 FIX: Fetch commit_hash too
96+
.select('overall_score')
9897
.eq('developer_email', developerEmail)
9998
.eq('repo_name', repository) // Fixed: use 'repo_name' column
10099
.order('analyzed_at', { ascending: true })
101-
.limit(limit * 2); // Fetch more to account for duplicates
100+
.limit(limit);
102101

103102
if (error) {
104103
console.warn('[SkillScoreManager] Error fetching trend:', error.message);
@@ -109,21 +108,8 @@ export class SkillScoreManager {
109108
return [];
110109
}
111110

112-
// BUG #4 FIX: Remove duplicate commits, keep only latest analysis per commit
113-
const seenCommits = new Set<string>();
114-
const uniqueScores: number[] = [];
115-
116-
for (const record of data) {
117-
const commitHash = record.commit_hash || `pr-${Math.random()}`; // Fallback for old records
118-
if (!seenCommits.has(commitHash)) {
119-
seenCommits.add(commitHash);
120-
uniqueScores.push(record.overall_score);
121-
if (uniqueScores.length >= limit) break;
122-
}
123-
}
124-
125-
const trend = uniqueScores.slice(0, limit);
126-
console.log(`[SkillScoreManager] Trend for ${developerEmail}: [${trend.join(', ')}] (${seenCommits.size} unique commits)`);
111+
const trend = data.map(r => r.overall_score);
112+
console.log(`[SkillScoreManager] Trend for ${developerEmail}: [${trend.join(', ')}]`);
127113
return trend;
128114
} catch (error) {
129115
console.error('[SkillScoreManager] Unexpected error fetching trend:', error);
@@ -145,7 +131,6 @@ export class SkillScoreManager {
145131
repo_name: scoreData.repository, // Fixed: use 'repo_name' column
146132
pr_number: scoreData.prNumber,
147133
branch: scoreData.branch,
148-
commit_hash: scoreData.commitHash, // BUG #4 FIX: Store commit hash
149134
overall_score: scoreData.overallScore,
150135
quality_score: scoreData.qualityScore,
151136
security_score: scoreData.categoryScores.security,

packages/agents/src/two-branch/report/business-impact.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,7 @@ export function generateBusinessImpact(issues: EnrichedIssue[], groups: IssueGro
193193

194194
const immediateRisk = blocking.length > 0 ? '🔴 High' : '🟢 Low';
195195

196-
// SESSION 13 FIX #3 + BUG #2 FIX: Detect if most/all blocking issues are auto-fixable
197-
// This accounts for CheckStyle HIGH issues that are actually auto-fixable
198-
// Note: totalFixCost (line 156) already includes auto-fix adjustments (lines 137-153)
199-
// After fixing BUG #1 (severity classifier), most CheckStyle issues will be LOW,
200-
// which eliminates the contradiction between "100% auto-fixable" and "high manual cost"
196+
// SESSION 13 FIX #3: Detect if most/all blocking issues are auto-fixable
201197
const blockingAutoFixableGroups = autoFixableGroups.filter(g =>
202198
blocking.some(i => i.rule === g.rule && i.tool === g.tool && i.severity === g.severity)
203199
);

packages/agents/src/two-branch/report/metadata-footer.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,14 @@ export function generateAnalysisMetadata(
8181
// Add Agent Performance if available (optional)
8282
if (showAgentPerformance && metadata.agentPerformance && Array.isArray(metadata.agentPerformance) && metadata.agentPerformance.length > 0) {
8383
content += `\n### Agent Performance
84-
| Agent | Files Analyzed | Issues Found | Time | Cost | Model |
85-
|-------|----------------|--------------|------|------|-------|
84+
| Agent | Files Analyzed | Issues Found | Time | Cost |
85+
|-------|----------------|--------------|------|------|
8686
`;
8787
metadata.agentPerformance.forEach((agent: any) => {
8888
const issues = agent.issuesFound || agent.issues || 0;
8989
const time = agent.duration ? (agent.duration / 1000).toFixed(1) + 's' : 'N/A';
9090
const cost = agent.cost ? '$' + agent.cost.toFixed(4) : (issues === 0 ? 'N/A' : '$0.0000');
91-
const model = agent.model || agent.modelName || 'N/A';
92-
content += `| ${agent.name || agent.agent} | ${agent.filesAnalyzed || agent.files || 'N/A'} | ${issues} | ${time} | ${cost} | ${model} |\n`;
91+
content += `| ${agent.name || agent.agent} | ${agent.filesAnalyzed || agent.files || 'N/A'} | ${issues} | ${time} | ${cost} |\n`;
9392
});
9493
}
9594

packages/agents/src/two-branch/services/ai-severity-classifier.ts

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -84,36 +84,17 @@ IMPORTANT:
8484
- SpotBugs HIGH priority = usually HIGH or CRITICAL (actual bugs)
8585
- Semgrep security rules = usually HIGH or CRITICAL
8686
87-
⚠️ CRITICAL: CHECKSTYLE RULES ARE ALWAYS LOW - NO EXCEPTIONS ⚠️
88-
89-
ALL CheckStyle rules MUST be classified as LOW severity.
90-
CheckStyle ONLY detects style, formatting, and documentation issues.
91-
CheckStyle CANNOT detect security vulnerabilities or runtime bugs.
92-
93-
DO NOT upgrade CheckStyle rules to HIGH/CRITICAL under ANY circumstances.
94-
If you see tool="checkstyle", ALWAYS return severity="low".
95-
96-
Common CheckStyle rules (ALL LOW):
97-
- DesignForExtensionCheck → LOW (documentation/design guideline for extension)
98-
- LocalVariableNameCheck → LOW (naming convention - camelCase)
99-
- ParameterNameCheck → LOW (naming convention)
100-
- MemberNameCheck → LOW (naming convention)
101-
- MethodNameCheck → LOW (naming convention)
87+
CHECKSTYLE RULES (ALWAYS LOW unless security-related):
10288
- LineLengthCheck → LOW (line length is purely style)
10389
- JavadocPackageCheck → LOW (documentation is not runtime-critical)
10490
- JavadocMethodCheck → LOW (documentation preference)
105-
- JavadocVariableCheck → LOW (documentation preference)
10691
- MissingJavadocMethod → LOW (documentation preference)
10792
- IndentationCheck → LOW (formatting only)
10893
- WhitespaceAfter/Before → LOW (formatting only)
10994
- ImportOrder → LOW (import organization)
11095
- UnusedImports → LOW (cleanup, no runtime impact)
11196
- NeedBraces → LOW (style preference)
112-
- VisibilityModifierCheck → LOW (encapsulation guideline)
113-
- FinalParametersCheck → LOW (immutability guideline)
114-
- NewlineAtEndOfFileCheck → LOW (formatting convention)
115-
116-
EXCEPTION: Only classify as HIGH if the rule detects actual security issues (rare)
97+
- EXCEPTION: Only classify as HIGH if the rule detects actual security issues (rare)
11798
11899
Output ONLY this JSON structure:
119100
{
@@ -134,16 +115,6 @@ export async function classifyIssueSeverity(
134115
modelOverride?: string
135116
): Promise<SeverityClassificationResult> {
136117

137-
// BUG #1 FIX: FORCE CheckStyle to LOW - no AI classification needed
138-
// CheckStyle ONLY detects style/formatting/documentation - never security or bugs
139-
if (input.tool.toLowerCase() === 'checkstyle') {
140-
return {
141-
severity: 'low',
142-
reasoning: 'CheckStyle only detects style, formatting, and documentation issues (not runtime bugs or security vulnerabilities)',
143-
confidence: 'high'
144-
};
145-
}
146-
147118
// Build user prompt with issue details
148119
const userPrompt = buildClassificationPrompt(input);
149120

0 commit comments

Comments
 (0)