Files
proffesor-for-testing__agen…/scripts/debug-parser-state.ts
Profa dc91c7d39c feat(code-intelligence): complete Waves 3-5 implementation
Wave 3 - Incremental Indexing & Embeddings:
- IncrementalIndexer with content hashing and change detection
- FileWatcher with debouncing and pattern matching
- GitChangeDetector for commit-based change tracking
- ASTChunker with semantic boundaries (avg 847 tokens)
- NomicEmbedder with Ollama nomic-embed-text integration

Wave 4 - Knowledge Graph:
- GraphBuilder with SQL-based node/edge storage
- RelationshipExtractor for inheritance, calls, implements
- ImportParser for multi-language import resolution
- TestMapper for test-to-source file correlation

Wave 5 - Hybrid Search & RAG:
- BM25Search with TF-IDF ranking
- VectorSearch with pgvector/in-memory fallback
- HybridSearchEngine with RRF fusion (k=60)
- CodeChunkStore for PostgreSQL persistence
- CodeIntelligenceHybridRouter for embeddings
- ContextBuilder and GraphExpander for RAG
- SemanticRetriever for context-aware retrieval

Infrastructure:
- Separate Jest configs for code-intelligence tests
- Worker isolation to prevent tree-sitter corruption
- Fixed FileWatcher timer issues (real timers)
- 467 tests passing, 4 skipped (Ollama-only)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 08:22:26 +00:00

41 lines
1.2 KiB
TypeScript

import { ASTChunker } from '../src/code-intelligence/chunking/ASTChunker.js';
import { TreeSitterParser } from '../src/code-intelligence/parser/TreeSitterParser.js';
// Simulate benchmark test's beforeAll
const astChunker = new ASTChunker({
maxTokens: 512,
overlapPercent: 15,
});
const sampleCode = `
export class UserService {
private users: Map<string, User> = new Map();
async createUser(email: string): Promise<User> {
return { email };
}
}
`;
const result = astChunker.chunkFile('/src/services/UserService.ts', sampleCode, 'typescript');
console.log('ASTChunker result chunks:', result.chunks.length);
// Now simulate TreeSitterParser test's beforeAll
const parser = new TreeSitterParser();
// Now test if the parser works
const content = `
class Test {
private static async getData(): Promise<void> {}
}
`;
const parseResult = parser.parseFile('test.ts', content, 'typescript');
console.log('\nParser test results:');
for (const e of parseResult.entities) {
console.log(' Entity:', e.name, e.type);
console.log(' visibility:', e.metadata?.visibility);
console.log(' isStatic:', e.metadata?.isStatic);
console.log(' isAsync:', e.metadata?.isAsync);
}