Skip to content

Commit 41cea1c

Browse files
alpslaclaude
andcommitted
fix(scoring): Use baseScore=100 for Skills Tracking (BUG #4)
PROBLEM: - Skills Tracking shows Security 18/100 for 4 critical + 4 high issues - User calculation: 100 - (4×5 + 4×3) = 100 - 32 = 68 ✅ - Actual score: 18/100 ❌ ROOT CAUSE: - SESSION 13 FIX used baseScore=50 for Skills (neutral baseline) - This creates confusing UX: 0 issues = 50/100 (looks like failing) - baseScore=50: 50 - 32 = 18 (matches report but unintuitive) USER FEEDBACK: - "4 critical + 4 high should be 68/100, not 18/100" - baseScore=50 suggests code is mediocre even with 0 issues - baseScore=100 is more intuitive: starts perfect, deducts for issues FIX APPLIED (3 locations): 1. v9-grouped-report-formatter.ts wrapper (Skills Tracking display) 2. score-calculator.ts full V9 scoring (Supabase persistence) 3. score-calculator.ts simplified scoring (fallback) All now use baseScore=100 consistently for Skills: - 0 issues = 100/100 (perfect) ✅ - 4 critical + 4 high = 68/100 (needs work) ✅ - Intuitive: starts perfect, issues deduct from 100 FILES: - src/two-branch/analyzers/v9-grouped-report-formatter.ts:1142 - src/two-branch/report/score-calculator.ts:196-205, 458-466 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 325562c commit 41cea1c

2 files changed

Lines changed: 19 additions & 13 deletions

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,10 @@ export class V9GroupedReportFormatter {
11361136
* All have same weight (only sign differs)
11371137
*/
11381138
private calculateCategoryScore(categoryIssues: EnrichedIssue[]): number {
1139-
return calculateCategoryScore(categoryIssues);
1139+
// BUG #4 FIX: Skills Tracking should use baseScore=100 (starts perfect, deducts for issues)
1140+
// This provides better UX: 0 issues = 100/100, not 50/100
1141+
// User feedback: "4 critical + 4 high should be 68/100, not 18/100"
1142+
return calculateCategoryScore(categoryIssues, 100);
11401143
}
11411144

11421145
private _REMOVED_calculateCategoryScore_LEGACY(categoryIssues: EnrichedIssue[]): number {

packages/agents/src/two-branch/report/score-calculator.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,15 @@ export async function calculateFullV9Score(
193193
codeQuality: calculateCategoryScore(issuesByCategory.codeQuality, 100)
194194
};
195195

196-
// SESSION 13 FIX: Calculate category scores for Skill (base=50)
196+
// BUG #4 FIX: Calculate category scores for Skill (base=100)
197+
// User feedback: baseScore=50 creates confusing UX (0 issues = 50/100 looks like failing)
198+
// baseScore=100 is more intuitive: 0 issues = perfect 100/100, issues deduct from there
197199
const skillCategoryScores = {
198-
security: calculateCategoryScore(issuesByCategory.security, 50),
199-
performance: calculateCategoryScore(issuesByCategory.performance, 50),
200-
architecture: calculateCategoryScore(issuesByCategory.architecture, 50),
201-
dependency: calculateCategoryScore(issuesByCategory.dependency, 50),
202-
codeQuality: calculateCategoryScore(issuesByCategory.codeQuality, 50)
200+
security: calculateCategoryScore(issuesByCategory.security, 100),
201+
performance: calculateCategoryScore(issuesByCategory.performance, 100),
202+
architecture: calculateCategoryScore(issuesByCategory.architecture, 100),
203+
dependency: calculateCategoryScore(issuesByCategory.dependency, 100),
204+
codeQuality: calculateCategoryScore(issuesByCategory.codeQuality, 100)
203205
};
204206

205207
// BUG FIX #44: Calculate APP score (minimum of categories - weakest link)
@@ -453,13 +455,14 @@ export function calculateSimplifiedScore(issues: EnrichedIssue[]): any {
453455
codeQuality: calculateCategoryScore(issuesByCategory.codeQuality, 100)
454456
};
455457

456-
// Calculate skill category scores with base=50 (for Skill Score)
458+
// BUG #4 FIX: Calculate skill category scores with base=100 (for Skill Score)
459+
// Changed from base=50 to base=100 for better UX (0 issues = 100/100, not 50/100)
457460
const skillCategoryScores = {
458-
security: calculateCategoryScore(issuesByCategory.security, 50),
459-
performance: calculateCategoryScore(issuesByCategory.performance, 50),
460-
architecture: calculateCategoryScore(issuesByCategory.architecture, 50),
461-
dependency: calculateCategoryScore(issuesByCategory.dependency, 50),
462-
codeQuality: calculateCategoryScore(issuesByCategory.codeQuality, 50)
461+
security: calculateCategoryScore(issuesByCategory.security, 100),
462+
performance: calculateCategoryScore(issuesByCategory.performance, 100),
463+
architecture: calculateCategoryScore(issuesByCategory.architecture, 100),
464+
dependency: calculateCategoryScore(issuesByCategory.dependency, 100),
465+
codeQuality: calculateCategoryScore(issuesByCategory.codeQuality, 100)
463466
};
464467

465468
// APP Score = MIN of all categories (weakest link)

0 commit comments

Comments
 (0)