The-Agency/docs/legacy/FULL_PARITY_ROADMAP.md

371 lines
11 KiB
Markdown

# Full Parity Roadmap: Complete Implementation Plan
**Scope:** 100% feature parity with `old_repo/` (TypeScript reference)
**Current state:** 55-60% (core functionality complete)
**Missing:** 40-45% (advanced features, secondary commands, UI parity)
---
## Gap Analysis: What's Missing for Full Parity
### CRITICAL GAPS (Block Real Usage)
#### 1. Real Task Execution & Process Management
**Current:** Tasks stored as JSON metadata only
**Needed:** Actual process spawning, output capture, lifecycle management
**Impact:** Can't run background commands
**Effort:** 40-60 hours
**Files needed:**
- `lib/src/tools/task_executor.dart` — Run tasks as sub-processes
- `lib/src/services/process_manager.dart` — Manage child processes
- `lib/src/tools/task_stop_tool.dart` — Real process termination
- Update `lib/src/tools/task_tool.dart` — Wire to executor
**Implementation:**
```dart
// Example of what's missing:
class TaskExecutor {
Future<ProcessResult> executeTask(Task task);
Stream<String> watchOutput(String taskId);
Future<void> terminateTask(String taskId);
// Real process management, not just metadata
}
```
#### 2. Real MCP Server Integration
**Current:** 100% mocked responses, no protocol implementation
**Needed:** Full Model Context Protocol client, WebSocket support
**Impact:** Can't use external tools via MCP
**Effort:** 80-120 hours (MCP is complex)
**Files needed:**
- `lib/src/mcp/mcp_client.dart` — WebSocket client
- `lib/src/mcp/mcp_protocol.dart` — Protocol implementation
- `lib/src/mcp/mcp_server_manager.dart` — Server lifecycle
- Update `lib/src/tools/mcp_tool.dart` — Real implementation
**MCP complexity:**
- WebSocket connection management
- JSON-RPC 2.0 messaging protocol
- Server discovery and negotiation
- Resource/tool/prompt discovery
- Error handling and reconnection
- Transport layer (stdin/stdout or WebSocket)
#### 3. Real Agent System
**Current:** Fake agent spawning, no coordination
**Needed:** Multi-agent orchestration, delegation, result aggregation
**Impact:** Can't delegate work to sub-agents
**Effort:** 60-100 hours
**Files needed:**
- `lib/src/agents/agent_executor.dart` — Run agents
- `lib/src/agents/agent_coordinator.dart` — Orchestrate multiple agents
- `lib/src/agents/agent_context.dart` — Context passing
- Update `lib/src/tools/agent_tool.dart` — Real implementation
**Agent architecture needed:**
- Agent spawning as isolated executions
- Inter-agent communication
- Result aggregation
- Failure handling and retry logic
---
### MAJOR GAPS (Missing Features)
#### 4. Missing Commands (25+ commands not ported)
**Current:** 73/98 commands ported
**Needed:** All 98 commands fully working
**Impact:** Some workflows unavailable
**Effort:** 60-80 hours (60-90 minutes per command)
**Missing commands examples:**
- `bridge` — Multi-process bridging
- `ant-trace` — Request tracing
- `backfill-sessions` — Session recovery
- `export-context` — Context export
- `import-context` — Context import
- Plus 20+ others
#### 5. Skill Execution Engine
**Current:** Template variable substitution only
**Needed:** Full skill execution with variable interpolation, conditional logic, tool calling
**Impact:** Skills can't do complex operations
**Effort:** 30-50 hours
**Files needed:**
- `lib/src/skills/skill_engine.dart` — Execute skill logic
- `lib/src/skills/skill_parser.dart` — Parse skill definitions
- `lib/src/skills/skill_context.dart` — Execution context
#### 6. Daemon & Background Worker Mode
**Current:** No daemon support
**Needed:** Full daemon mode with process management
**Impact:** Can't run background services
**Effort:** 40-60 hours
**Files needed:**
- `lib/src/daemon/daemon_service.dart` — Daemon lifecycle
- `lib/src/daemon/session_worker.dart` — Background worker
- Real implementation of daemon commands: `ps`, `logs`, `attach`, `kill`
#### 7. Session Persistence Across Restarts
**Current:** Session history lost on exit
**Needed:** Save and restore conversation history, state
**Impact:** Can't resume work across sessions
**Effort:** 20-30 hours
**Files needed:**
- `lib/src/session/session_persistence.dart` — Save/load sessions
- Update `lib/src/chat/repl_handler.dart` — Integrate persistence
#### 8. Desktop UI / Multi-Modal Interface
**Current:** CLI only
**Needed:** Rich UI (Flutter integration, browser UI, or native UI)
**Impact:** No visual interface
**Effort:** 100-200 hours (major undertaking)
**What's involved:**
- Complete UI redesign
- Input/output handling for GUI
- Progress indicators and status UI
- File browser integration
- Code editor integration
---
### MEDIUM GAPS (Quality & Completeness)
#### 9. Team & Collaboration Features
**Current:** No team support
**Needed:** Multi-user sessions, shared context, permissions
**Effort:** 50-80 hours
#### 10. Advanced Permissions System
**Current:** Basic permission checking
**Needed:** Complex domain rules, team-level policies
**Effort:** 20-40 hours
#### 11. Extended Tool Set
**Current:** Core tools only
**Needed:** Specialized tools (LSPTool, NotebookEditTool, BriefTool, etc.)
**Effort:** 40-60 hours (multiple specialized tools)
#### 12. Full Bridge System
**Current:** Basic bridge support
**Needed:** Complete bridge protocol for multi-process communication
**Effort:** 30-50 hours
---
## Effort Breakdown
| Category | Hours | Impact |
|----------|-------|--------|
| Task execution | 50 | HIGH — blocks workflows |
| MCP protocol | 100 | HIGH — blocks external tools |
| Agent system | 80 | HIGH — blocks delegation |
| Missing commands | 70 | MEDIUM — incomplete feature set |
| Skill engine | 40 | MEDIUM — incomplete features |
| Daemon mode | 50 | MEDIUM — background jobs |
| Session persistence | 25 | LOW — convenience feature |
| Team features | 65 | LOW — not needed for single-user |
| UI/Desktop | 150 | LOW — separate from CLI |
| Extended tools | 50 | LOW — specialized use cases |
| Bridge system | 40 | LOW — advanced feature |
| **TOTAL** | **720** | **~3 weeks full-time** |
---
## Prioritized Implementation Path for Full Parity
### Phase 1: Critical Path (190 hours) — BLOCKS REAL USAGE
**Completion time:** 1-2 weeks full-time
1. **Real Task Execution** (50 hours) — Users can run background jobs
- Process spawning via Dart `Process.start()`
- Output streaming
- Signal handling (SIGTERM, SIGKILL)
- Lifecycle management
2. **Real MCP Protocol** (100 hours) — Users can use external tools
- WebSocket client (use `web_socket_channel` package)
- JSON-RPC messaging
- Server lifecycle (start/stop)
- Tool and resource discovery
- Result aggregation
3. **Real Agent System** (40 hours) — Users can delegate work
- Agent spawning (subprocess or remote)
- Context passing
- Result collection
- Error handling
**Result:** Full interactive workflow capability
---
### Phase 2: Major Features (155 hours) — COMPLETES FEATURE SET
**Completion time:** 1-2 weeks full-time
4. **Port Remaining 25 Commands** (70 hours)
- Batch similar commands together
- Reuse patterns from existing commands
- ~3 hours per command average
5. **Skill Execution Engine** (40 hours)
- Parse skill format
- Interpolate variables
- Execute embedded tools
- Handle conditionals
6. **Daemon Mode** (45 hours)
- Implement daemon lifecycle
- Session worker model
- Real `ps`, `logs`, `attach`, `kill` commands
**Result:** All documented features work
---
### Phase 3: Quality & Polish (125 hours) — PRODUCTION READY
**Completion time:** 1 week full-time
7. **Session Persistence** (25 hours) — Resume across restarts
8. **Team Features** (65 hours) — Multi-user support
9. **Extended Tools** (35 hours) — Specialized tools
**Result:** Enterprise-grade feature set
---
### Phase 4: UI Parity (150+ hours) — OPTIONAL
**Completion time:** 2-3 weeks full-time
10. **Desktop UI** (150 hours) — Visual interface equivalent
- This is a separate major project
- Could be Flutter, Electron, or web-based
**Result:** Feature-complete desktop application
---
## Current Status vs. Full Parity
```
CURRENT (55-60%):
├── ✅ REPL (100%)
├── ✅ Model integration (100%)
├── ✅ Core tools (100%)
├── ✅ Permissions (100%)
├── ✅ Cost tracking (100%)
├── ⚠️ Commands (70%)
├── ❌ Task execution (0% — stubbed)
├── ❌ MCP protocol (0% — mocked)
├── ❌ Agent system (0% — fake)
├── ❌ Skill engine (5% — template only)
├── ❌ Daemon mode (0%)
├── ❌ Session persistence (0%)
├── ❌ Team features (0%)
└── ❌ UI parity (0%)
FULL PARITY (100%):
└── Everything above: 100%
```
---
## What You're Asking For
**"Full parity" means:**
- ✅ All 98 commands work
- ✅ Real background task execution
- ✅ Real MCP servers accessible
- ✅ Real agent system working
- ✅ Session history persists
- ✅ All tools available
- ✅ Team collaboration works
- ✅ UI equivalent available
**Estimated effort:** 720 hours (~3 weeks at 40 hrs/week, or 3 months part-time)
**Reality:** This is a substantial implementation effort, equivalent to building a major feature.
---
## Recommendation: What Should We Prioritize?
To reach full parity most efficiently:
**Option A: Prioritize Usability First (Recommended)**
1. Real task execution (50 hrs)
2. Real MCP protocol (100 hrs)
3. Real agent system (40 hrs)
4. Port missing commands (70 hrs)
5. Skill engine (40 hrs)
6. Daemon mode (45 hrs)
7. Session persistence (25 hrs)
8. Team features (65 hrs)
9. Extended tools (50 hrs)
10. UI (optional, 150 hrs)
**This gets you:** 100% feature parity for interactive workflows
---
**Option B: Prioritize Command Coverage First**
1. Port all 25 missing commands first (70 hrs)
2. Then phase through rest
**This gets you:** All commands available but some features stubbed
---
**Option C: Core-First Approach (Current)**
1. Keep core functional path (done)
2. Expand incrementally as needed
3. Add features on-demand
**This gets you:** Gradual improvement without committing to full scope
---
## Questions Before Proceeding
Before I start implementing full parity, clarify:
1. **Which features matter most to you?**
- Task execution? (critical)
- MCP? (critical)
- Agents? (important)
- Commands? (important)
- UI? (nice-to-have)
- Team features? (nice-to-have)
2. **What's your timeline?**
- Need it in 1 week? (core only)
- Need it in 1 month? (most features)
- Need it eventually? (full parity)
3. **What's the use case?**
- Interactive CLI tool?
- Background service?
- Team collaboration?
- Production system?
4. **Should we focus on specific gaps first?**
- Task execution first?
- MCP first?
- Commands first?
---
## My Recommendation
Based on impact-to-effort ratio, I'd suggest this order:
1. **Real task execution** (50 hrs) — Unblocks workflows
2. **Real MCP protocol** (100 hrs) — Unblocks external integrations
3. **Missing commands** (70 hrs) — Completes feature set
4. **Skill engine** (40 hrs) — Enables complex automations
**This = 260 hours = 1 full month dedicated effort for 90% parity**
UI can wait. Team features can wait. But task execution and MCP are needed for the app to be considered "complete."
Would you like me to start with Phase 1 (task execution + MCP)? That's the critical path for full functionality.