Commit e3d207a
fix(critical): Integrate AI enrichment pipeline in v9-report-compiler (BUG #89)
CRITICAL P0 FIX: AI enrichment was completely bypassed in the report compilation pipeline.
PROBLEM:
- v9-report-compiler.ts called formatIssue() directly without AI enrichment
- Issues went straight from categorization → formatting, bypassing 99% of AI infrastructure
- All BUG #89 components (specialized-agents.ts, ai-enrichment.ts, v9-grouped-report-formatter.ts)
were implemented but never invoked
- Reports always used fallback hardcoded descriptions instead of AI-generated ones
ROOT CAUSE (src/two-branch/services/v9-report-compiler.ts:236):
- Batch processing loop called formatIssue() on raw issues
- No call to enrichIssuesWithAI() before formatting
- modelConfigResolver was passed but never used
SOLUTION:
1. Import enrichIssuesWithAI from ai-enrichment.ts (line 22)
2. Extract issues for enrichment before batch processing (lines 231-234)
3. Group issues for efficient AI processing (1 call per group, lines 234-236)
4. Call enrichIssuesWithAI() with modelConfigResolver (lines 239-259)
5. Add critical P0 error handling and logging:
- 🚨 CRITICAL alert if modelConfigResolver is null
- 🚨 Full stack trace logging on enrichment failure
- Graceful fallback to un-enriched issues (formatter uses hardcoded DB)
6. Use enriched issues in batch processing (lines 262-271)
IMPACT:
- ✅ AI enrichment now runs for all issue groups (cost-optimized: 1 call per group)
- ✅ Reports will show AI-generated structured descriptions (what/why/causes/impact)
- ✅ BUG #89 infrastructure fully activated
- ✅ Clear P0 alarms if AI enrichment fails (not silent failure)
VERIFICATION:
- TypeScript compilation: PASSED (no errors)
- E2E test: Tools executed successfully, issues found and categorized
- Expected logs: [AI Enrichment Pipeline], [BUG #89] in production
FILES CHANGED:
- packages/agents/src/two-branch/services/v9-report-compiler.ts (+38 lines)
- Added enrichIssuesWithAI import
- Integrated AI enrichment call before batch processing
- Added critical error handling and P0 logging
RELATED:
- Fixes BUG #89 (Structured AI Descriptions)
- Completes P0 Issue #3 (fixed in commit ad508e3)
- Depends on: specialized-agents.ts, ai-enrichment.ts, v9-grouped-report-formatter.ts
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ad508e3 commit e3d207a
1 file changed
Lines changed: 43 additions & 3 deletions
Lines changed: 43 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
227 | 267 | | |
228 | 268 | | |
229 | | - | |
230 | | - | |
231 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
232 | 272 | | |
233 | 273 | | |
234 | 274 | | |
| |||
0 commit comments