V4 Source Code Reference
This document describes the source code copied from the coditect-v4 submodule for reference and potential integration.
Overview
All directories are prefixed with v4- to clearly distinguish them from the current t2 project source code.
Directory Mapping
| Original (coditect-v4) | Copied To (t2) | Size | Description |
|---|---|---|---|
src/frontend | src/frontend-original | 2.6M | React frontend with TypeScript |
src/ai-prompt-refiner-server-client | src/v4-ai-prompt-refiner-server-client | 1.0M | AI prompt refinement service |
src/graph-rag | src/v4-graph-rag | 904K | Graph-based RAG implementation |
src/api-v2 | src/v4-api-v2 | 432K | API v2 backend (Rust/Axum) |
src/dspy-service | src/v4-dspy-service | 148K | DSPy integration service |
src/websocket-gateway | src/v4-websocket-gateway | 104K | WebSocket gateway for real-time |
src/sdk | src/v4-sdk | 60K | TypeScript SDK |
src/terminal-core | src/v4-terminal-core | 56K | terminal core functionality |
src/coditect-server | src/v4-coditect-server | 8K | CODI server stub |
src/terminal | src/v4-terminal | 8K | terminal wrapper |
src/feedback-service | src/v4-feedback-service | 4K | Feedback collection service |
Total Size: ~5.3MB
Purpose
These directories serve as reference implementations for:
- Frontend Integration - Compare React frontend with Eclipse theia approach
- API Design - Review Rust/Axum API patterns for FoundationDB integration
- Real-time Features - WebSocket gateway architecture
- AI Integration - Prompt refinement and DSPy patterns
- terminal - xterm.js integration patterns
Current t2 Project Structure
The t2 project is building on Eclipse theia (NOT building from scratch) with:
src/browser/- theia browser extensions (llm integration, etc.)src/agents/- Multi-agent systemsrc/services/- Core services (llm, MCP, A2A, FDB)src/file-monitor/- Rust file monitoring (active development)
Integration Strategy
Do NOT Copy Directly
The v4 code is a traditional web app. The t2 project is building theia extensions.
Use as Reference
- API Patterns (
v4-api-v2) - FoundationDB integration patterns - WebSocket (
v4-websocket-gateway) - Real-time communication approach - Frontend Components (
frontend-original) - UI patterns (adapt for theia) - SDK (
v4-sdk) - TypeScript type definitions
Key Differences
| Aspect | V4 (Reference) | T2 (Current) |
|---|---|---|
| IDE | Custom React app | Eclipse theia extensions |
| editor | Custom Monaco integration | theia's Monaco |
| terminal | Custom xterm.js | theia's terminal |
| File Tree | Custom component | theia's file explorer |
| Build | Vite | theia build (Webpack) |
| Architecture | Standalone web app | Extension-based |
When to Reference V4 Code
✅ Good reasons to reference:
- Understanding FoundationDB keyspace patterns
- WebSocket message formats
- API endpoint design
- Type definitions
- UI component styling ideas
❌ Bad reasons to reference:
- Copying IDE features (theia has them)
- editor implementation (use theia's)
- File tree implementation (use theia's)
- terminal implementation (use theia's)
Related Documentation
- Main CLAUDE.md - Project guidance at
/workspace/PROJECTS/t2/CLAUDE.md - ADR-014 - Eclipse theia decision (why NOT building from scratch)
- Architecture - System design at
docs/architecture/architecture.md - File Monitor - Rust implementation at
src/file-monitor/
Cleanup Strategy
After extracting needed patterns and types:
- Document what was learned/extracted
- Create integration guides for specific features
- Consider archiving reference code to reduce clutter
- Keep only actively referenced directories
Notes
- Copied: 2025-10-06
- Source: coditect-v4 submodule (commit as of 2025-10-06)
- All symlinks preserved with
cp -a - Total: 11 directories, ~5.3MB
Remember: These are reference implementations for a traditional web app. The t2 project is building theia extensions, not a standalone IDE.