feat: [#156] Implement Dispatch Layer with ExecutionContext wrapper#161
Merged
Conversation
- Create ExecutionContext wrapper around Container for future-proof command signatures - Implement router::route_command function to handle command dispatch - Update bootstrap::app to use new dispatch layer instead of presentation::execute - Mark old presentation::execute as deprecated with migration guide - Add comprehensive documentation and ADR explaining ExecutionContext design choice The ExecutionContext wrapper provides: - Future-proof command signatures (can add context without breaking handlers) - Clear abstraction for command execution (vs dependency injection container) - Command-specific service access patterns - Enhanced testability with different execution contexts Closes Phase 3-5 of issue #156 implementation plan.
68 tasks
91e042c to
73abd3b
Compare
- Add ExecutionContext wrapper around Arc<Container> for future-proof command signatures - Implement central command routing in route_command function - Create comprehensive dispatch layer with router and context modules - Update bootstrap/app.rs to use new dispatch layer instead of direct presentation::execute - Mark old presentation::execute as deprecated with migration guide - Add ExecutionContext wrapper ADR documenting design decisions - Fix doctest compilation errors and linting issues - Add 'configurator' to project dictionary for spell checking The dispatch layer establishes clear separation between command routing, execution context, and command execution, following the four-layer presentation architecture: Input → Dispatch → Controllers → Views
73abd3b to
aa531e3
Compare
Member
Author
|
ACK aa531e3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Overview
This PR implements Proposal 2: Create Dispatch Layer from the presentation layer reorganization epic (#154).
The Dispatch Layer establishes clear separation between command routing, execution context, and command execution, following the four-layer presentation architecture: Input → Dispatch → Controllers → Views.
📋 What's Implemented
Core Components
Arc<Container>for future-proof command signaturesroute_command(command, working_dir, &context)functionbootstrap/app.rsto use new dispatch layerpresentation::executeas deprecated with migration guideDocumentation & Quality
docs/decisions/execution-context-wrapper.mddocumenting design rationale🏗️ Architecture Benefits
ExecutionContext Design
The dispatch layer uses an
ExecutionContextwrapper instead of passingContainerdirectly:Benefits:
Routing Architecture
Benefits:
🔧 Module Structure
✅ Quality Validation
All quality checks pass:
📖 Related Documentation
docs/decisions/execution-context-wrapper.md- Design rationale for ExecutionContext wrappersrc/presentation/dispatch/mod.rs🚀 Next Steps
After this PR is merged:
🔍 Migration Guide
For code using the old
presentation::executefunction:Closes: #156
Part of Epic: #154