Skip to content

Commit d03b886

Browse files
alpslaclaude
andcommitted
Session 92: Report formatting fixes and test updates
- Fix duplicate Code Quality score display (only show category scores when 2+ categories) - Fix Time & Cost Analysis to show proper calculation with IDE Autofix context - Add "Contribute patterns" note for BASIC tier users - Remove disconnected auto-fixable note and "Copy markdown" tip - Update test to use Quarkus quickstarts PR #1600 for multi-tool testing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d46ac27 commit d03b886

4 files changed

Lines changed: 49 additions & 47 deletions

File tree

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

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,36 +2271,29 @@ ${scoreInterpretation.emoji} **${qualityResult.score.toFixed(1)}/100** (Grade: *
22712271
> ${scoreInterpretation.description}
22722272
22732273
**Score Breakdown**:
2274-
${qualityResult.categoryScores ? `
2275-
**Category Scores** (Repository Health):
2276-
${byDetectedCategory['Security'] > 0 ? `- 🔒 Security: ${qualityResult.categoryScores.security}/100\n` : ''}${byDetectedCategory['Performance'] > 0 ? `- ⚡ Performance: ${qualityResult.categoryScores.performance}/100\n` : ''}${byDetectedCategory['Architecture'] > 0 ? `- 🏗️ Architecture: ${qualityResult.categoryScores.architecture}/100\n` : ''}${byDetectedCategory['Dependencies'] > 0 ? `- 📦 Dependencies: ${qualityResult.categoryScores.dependency}/100\n` : ''}${byDetectedCategory['Code Quality'] > 0 ? `- ✨ Code Quality: ${qualityResult.categoryScores.codeQuality}/100\n` : ''}
2274+
${qualityResult.categoryScores ? `${(() => {
2275+
// SESSION 92 FIX: Only show Category Scores when 2+ categories have issues
2276+
// Avoids redundant display when only Code Quality has issues
2277+
const categoriesWithIssues = [
2278+
byDetectedCategory['Security'] > 0,
2279+
byDetectedCategory['Performance'] > 0,
2280+
byDetectedCategory['Architecture'] > 0,
2281+
byDetectedCategory['Dependencies'] > 0,
2282+
byDetectedCategory['Code Quality'] > 0
2283+
].filter(Boolean).length;
2284+
2285+
if (categoriesWithIssues >= 2) {
2286+
return `**Category Scores** (Repository Health):
2287+
${byDetectedCategory['Security'] > 0 ? `- 🔒 Security: ${qualityResult.categoryScores.security}/100\n` : ''}${byDetectedCategory['Performance'] > 0 ? `- ⚡ Performance: ${qualityResult.categoryScores.performance}/100\n` : ''}${byDetectedCategory['Architecture'] > 0 ? `- 🏗️ Architecture: ${qualityResult.categoryScores.architecture}/100\n` : ''}${byDetectedCategory['Dependencies'] > 0 ? `- 📦 Dependencies: ${qualityResult.categoryScores.dependency}/100\n` : ''}${byDetectedCategory['Code Quality'] > 0 ? `- ✨ Code Quality: ${qualityResult.categoryScores.codeQuality}/100\n` : ''}`;
2288+
}
2289+
return ''; // Skip category scores when only one category has issues
2290+
})()}
22772291
**Overall Scores**:
22782292
- 📱 **APP Score**: ${qualityResult.appScore}/100 (MIN of categories - "weakest link")
22792293
- 👨‍💻 **Skill Score**: ${qualityResult.skillScore}/100 (AVG of categories)
22802294
22812295
> Scores saved to Supabase for tracking trends over time
22822296
2283-
${(() => {
2284-
// SESSION 51: Updated to BASIC/PRO tier system
2285-
// Pattern-based fixes (from Supabase pattern library)
2286-
const patternFixableGroups = groups.filter(g => this.canAutoFix(g));
2287-
const patternFixableCount = patternFixableGroups.reduce((sum, g) => sum + g.count, 0);
2288-
const patternFixablePercent = issues.length > 0 ? Math.round((patternFixableCount / issues.length) * 100) : 0;
2289-
2290-
// AI-fixable (PRO tier only - requires AI generation)
2291-
const aiFixableGroups = groups.filter(g => !this.isSafeToAutoApply(g) && this.canAutoFix(g));
2292-
const aiFixableCount = aiFixableGroups.reduce((sum, g) => sum + g.count, 0);
2293-
const aiFixablePercent = issues.length > 0 ? Math.round((aiFixableCount / issues.length) * 100) : 0;
2294-
2295-
// Needs guidance (both tiers provide recommendations)
2296-
const guidanceNeededCount = issues.length - patternFixableCount;
2297-
const guidanceNeededPercent = issues.length > 0 ? Math.round((guidanceNeededCount / issues.length) * 100) : 0;
2298-
2299-
// SESSION 52: Simplified - detailed tier info is in "AI Fix Recommendations" section below
2300-
return `\n> 🚀 **Fix Coverage**: ${patternFixableCount.toLocaleString()} issues (${patternFixablePercent}%) have pattern-based fixes available
2301-
> See **AI Fix Recommendations** section below for BASIC vs PRO tier details.
2302-
\n`;
2303-
})()}
23042297
` : `
23052298
- Base Score: 100.0
23062299
@@ -7967,9 +7960,7 @@ ${(() => {
79677960
- High: ${issues.filter(i => i.severity === 'high').length}
79687961
- Medium: ${issues.filter(i => i.severity === 'medium').length}
79697962
- Low: ${issues.filter(i => i.severity === 'low').length}
7970-
\`\`\`
7971-
7972-
> 💡 **Tip**: Copy the markdown above and paste it as a comment on your pull request.`;
7963+
\`\`\``;
79737964
}
79747965

79757966
/**

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

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -518,30 +518,42 @@ function generateBasicTierSection(
518518
// BASIC tier gets pattern-based fixes but not AI generation
519519
const patternFixTime = autoFixableCount > 0 ? Math.ceil(autoFixableCount * 0.35 / 60) : 0; // minutes
520520
const manualReviewTime = totalActiveIssues - autoFixableCount;
521-
const basicTimeSaved = baseFixHours * 0.69; // ~69% time reduction with BASIC
521+
522+
// SESSION 92 FIX: Calculate time savings properly
523+
// Time saved only applies when using autofix feature via IDE integration
524+
const manualTimePerIssue = 5; // minutes per issue manually
525+
const autoFixTimePerIssue = 0.35; // minutes per issue with autofix
526+
const estimatedManualHours = (totalActiveIssues * manualTimePerIssue) / 60;
527+
const estimatedAutoFixHours = (autoFixableCount * autoFixTimePerIssue) / 60;
528+
const manualReviewHours = (manualReviewTime * manualTimePerIssue) / 60;
529+
const totalWithBasic = estimatedAutoFixHours + manualReviewHours;
530+
const timeSavedPercent = estimatedManualHours > 0 ? Math.round(((estimatedManualHours - totalWithBasic) / estimatedManualHours) * 100) : 0;
522531

523532
return `
524533
525534
---
526535
527-
### 💼 Time & Cost Analysis
536+
### 💼 Time & Cost Analysis (with IDE Autofix)
537+
538+
| Metric | Manual Fix | With IDE Autofix |
539+
|--------|------------|------------------|
540+
| **Developer Time** | ${estimatedManualHours.toFixed(1)} hours | **${totalWithBasic.toFixed(1)} hours** |
541+
| **Cost (@$${developerRate}/hr)** | $${Math.round(estimatedManualHours * developerRate).toLocaleString()} | **$${Math.round(totalWithBasic * developerRate).toLocaleString()}** |
542+
| **Time Reduction** | — | **${timeSavedPercent}%** ✅ |
528543
529-
| Metric | Manual Fix | With CodeQual BASIC |
530-
|--------|------------|---------------------|
531-
| **Developer Time** | ${baseFixHours.toFixed(1)} hours | **${(baseFixHours - basicTimeSaved).toFixed(1)} hours** |
532-
| **Cost (@$${developerRate}/hr)** | $${totalFixCost.toLocaleString()} | **$${Math.round((baseFixHours - basicTimeSaved) * developerRate).toLocaleString()}** |
533-
| **Time Reduction** | — | **${Math.round((basicTimeSaved / baseFixHours) * 100)}%** ✅ |
544+
*Time savings based on applying ${autoFixableCount} auto-fixable issues via IDE integration (LSP/SARIF files).*
534545
535546
**What BASIC includes:**
536-
- ✅ Pattern-based fixes for ${autoFixableCount} issues (~${patternFixTime} min)
547+
- ✅ Pattern-based fixes for ${autoFixableCount} issues (~${patternFixTime} min via IDE)
537548
- ✅ AI recommendations for IDE agents (Cursor, Copilot)
538549
- ✅ Detailed fix guidance for ${manualReviewTime} remaining issues
550+
- 💡 **Contribute patterns**: When you manually fix issues via IDE, consider contributing the pattern to help others
539551
540552
---
541553
542554
### 💡 Upgrade to PRO
543555
544-
**Reduce ${(baseFixHours - basicTimeSaved).toFixed(1)} hours to ~30 seconds**
556+
**Reduce ${totalWithBasic.toFixed(1)} hours to ~30 seconds** with auto-apply
545557
546558
| Feature | BASIC | PRO |
547559
|---------|-------|-----|

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,7 @@ ${blocking.length > 5 ? `\n... and ${blocking.length - 5} more` : ''}` : '###
270270
- High: ${issues.filter(i => i.severity === 'high').length}
271271
- Medium: ${issues.filter(i => i.severity === 'medium').length}
272272
- Low: ${issues.filter(i => i.severity === 'low').length}
273-
274-
> 💡 **Note**: Auto-fixable count is based on IDE capabilities. See manifest file for exact fixable status per issue.
275-
\`\`\`
276-
277-
> 💡 **Tip**: Copy the markdown above and paste it as a comment on your pull request.`;
273+
\`\`\``;
278274
}
279275

280276
/**

packages/agents/tests/integration/test-v9-lite-e2e.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ const TEST_SCENARIOS: TestScenario[] = [
146146

147147
// Uncomment to run Java calibration:
148148
{
149-
name: 'Spring PetClinic PR #950 - Java Pattern Calibration',
150-
repoUrl: 'https://github.com/spring-projects/spring-petclinic',
149+
name: 'Quarkus Quickstarts PR #1600 - Build Reporter Bump',
150+
repoUrl: 'https://github.com/quarkusio/quarkus-quickstarts',
151151
testMode: 'pr-review',
152-
prNumber: 950,
152+
prNumber: 1600, // Quarkus framework - different from Spring
153153
language: 'java',
154-
expectedFramework: 'spring',
154+
expectedFramework: 'quarkus',
155155
expectedToolCount: 5,
156-
userTier: (process.env.USER_TIER as 'basic' | 'pro') || 'pro', // PRO for pattern learning
156+
userTier: (process.env.USER_TIER as 'basic' | 'pro') || 'pro',
157157
},
158158

159159
// ========================================================================
@@ -1169,7 +1169,10 @@ async function runLiteE2ETest(scenario: TestScenario): Promise<void> {
11691169
fixedButNeedsReview: scanFixResult.fixedButNeedsReview?.length || 0,
11701170
durationMs: scanFixResult.durationMs,
11711171
success: scanFixResult.success,
1172-
} : null
1172+
} : null,
1173+
1174+
// SESSION 92: Pass userTier to formatter for PRO/BASIC tier sections
1175+
userTier: userTier
11731176
};
11741177

11751178
const result = await formatter.generateGroupedReport(

0 commit comments

Comments
 (0)