Overview
Establish an explicit Input Layer in the presentation structure by creating src/presentation/input/ and moving the CLI module there. This is the first step in transforming the presentation layer into a four-layer architecture (Input → Dispatch → Controllers → Views).
Parent Epic: #154 - Presentation Layer Reorganization
Related: Refactor Plan | Design Proposal
Impact: 🟢🟢 Medium - Clear separation of user input parsing from command execution
Effort: 🔵🔵 Medium - Straightforward move with import updates
Estimated Time: 2-3 hours
Goals
🏗️ Architecture Requirements
DDD Layer: Presentation
Module Path: src/presentation/input/
Pattern: Input Layer (Layer 1 of 4-layer presentation architecture)
Target Structure
After this proposal:
src/presentation/
├── input/ # ← NEW: Layer 1 - Input parsing
│ ├── mod.rs # Re-exports cli module
│ └── cli/ # ← MOVED from presentation/cli/
│ ├── mod.rs # Main CLI structure
│ └── global.rs # Global arguments
├── commands/ # ← UNCHANGED (for now)
├── user_output/ # ← UNCHANGED (for now)
├── progress.rs # ← UNCHANGED (for now)
└── errors.rs # ← UNCHANGED
Implementation Plan
Phase 1: Create Directory Structure (30 minutes)
Phase 2: Move CLI Module (30 minutes)
Phase 3: Update Imports (60 minutes)
Phase 4: Documentation Updates (30 minutes)
Phase 5: Testing & Verification (30 minutes)
Acceptance Criteria
Note for Contributors: These criteria define what the PR reviewer will check. Use this as your pre-review checklist before submitting the PR.
Quality Checks:
Structure:
Imports:
Functionality:
Documentation:
Mergeable State:
📚 Related Documentation
Created: November 6, 2025
Next Action: Begin Phase 1 (Create Directory Structure)
Overview
Establish an explicit Input Layer in the presentation structure by creating
src/presentation/input/and moving the CLI module there. This is the first step in transforming the presentation layer into a four-layer architecture (Input → Dispatch → Controllers → Views).Parent Epic: #154 - Presentation Layer Reorganization
Related: Refactor Plan | Design Proposal
Impact: 🟢🟢 Medium - Clear separation of user input parsing from command execution
Effort: 🔵🔵 Medium - Straightforward move with import updates
Estimated Time: 2-3 hours
Goals
src/presentation/input/directory with proper module structuresrc/presentation/cli/tosrc/presentation/input/cli/presentation::clitopresentation::input::clicommands/,user_output/) remains functional🏗️ Architecture Requirements
DDD Layer: Presentation
Module Path:
src/presentation/input/Pattern: Input Layer (Layer 1 of 4-layer presentation architecture)
Target Structure
After this proposal:
Implementation Plan
Phase 1: Create Directory Structure (30 minutes)
src/presentation/input/directorysrc/presentation/input/mod.rswith module documentationPhase 2: Move CLI Module (30 minutes)
src/presentation/cli/tosrc/presentation/input/cli/src/presentation/cli/directoryPhase 3: Update Imports (60 minutes)
src/presentation/mod.rs:pub mod input;src/main.rs:use torrust_tracker_deployer_lib::presentation::input::cli::Cli;rg "use.*presentation::cli" --type rustpresentation::input::cliPhase 4: Documentation Updates (30 minutes)
README.mdif it references presentation structurePhase 5: Testing & Verification (30 minutes)
./scripts/pre-commit.shcargo run -- --help, etc.Acceptance Criteria
Quality Checks:
./scripts/pre-commit.shStructure:
src/presentation/input/directory existssrc/presentation/input/mod.rscontains module documentationsrc/presentation/input/cli/contains moved CLI modulesrc/presentation/cli/directory removedImports:
presentation::clitopresentation::input::clicargo buildcompletes without warningsFunctionality:
--helpoutput unchangedcommands/,user_output/) still functionalDocumentation:
input/mod.rsexplains input layer purposeMergeable State:
📚 Related Documentation
Created: November 6, 2025
Next Action: Begin Phase 1 (Create Directory Structure)