# Unified Roadmap: mcp-common + session-buddy
**Date**: 2025-10-28
**Duration**: 16 weeks
**Status**: Week 2 Days 1-3 (HTTPClientAdapter implementation)
______________________________________________________________________
## Overview
This roadmap unifies two complementary efforts:
1. **mcp-common**: ACB-native foundation library for 9 MCP servers
1. **session-buddy**: Pilot implementation and validation sandbox
**Key Insight**: session-buddy validates patterns BEFORE they're extracted to mcp-common and rolled out ecosystem-wide.
______________________________________________________________________
## Work Stream Organization
### π΄ Track 1: Critical Path (Serial)
**Focus**: Foundation validation in session-buddy β extraction to mcp-common β ecosystem rollout
**Timeline**: Weeks 1-6
**Priority**: HIGHEST - Blocks 8 other servers
### π‘ Track 2: Parallel Infrastructure
**Focus**: Non-blocking infrastructure development
**Timeline**: Weeks 3-5
**Priority**: HIGH - Quality improvements
### π’ Track 3: Deep Integration
**Focus**: session-buddy advanced features
**Timeline**: Weeks 7-16
**Priority**: MEDIUM - After foundations complete
______________________________________________________________________
## Week-by-Week Roadmap
### Week 1: ACB Foundation β
**COMPLETE**
**Track 1 (Critical Path)**:
- [x] Install ACB framework (`uv add "acb>=0.25.2"`)
- [x] Enable coverage ratchet (35% minimum)
- [x] Enable complexity checks (remove C901 ignore)
- [x] Consolidate config.py with ACB config system (-558 lines)
**Track 2 (Parallel)**:
- [x] Create test stubs for 7 zero-coverage files
**Deliverables**:
- β
ACB framework operational
- β
Config system ACB-native
- β
Coverage ratchet protecting quality
**Status**: β
Complete | **Ecosystem Impact**: Foundation established
______________________________________________________________________
### Week 2: HTTPClientAdapter Validation π **IN PROGRESS**
**Track 1 (Critical Path)**:
- [x] Day 1-3: Implement HTTPClientAdapter in session-buddy β
**DONE**
- [ ] Day 4: Load testing (validate 11x performance improvement)
- [ ] Day 5: Integration testing with real traffic patterns
- [ ] Document HTTPClientAdapter patterns for extraction
**Track 2 (Parallel)**:
- [ ] Create testing utilities documentation
- [ ] Begin cache adapter replacement planning
**Deliverables**:
- β
HTTPClientAdapter implemented and validated
- β
Performance benchmarks showing 11x improvement
- β
Integration tests passing
- β
Pattern documentation for mcp-common extraction
**Status**: 60% complete | **Blockers**: None | **Risk**: π’ Low
**Critical**: This blocks mailgun critical bug fix (Week 3)
______________________________________________________________________
### Week 3: Extraction + Critical Bug Fixes
**Track 1 (Critical Path)**:
- [ ] Day 1: Extract HTTPClientAdapter to mcp-common
- [ ] Day 2-3: Fix mailgun-mcp critical bug (HTTP client reuse)
- Apply HTTPClientAdapter
- Validate 10x performance improvement
- Integration testing
- [ ] Day 4-5: Apply HTTPClientAdapter to 5 remaining standalone servers
- unifi-mcp (also fix tool registration)
- excalidraw-mcp (also fix hardcoded paths)
- opera-cloud-mcp
- raindropio-mcp (already best practices, minimal changes)
- session-buddy (already using it)
**Track 2 (Parallel)**:
- [ ] Extract RateLimiter from crackerjack/mcp/rate_limiter.py
- [ ] Begin security adapter development (sanitization/filtering)
**Deliverables**:
- β
mcp-common v2.0.0-alpha released (HTTPClientAdapter)
- β
mailgun-mcp bug fixed (critical)
- β
unifi-mcp tools working
- β
excalidraw-mcp portable
- β
RateLimiter in mcp-common
**Status**: Not started | **Blockers**: Week 2 completion | **Risk**: π‘ Medium
**Impact**: 6/9 servers using HTTPClientAdapter, 3 critical bugs fixed
______________________________________________________________________
### Week 4: DI Validation + Pattern Extraction
**Track 1 (Critical Path)**:
- [ ] Day 1-3: session-buddy Phase 2.7 - ACB Dependency Injection
- Implement `session_buddy/di/` package
- Apply `depends.inject` to core, quality, tool layers
- Migration: Server core, tool modules to DI
- [ ] Day 4: Validate DI patterns (70%+ coverage on new code)
- [ ] Day 5: Extract DI patterns to `mcp-common/di/`
**Track 2 (Parallel)**:
- [ ] Extract health check pattern to `mcp-common/health.py`
- [ ] Complete security adapters (SanitizerAdapter, FilterAdapter)
- [ ] Testing utilities finalization
**Deliverables**:
- β
Phase 2.7 complete (DI operational in session-buddy)
- β
mcp-common v2.0.0-beta released (HTTP, DI, health)
- β
Security adapters implemented
- β
Pattern documentation complete
**Status**: Not started | **Blockers**: Week 3 completion | **Risk**: π‘ Medium
**Milestone 1 Gate**: Foundation Validated
- If passed β proceed with ecosystem rollout
- If failed β delay 1 week, fix issues
______________________________________________________________________
### Week 5: Ecosystem Rollout (Part 1)
**Track 1 (Critical Path)**:
- [ ] Day 1-2: Apply DI patterns to 3 standalone servers
- mailgun-mcp (already using HTTPClientAdapter)
- opera-cloud-mcp
- raindropio-mcp (minor changes)
- [ ] Day 3-5: Extract shutdown coordinator pattern
- Document graceful shutdown from session-buddy
- Add to `mcp-common/lifecycle/shutdown.py`
**Track 2 (Parallel)**:
- [ ] Replicate health checks across ecosystem (2 hours per server)
- [ ] Replicate shutdown handlers (1 hour per server)
**Deliverables**:
- β
3 servers with full mcp-common adoption
- β
Shutdown coordinator in mcp-common
- β
Health checks deployed ecosystem-wide
**Status**: Not started | **Blockers**: Week 4 completion | **Risk**: π’ Low
______________________________________________________________________
### Week 6: Ecosystem Rollout (Part 2)
**Track 1 (Critical Path)**:
- [ ] Day 1-3: Apply DI + patterns to remaining servers
- unifi-mcp (most complex, thorough testing needed)
- excalidraw-mcp (hybrid Python/TypeScript architecture)
- session-buddy (already using patterns, formalize)
- [ ] Day 4: ACB-integrated servers enhancement
- Add rate limiting to ACB mcp
- Simplify crackerjack mcp (use shared RateLimiter)
- FastBlocks inherits improvements via ACB
- [ ] Day 5: mcp-common v2.0.0 final release
**Deliverables**:
- β
All 9 servers using mcp-common v2.0.0
- β
Ecosystem health: 74 β 82 (+8 points)
- β
mcp-common v2.0.0 production release
**Status**: Not started | **Blockers**: Week 5 completion | **Risk**: π’ Low
**Milestone 2 Gate**: Ecosystem Adoption Complete
- If passed β session-buddy continues Phase 3
- If failed β extend ecosystem work 1 week
**π MAJOR MILESTONE**: mcp-common foundation deployed across all 9 servers!
______________________________________________________________________
### Week 7-8: Template-Based Formatting (session-buddy Phase 3.1)
**Track 3 (Deep Integration)**:
- [ ] Week 7: Build `session_buddy/templates/` hierarchy
- Register Jinja2 loader via DI
- Document data models for template families
- Create TemplateRenderer service
- [ ] Week 8: Migrate formatting functions to templates
- 128 functions from `utils/server_helpers.py`
- Quality engine formatters
- Snapshot testing for regression detection
**Deliverables**:
- β
Template bundle with versioned naming
- β
Renderer service with caching
- β
128 formatting functions replaced (-2,500 lines)
- β
Golden transcript tests passing
**Status**: Not started | **Blockers**: Week 6 completion | **Risk**: π’ Low
**LOC Impact**: 28,113 β 25,613 (-8.9%)
______________________________________________________________________
### Week 9-10: Universal Query Interface (session-buddy Phase 3.2)
**Track 3 (Deep Integration)**:
- [ ] Week 9: Create `session_buddy/adapters/database.py`
- ACB query client with connection pooling
- Query composition helpers
- Parameterized builders
- [ ] Week 10: Convert query consumers
- `reflection_tools.py` to query adapter
- Analytics modules
- Scoring helpers
- Integration tests (80% coverage target)
**Deliverables**:
- β
ACB-backed query adapter operational
- β
Refactored modules using abstractions
- β
Query layer documentation
- β
Load test validation (10 concurrent queries)
**Status**: Not started | **Blockers**: Week 8 completion | **Risk**: π‘ Medium
**LOC Impact**: 25,613 β 24,613 (-3.9%)
**Optional**: Evaluate DuckPGQ knowledge graph for mcp-common extraction
______________________________________________________________________
### Week 11-12: Event-Driven Orchestration (session-buddy Phase 3.3)
**Track 3 (Deep Integration)**:
- [ ] Week 11: Map lifecycle hooks to EventBus
- Define canonical event schema
- Implement `session_buddy/events.py`
- EventBus configuration via DI
- [ ] Week 12: Refactor listeners
- Server core subscribers
- Monitoring module subscribers
- Notification module subscribers
- Add telemetry and replay protection
**Deliverables**:
- β
Event schema catalog
- β
EventBus configuration
- β
Subscriber modules with metrics
- β
End-to-end scenario tests
**Status**: Not started | **Blockers**: Week 10 completion | **Risk**: π‘ Medium
**LOC Impact**: 24,613 β 22,613 (-8.1%)
**ACB Integration**: 0/10 β 9/10 β
______________________________________________________________________
### Week 13-14: Test Coverage Sprint (session-buddy Phase 4)
**Track 3 (Excellence)**:
- [ ] Week 13: Systematic test creation
- All untested paths
- Integration test expansion
- Property-based tests (Hypothesis)
- [ ] Week 14: Advanced testing
- Performance regression tests
- Chaos engineering tests
- Mutation testing validation
**Deliverables**:
- β
Test coverage: 34.6% β 70%
- β
Integration test suite expanded
- β
Chaos tests validating resilience
- β
Mutation testing score 80%+
**Status**: Not started | **Blockers**: Week 12 completion | **Risk**: π’ Low
**Quality Impact**: Coverage ratchet protecting improvements
______________________________________________________________________
### Week 15-16: Performance & Polish (session-buddy Phase 4)
**Track 3 (Excellence)**:
- [ ] Week 15: ACB-enabled optimizations
- Performance profiling
- Query optimization
- Cache tuning
- Memory optimization
- [ ] Week 16: Production preparation
- Documentation updates
- API reference completion
- Deployment guide
- Production monitoring setup
**Deliverables**:
- β
Performance improved (+30-50%)
- β
Test coverage: 70% β 85%+
- β
Quality score: 71 β 95 (+24)
- β
Production deployment ready
- β
Comprehensive documentation
**Status**: Not started | **Blockers**: Week 14 completion | **Risk**: π’ Low
**π FINAL MILESTONE**: World-class reference implementation achieved!
______________________________________________________________________
## Milestone Checkpoints
### Milestone 1: Foundation Validated (End of Week 4)
**Gate Criteria**:
- [ ] HTTPClientAdapter proven (11x performance improvement)
- [ ] DI patterns validated (Phase 2.7 complete)
- [ ] mcp-common v2.0.0-beta released
- [ ] session-buddy using mcp-common adapters
**Go/No-Go Decision**:
- **GO**: Proceed with ecosystem rollout (Weeks 5-6)
- **NO-GO**: Delay 1 week, fix issues, re-evaluate
**Status**: Scheduled for end of Week 4
______________________________________________________________________
### Milestone 2: Ecosystem Adoption (End of Week 6)
**Gate Criteria**:
- [ ] All 9 servers using HTTPClientAdapter
- [ ] mailgun-mcp critical bug fixed (10x improvement)
- [ ] unifi-mcp tools registered and working
- [ ] excalidraw-mcp portable (no hardcoded paths)
- [ ] Health checks + shutdown replicated
- [ ] mcp-common v2.0.0 final release
**Go/No-Go Decision**:
- **GO**: session-buddy continues Phase 3 (deep integration)
- **NO-GO**: Extend ecosystem rollout, address issues
**Status**: Scheduled for end of Week 6
**Success Metrics**:
- Ecosystem health: 74 β 82 (+8)
- Critical bugs: 3 β 0
- Servers with rate limiting: 2/9 β 9/9
- Code duplication: Reduced by 50%
______________________________________________________________________
### Milestone 3: Excellence (End of Week 16)
**Gate Criteria**:
- [ ] session-buddy quality score 95/100
- [ ] Test coverage 85%+
- [ ] ACB integration 9/10
- [ ] Production ready
- [ ] Performance optimized (+30-50%)
- [ ] Documentation complete
**Success Criteria**:
- session-buddy is world-class reference implementation
- Ecosystem average quality 85/100
- Zero critical issues across all 9 servers
**Status**: Scheduled for end of Week 16
______________________________________________________________________
## Success Metrics Dashboard
### Current State (Week 2)
```
session-buddy Metrics
βββ Quality Score: 71/100
βββ Architecture: 90/100 β
(modular)
βββ ACB Integration: 0/10 (Phase 2.7 starting)
βββ Test Coverage: 34.6%
βββ LOC: 28,113
mcp-common Metrics
βββ Status: Week 2 Days 1-3
βββ HTTPClientAdapter: π Implementing
βββ Version: Not yet released
βββ Servers Adopted: 0/9 (session-buddy testing)
Ecosystem Metrics
βββ Average Health: 74/100
βββ Critical Bugs: 3 (mailgun, unifi, excalidraw)
βββ Servers w/ Rate Limit: 2/9 (22%)
βββ Code Duplication: High
```
### Target State (Week 6 - Milestone 2)
```
session-buddy Metrics
βββ Quality Score: 75/100 (+4)
βββ Architecture: 90/100 (maintained)
βββ ACB Integration: 6/10 (+6)
βββ Test Coverage: 55% (+20.4pp)
βββ LOC: 28,113 (stable)
mcp-common Metrics
βββ Status: v2.0.0 released
βββ HTTPClientAdapter: β
Production
βββ Version: 2.0.0
βββ Servers Adopted: 9/9 (100%)
Ecosystem Metrics
βββ Average Health: 82/100 (+8)
βββ Critical Bugs: 0 (-3)
βββ Servers w/ Rate Limit: 9/9 (100%)
βββ Code Duplication: -50%
```
### Final State (Week 16 - Milestone 3)
```
session-buddy Metrics
βββ Quality Score: 95/100 (+24 from start)
βββ Architecture: 95/100 (+5)
βββ ACB Integration: 9/10 (+9)
βββ Test Coverage: 85%+ (+50.4pp)
βββ LOC: 16,000 (-43%)
mcp-common Metrics
βββ Status: v2.0.0 stable
βββ HTTPClientAdapter: β
Proven
βββ Version: 2.0.0
βββ Servers Adopted: 9/9 (100%)
Ecosystem Metrics
βββ Average Health: 85/100 (+11)
βββ Critical Bugs: 0
βββ Servers w/ Rate Limit: 9/9 (100%)
βββ Code Duplication: -70%
```
______________________________________________________________________
## Risk Matrix
| Risk | Probability | Impact | Week | Mitigation |
|------|------------|---------|------|------------|
| **HTTPClientAdapter validation delays** | π‘ Medium (20%) | π΄ High | 2 | Load testing, fallback plan |
| **mailgun fix complications** | π’ Low (10%) | π΄ High | 3 | HTTPClientAdapter proven first |
| **DI pattern complexity** | π‘ Medium (25%) | π‘ Medium | 4 | Simple cases first, gradual adoption |
| **Ecosystem rollout issues** | π’ Low (15%) | π‘ Medium | 5-6 | Incremental per-server rollout |
| **Template migration bugs** | π‘ Medium (20%) | π’ Low | 7-8 | Snapshot testing, gradual migration |
| **Query interface regressions** | π‘ Medium (25%) | π‘ Medium | 9-10 | Output validation, benchmarking |
| **Event system race conditions** | π‘ Medium (30%) | π΄ High | 11-12 | Parallel run, extensive testing |
| **Test coverage timeline pressure** | π’ Low (15%) | π’ Low | 13-14 | Coverage is additive, can extend |
| **Overall Risk** | π’ **LOW** | - | - | Clear critical path, proven patterns |
### Risk Mitigation Strategy
**General Principles**:
1. β
**Feature flags** - All major changes behind toggles
1. β
**Parallel running** - Old and new systems during transition
1. β
**Incremental migration** - Never big-bang changes
1. β
**70%+ coverage** - All new code before merge
1. β
**Monitoring** - Metrics for all critical paths
**Emergency Rollback**:
- Git tags: `phase-1-complete`, `phase-2-complete`, etc.
- Toggle flags: `ACB_CONFIG`, `ACB_CACHE`, `ACB_DI`, etc.
- Original code retained 4 weeks post-migration
______________________________________________________________________
## Key Decisions & Trade-offs
### Decision 1: session-buddy as Pilot
**Rationale**: Most complex standalone server, best validation for ecosystem patterns
**Trade-off**: Delays session-buddy Phase 3 work, but de-risks ecosystem
**Status**: β
Validated - Phase 2 completion proves value
### Decision 2: Extract Health Checks + Shutdown
**Rationale**: "Extra" work proves production-ready patterns
**Trade-off**: Adds 2-3 hours per server to rollout (acceptable)
**Status**: β
Approved - Integration into unified plan (Week 4-5)
### Decision 3: Templates in session-buddy Only
**Rationale**: Unique to session-buddy's verbose output formatting needs
**Trade-off**: Not extracted to mcp-common (may reconsider later)
**Status**: π‘ Deferred - Evaluate at Week 9 for potential extraction
### Decision 4: DuckPGQ as Optional Feature
**Rationale**: Knowledge graph pattern valuable but not universal
**Trade-off**: Not all 9 servers need semantic memory
**Status**: π‘ Optional - Document as optional mcp-common feature (Week 9)
______________________________________________________________________
## Dependencies External to Plan
### Python Ecosystem
- **Python 3.13+** - Required for modern type hints
- **ACB β₯0.25.2** - Framework foundation
- **DuckDB** - Already in dependencies (no new deps)
### Development Tools
- **UV package manager** - For ACB and dependency management
- **pytest + hypothesis** - Testing framework
- **crackerjack** - Code quality enforcement
### Infrastructure
- **Git 2.30+** - For worktree features
- **8GB+ RAM** - For embedding model
- **10GB+ disk** - For test data
**Status**: β
All dependencies already met in session-buddy
______________________________________________________________________
## Communication & Coordination
### Weekly Progress Updates
**Schedule**: Every Friday EOD
**Format**: Markdown report with metrics dashboard
**Distribution**: Architecture Council (you)
**Template**:
```markdown
## Week N Progress Report
**Track 1 (Critical Path)**: [Status]
**Track 2 (Parallel)**: [Status]
**Track 3 (Deep Work)**: [Status]
**Completed**:
- [x] Item 1
- [x] Item 2
**In Progress**:
- [ ] Item 3
**Blocked**:
- [ ] Item 4 (blocker: reason)
**Metrics**:
- Quality: X/100 (ΞY)
- Coverage: X% (ΞY%)
- LOC: X (ΞY)
**Next Week Focus**: [Priority items]
```
### Milestone Reviews
**Schedule**: End of Weeks 4, 6, 16
**Format**: Architecture Council review session
**Deliverables**: Go/No-Go decision, risk reassessment
### Risk Reviews
**Schedule**: Bi-weekly (every 2 weeks)
**Format**: Risk matrix update
**Action**: Update mitigation strategies
______________________________________________________________________
## Appendices
### Appendix A: HTTPClientAdapter Validation Criteria
**Checklist for Week 2 Day 4-5**:
- [ ] Load test: 100 concurrent requests sustained
- [ ] Performance: 11x improvement vs. baseline
- [ ] Connection pooling: Max 100 connections, reuse validated
- [ ] Error handling: Timeout, retry, circuit breaker tested
- [ ] Memory: No leaks over 1000 requests
- [ ] Integration: Works with all session-buddy MCP tools
### Appendix B: DI Pattern Validation Criteria
**Checklist for Week 4**:
- [ ] Simple injection: Logger, config working
- [ ] Complex injection: Database, HTTP client working
- [ ] Override pattern: Tests can mock dependencies
- [ ] Lifecycle: Async resources properly managed
- [ ] Coverage: β₯70% on new DI code
- [ ] Documentation: Pattern guide with examples
### Appendix C: Ecosystem Rollout Checklist
**Per Server**:
- [ ] Install mcp-commonβ₯2.0.0
- [ ] Register package with ACB (`register_pkg`)
- [ ] Migrate to MCPBaseSettings
- [ ] Use HTTPClientAdapter via DI
- [ ] Add rate limiting (`@rate_limit`)
- [ ] Add security adapters (sanitize/filter)
- [ ] Write tests with DI mocking
- [ ] Add ServerPanels for UI
- [ ] Update documentation
- [ ] Health checks operational
- [ ] Graceful shutdown working
### Appendix D: Quality Gates
**Every Commit**:
- [ ] Ruff, Pyright, Bandit passing
- [ ] Complexity β€15 per function
- [ ] Coverage maintained or increased
- [ ] Tests passing
**Every Phase**:
- [ ] Architecture review
- [ ] Performance benchmarks
- [ ] Integration tests passing
- [ ] Documentation updated
______________________________________________________________________
**Document Status**: π’ **ACTIVE ROADMAP**
**Next Review**: End of Week 4 (Milestone 1)
**Owner**: Architecture Council
**Last Updated**: 2025-10-28