6.6 KiB
MotoVaultPro Simplification - AI Agent Coordination
Overview
This directory contains comprehensive documentation for executing the MotoVaultPro simplification using multiple AI agents working in parallel. The goal is to transform the current 14-container microservices architecture into a streamlined 6-container stack.
Architecture Transformation
Current State (14 containers)
- traefik, admin-frontend, admin-backend, admin-postgres, admin-redis, admin-minio
- mvp-platform-landing, mvp-platform-tenants, mvp-platform-vehicles-api
- platform-postgres, platform-redis, mvp-platform-vehicles-db, mvp-platform-vehicles-redis, mvp-platform-vehicles-etl
Target State (6 containers)
- mvp-traefik - Reverse proxy and SSL termination
- mvp-frontend - React application
- mvp-backend - Fastify API server
- mvp-postgres - PostgreSQL database
- mvp-redis - Redis cache
- mvp-platform - Simplified vehicles service
Key Simplifications
- Remove Multi-Tenancy - Application already uses user_id isolation
- Replace MinIO - Use filesystem storage with mounted volume
- Consolidate Databases - 3 PostgreSQL instances → 1 instance
- Consolidate Caches - 3 Redis instances → 1 instance
- Simplify Platform Service - Remove ETL pipeline and MSSQL dependency
- Consistent Naming - All services use mvp-* prefix
Documentation Structure
Core Documentation
- README.md (this file) - Master coordination document
- AGENT-MANIFEST.md - Agent assignments and dependency graph
- DEPENDENCY-GRAPH.md - Visual phase dependencies
- FILE-MANIFEST.md - Complete file change inventory
- VALIDATION-CHECKLIST.md - Success criteria and validation steps
- ROLLBACK-STRATEGY.md - Rollback procedures
- EXECUTION-STATE.json - Shared state tracking (runtime)
Phase Documentation (11 files)
- PHASE-01-DOCKER-COMPOSE.md - Container renaming and docker-compose.yml
- PHASE-02-REMOVE-TENANT.md - Multi-tenant architecture removal
- PHASE-03-FILESYSTEM-STORAGE.md - MinIO to filesystem migration
- PHASE-04-CONFIG-CLEANUP.md - Configuration and secrets cleanup
- PHASE-05-NETWORK-SIMPLIFICATION.md - Network architecture updates
- PHASE-06-BACKEND-UPDATES.md - Backend code updates
- PHASE-07-DATABASE-UPDATES.md - Database schema updates
- PHASE-08-PLATFORM-SERVICE.md - mvp-platform service simplification
- PHASE-09-DOCUMENTATION.md - Documentation updates
- PHASE-10-FRONTEND-UPDATES.md - Frontend updates
- PHASE-11-TESTING.md - Testing and validation
Agent Execution Strategy
8 Specialized Agents
- infra-agent - Phases 1, 5, 7 (Docker, networks, databases)
- backend-agent - Phases 2, 6 (Backend code)
- storage-agent - Phase 3 (MinIO to filesystem)
- platform-agent - Phase 8 (mvp-platform service)
- config-agent - Phase 4 (Configuration cleanup)
- frontend-agent - Phase 10 (Frontend updates)
- docs-agent - Phase 9 (Documentation)
- test-agent - Phase 11 (Testing and validation)
Execution Waves
Wave 1 (Parallel - No Dependencies):
- config-agent (Phase 4)
- docs-agent (Phase 9)
Wave 2 (Parallel - After Wave 1):
- infra-agent starts (Phase 1)
- backend-agent starts (Phase 2)
- storage-agent starts (Phase 3)
Wave 3 (Parallel - After Wave 2):
- infra-agent continues (Phases 5, 7)
- backend-agent continues (Phase 6)
- platform-agent starts (Phase 8)
Wave 4 (Sequential):
- frontend-agent (Phase 10)
Wave 5 (Sequential - Validates Everything):
- test-agent (Phase 11)
Getting Started
For Orchestration AI
-
Read Core Documentation:
- AGENT-MANIFEST.md - Understand agent assignments
- DEPENDENCY-GRAPH.md - Understand execution order
- FILE-MANIFEST.md - Understand file changes
-
Spawn Agents in Waves:
Wave 1: config-agent, docs-agent Wave 2: infra-agent, backend-agent, storage-agent (wait for Wave 1) Wave 3: Continue Wave 2 agents, add platform-agent Wave 4: frontend-agent (wait for backend-agent) Wave 5: test-agent (wait for all) -
Monitor Execution:
- Track EXECUTION-STATE.json for phase completion
- Watch for conflict notifications
- Validate each wave before starting next
For Individual Agents
-
Read Assignment:
- Check AGENT-MANIFEST.md for your phases
- Review DEPENDENCY-GRAPH.md for prerequisites
-
Execute Phases:
- Read PHASE-*.md for detailed instructions
- Follow step-by-step procedures
- Run validation checks
- Update EXECUTION-STATE.json
-
Coordinate:
- Check for file locks before modifying
- Report conflicts in AGENT-LOG.md
- Wait for dependent phases to complete
Success Criteria
Per-Phase Success
- All validation checks pass
- No file conflicts
- Changes follow coding standards
Integration Success
make rebuildsucceeds- All 6 containers start healthy
make testpasses (all tests green)- No functionality regressions
Final Acceptance
- 14 → 6 containers running
- 5 → 3 networks configured
- Multi-tenant code removed
- MinIO replaced with filesystem
- Platform service simplified
- Documentation updated
- All tests passing
Timeline Estimate
Sequential Execution: ~8-12 hours Parallel Execution (8 agents): ~2-3 hours (60-70% time reduction)
Risk Mitigation
- Git Branching: Each phase works on feature branch
- Incremental Validation: Test after each phase
- Rollback Capability: Each phase documents rollback
- Conflict Detection: File locks prevent concurrent edits
- State Tracking: EXECUTION-STATE.json tracks progress
Communication Protocols
State Updates
Agents update EXECUTION-STATE.json when:
- Starting a phase
- Completing a phase
- Encountering conflicts
- Requiring coordination
Conflict Resolution
If file conflict detected:
- Agent creates lock file
- Other agent waits
- First agent completes work
- Lock released
- Second agent proceeds
Error Handling
If phase fails:
- Agent reports in EXECUTION-STATE.json
- Dependent phases are blocked
- Orchestrator decides: retry or rollback
- Follow ROLLBACK-STRATEGY.md if needed
Next Steps
- Orchestration AI: Review AGENT-MANIFEST.md
- Spawn Wave 1: config-agent and docs-agent
- Monitor Progress: Track EXECUTION-STATE.json
- Spawn Wave 2: After Wave 1 completes
- Continue Through Waves: Until test-agent passes
Questions or Issues
Refer to specific phase documentation for detailed guidance. Each PHASE-*.md file contains:
- Step-by-step instructions
- Validation criteria
- Rollback procedures
- Conflict resolution guidance