# Changelog
All notable changes to `mecha10-cli` will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.1.21] - 2025-12-29
## [0.1.20] - 2025-12-28
## [0.1.19] - 2025-12-28
## [0.1.18] - 2025-12-28
## [0.1.17] - 2025-12-27
## [0.1.16] - 2025-12-27
## [0.1.15] - 2025-12-18
### Changed (Branch: p3)
#### Architecture Migration - Complete 3-Layer Pattern
- ✅ **Commands Layer**: All commands converted to pure `clap::Args` structs
- 31 command files, all <100 lines
- Zero business logic in command definitions
- Clean separation of CLI parsing and execution
- ✅ **Handlers Layer**: Complete orchestration refactor
- 26 handlers implementing the CliContext pattern
- All handlers use `ctx.service()` accessors
- Proper UI/UX handling (spinners, progress bars, error messages)
- No business logic - pure orchestration
- ✅ **Services Layer**: Business logic extraction
- 12 fully-featured services with comprehensive APIs
- `DockerService`: Container and compose operations (72 tests)
- `RedisService`: Redis connection management (32 tests)
- `ConfigService`: Project configuration (33 tests)
- `ProjectService`: Project structure and validation (42 tests)
- `SimulationService`: Godot simulation generation (42 tests)
- `ProcessService`: Child process management (27 tests)
- `TemplateService`: Code generation (12 tests)
- `ComponentCatalogService`: Component discovery (6 tests)
- `TopicMonitorService`: Redis stream topic monitoring (4 tests) ✨ NEW
- `DiscoveryService`: Network node discovery
- `DeploymentService`: Deployment operations
- `PackageService`: Package management
- ✅ **UI Components Layer**: Reusable terminal UI components
- `InteractiveMenu`: Terminal-based keyboard navigation (223 lines) ✨ NEW
- Supports up/down arrows, Enter to select, Esc to cancel
- Used by topics command, can be reused by other handlers
- ✅ **CliContext**: Unified context pattern
- Lazy-initialized service accessors
- Shared configuration across all handlers
- Environment validation
- Builder pattern for flexible construction
#### Quality Improvements
- ✅ Zero compilation errors achieved
- ✅ All clippy warnings resolved
- ✅ Comprehensive test coverage (392 tests passing)
- ✅ 70-75% test coverage across services
#### Command Implementations
**Topics Command** - Complete 3-layer refactoring ✨:
- ✅ Migrated from mixed architecture to clean 3-layer separation
- ✅ Created `TopicMonitorService` for Redis stream monitoring
- ✅ Created `InteractiveMenu` UI component for reusable terminal menus
- ✅ Reduced handler from 427→137 lines (-68%)
- ✅ `mecha10 topics list` - Interactive topic browser with real-time monitoring
- ✅ Fully uses CliContext pattern
**Init Command** - Functional but needs refactoring:
- ✅ `mecha10 init` - Complete project scaffolding
- ✅ Interactive wizard for project creation
- ✅ Template support (basic, rover, arm, humanoid)
- ✅ Example node generation (speaker, listener)
- ✅ Development mode with local framework support
- ⚠️ Handler is 1187 lines (needs refactoring - see [CLI_INIT_ARCHITECTURE_REVIEW.md](../../CLI_INIT_ARCHITECTURE_REVIEW.md))
**Other Commands**:
- ✅ `mecha10 dev` - Development mode with hot-reload
- ✅ `mecha10 build` - Project building
- ✅ `mecha10 run` - Production runtime
- ✅ `mecha10 sim` - Simulation management
- ✅ `mecha10 deploy` - Deployment orchestration
- ✅ `mecha10 logs` - Log viewing
- ✅ `mecha10 status` - Project status
- ✅ `mecha10 clean` - Artifact cleanup
- ✅ `mecha10 quality` - Code quality checks
- ✅ `mecha10 package` - Package operations
### Added
- Library API exports for programmatic use
- Comprehensive rustdoc documentation
- Service module system with clear boundaries
- Handler test utilities
- Context builder with environment precedence
### Technical Debt
See [CLI_ARCHITECTURE.md](../../docs/architecture/CLI_ARCHITECTURE.md#technical-debt) for details:
- ❌ `handlers/init.rs`: 1187 lines (HIGH priority - refactoring plan available)
- See [CLI_INIT_ARCHITECTURE_REVIEW.md](../../CLI_INIT_ARCHITECTURE_REVIEW.md) for detailed plan
- Needs extraction to `InitService` and `ProjectTemplateService`
- ✅ `handlers/topics.rs`: RESOLVED - reduced from 427→137 lines (-68%)
- ⚠️ Some services exceed 400-line limit (simulation.rs, process.rs, project.rs, etc.)
- ⚠️ discovery.rs in commands/ contains logic (should be service or removed)
- 📋 Refactoring plans documented with priorities
### Migration Notes
- All commands maintain backward compatibility
- No breaking API changes for end users
- Library exports provide programmatic access
- Comprehensive examples in lib.rs documentation
### Notes
- Not yet published to crates.io
- Currently in active development (branch: p3)
- Breaking changes may occur before 1.0.0
- Architecture now matches documented patterns