Skip to content

Commit 4e96e2a

Browse files
alpslaclaude
andcommitted
feat: V8 Analyzer Migration to Two-Branch Architecture
Major session accomplishments: - Migrated core V8 analyzer files from standard to two-branch directory - Created comprehensive bug reports (BUG-073, BUG-074) for remaining work - Updated import paths and created service stubs for compatibility - Established migration strategy for oversized files (>500 lines) Files Migrated: ✅ v8-base-analyzer.ts (945 lines) - Core analyzer functionality ✅ v8-java-analyzer.ts (443 lines) - Java-specific implementation ✅ v8-rust-analyzer.ts (397 lines) - Rust-specific implementation ✅ v8-html-generator.ts (375 lines) - Report HTML generation ✅ dynamic-model-selector.ts (stub) - Service compatibility layer Remaining Work (Critical): ❌ V8 report generators (large files in standard directory) ❌ File size compliance (split 945-line files per CLAUDE.md) ❌ Complete import path updates across codebase Architecture Benefits: - Consolidated V8 functionality in active development branch - Eliminated cross-directory dependencies - Prepared for standard directory removal - Documented compliance violations and solutions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e445298 commit 4e96e2a

458 files changed

Lines changed: 101393 additions & 74760 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxx
2828
TOGETHER_API_KEY=your-together-api-key
2929
VOYAGE_API_KEY=pa-xxxxxxxxxxxx
3030

31-
# DeepWiki Configuration
32-
DEEPWIKI_API_KEY=dw-key-xxxxxxxxxxxx
33-
3431
# MCP Tool API Keys
3532
REF_API_KEY=your-ref-api-key # Get from https://www.perplexity.ai/api
3633
# Note: MCP tools run in-process, no separate servers needed for cloud deployment

CLAUDE.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ packages/
4545
__tests__/
4646
comparison.test.ts
4747
services/
48-
deepwiki-api-wrapper.ts
4948
__tests__/
50-
deepwiki-api-wrapper.test.ts
5149
infrastructure/
5250
supabase/
5351
redis/
@@ -241,31 +239,31 @@ import { describe, it, expect, beforeEach, jest } from '@jest/globals';
241239

242240
describe('ComparisonAgent', () => {
243241
let agent: ComparisonAgent;
244-
let mockDeepWikiService: jest.Mocked<DeepWikiService>;
242+
let mockAnalysisService: jest.Mocked<AnalysisService>;
245243

246244
beforeEach(() => {
247-
mockDeepWikiService = createMockDeepWikiService();
248-
agent = new ComparisonAgent(mockDeepWikiService);
245+
mockAnalysisService = createMockAnalysisService();
246+
agent = new ComparisonAgent(mockAnalysisService);
249247
});
250248

251249
describe('analyzeRepository', () => {
252250
it('should successfully analyze a valid repository', async () => {
253251
// Arrange
254252
const repoUrl = 'https://github.com/test/repo';
255-
mockDeepWikiService.analyze.mockResolvedValue(mockAnalysisResult);
253+
mockAnalysisService.analyze.mockResolvedValue(mockAnalysisResult);
256254

257255
// Act
258256
const result = await agent.analyzeRepository(repoUrl);
259257

260258
// Assert
261259
expect(result).toBeDefined();
262260
expect(result.issues).toHaveLength(3);
263-
expect(mockDeepWikiService.analyze).toHaveBeenCalledWith(repoUrl);
261+
expect(mockAnalysisService.analyze).toHaveBeenCalledWith(repoUrl);
264262
});
265263

266264
it('should handle API errors gracefully', async () => {
267265
// Arrange
268-
mockDeepWikiService.analyze.mockRejectedValue(new Error('API Error'));
266+
mockAnalysisService.analyze.mockRejectedValue(new Error('API Error'));
269267

270268
// Act & Assert
271269
await expect(agent.analyzeRepository('invalid-url'))
@@ -297,14 +295,14 @@ export class ValidationError extends Error {
297295
}
298296
}
299297

300-
export class DeepWikiAPIError extends Error {
298+
export class AnalysisAPIError extends Error {
301299
constructor(
302300
message: string,
303301
public statusCode?: number,
304302
public response?: unknown
305303
) {
306304
super(message);
307-
this.name = 'DeepWikiAPIError';
305+
this.name = 'AnalysisAPIError';
308306
}
309307
}
310308

@@ -319,8 +317,8 @@ async function processAnalysis(data: unknown): Promise<AnalysisResult> {
319317
logger.warn('Validation failed:', error.message);
320318
throw new BadRequestError(error.message);
321319
}
322-
if (error instanceof DeepWikiAPIError) {
323-
logger.error('DeepWiki API error:', error);
320+
if (error instanceof AnalysisAPIError) {
321+
logger.error('Analysis API error:', error);
324322
throw new ServiceUnavailableError('Analysis service temporarily unavailable');
325323
}
326324
logger.error('Unexpected error:', error);
@@ -374,8 +372,6 @@ const envSchema = z.object({
374372
PORT: z.string().transform(Number).default('3000'),
375373
DATABASE_URL: z.string().url(),
376374
REDIS_URL: z.string().url().optional(),
377-
DEEPWIKI_API_URL: z.string().url(),
378-
DEEPWIKI_API_KEY: z.string(),
379375
SUPABASE_URL: z.string().url(),
380376
SUPABASE_SERVICE_ROLE_KEY: z.string(),
381377
OPENROUTER_API_KEY: z.string(),
@@ -386,7 +382,7 @@ const envSchema = z.object({
386382
export const config = envSchema.parse(process.env);
387383

388384
// Type-safe config usage
389-
const apiUrl = config.DEEPWIKI_API_URL;
385+
// Use config properties as needed
390386
```
391387

392388
## 🏗️ Data Models and Validation
@@ -457,7 +453,7 @@ Types: feat, fix, docs, style, refactor, test, chore, perf
457453

458454
Example:
459455
```
460-
feat(agents): add retry logic for DeepWiki API calls
456+
feat(agents): add retry logic for API calls
461457
462458
- Implement exponential backoff strategy
463459
- Add configurable max retry attempts

apps/api/src/services/deepwiki-alerts.ts

Lines changed: 0 additions & 224 deletions
This file was deleted.

0 commit comments

Comments
 (0)