Skip to content

Commit 7e87682

Browse files
committed
Refactor analysis, design, documentation, and YAML steps to implement Sequential Authority workflow for enhanced efficiency and clarity
1 parent 55747f1 commit 7e87682

File tree

4 files changed

+144
-49
lines changed

4 files changed

+144
-49
lines changed

src/processor/src/libs/steps/analysis_step.py

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -727,9 +727,17 @@ async def execute_analysis(
727727
raise RuntimeError(
728728
"Analysis orchestrator not initialized - critical failure"
729729
)
730-
# Define analysis task for expert agents
730+
# Define analysis task for expert agents with Sequential Authority pattern
731731
analysis_task = """
732-
**ANALYSIS STEP OBJECTIVE**: Comprehensive source platform analysis and file discovery for Azure migration
732+
🚨🔥 **SEQUENTIAL AUTHORITY PROTOCOL - ANALYSIS PHASE** 🔥🚨
733+
734+
**ANALYSIS STEP OBJECTIVE**: Comprehensive source platform analysis and file discovery for Azure migration using Sequential Authority pattern for maximum efficiency
735+
736+
**🎯 SEQUENTIAL AUTHORITY WORKFLOW**:
737+
1. **Foundation Leader**: Chief Architect performs initial comprehensive analysis and file discovery
738+
2. **Enhancement Specialist**: Platform Expert (EKS/GKE/Other) validates platform identification and adds specialized insights
739+
3. **Final Validator**: QA Engineer verifies completeness and accuracy of analysis results
740+
4. **Documentation Specialist**: Technical Writer ensures report quality and structure
733741
734742
**📚 MICROSOFT DOCS STRATEGIC RESEARCH**:
735743
Reference strategic usage guide: docs/MicrosoftDocsStrategicUsage.md
@@ -754,16 +762,24 @@ async def execute_analysis(
754762
4. **Azure Migration Readiness**: Initial assessment of migration complexity and considerations
755763
5. **File-by-File Analysis**: Detailed breakdown of each configuration file
756764
757-
**EXPERT RESPONSIBILITIES**:
758-
- Chief Architect: Lead comprehensive analysis, coordinate team, provide strategic oversight
759-
- Platform Expert (EKS/GKE): Deep platform identification, source-specific patterns and considerations
760-
- Azure Expert: Azure migration context, service mapping possibilities, complexity assessment
765+
**🎯 SEQUENTIAL AUTHORITY EXPERT RESPONSIBILITIES**:
766+
- **Chief Architect (Foundation Leader)**: Lead comprehensive analysis, execute ALL MCP operations for file discovery and initial analysis, coordinate team workflow, provide strategic oversight
767+
- **Platform Expert (Enhancement Specialist)**: Validate platform identification, add source-specific patterns and considerations, enhance Chief Architect's analysis
768+
- **QA Engineer (Final Validator)**: Verify completeness and accuracy of analysis results, validate file discovery and platform identification
769+
- **Technical Writer (Documentation Specialist)**: Ensure report quality, structure, and clarity for next step consumption
770+
771+
**🚀 EFFICIENCY OPTIMIZATION**:
772+
- Chief Architect performs ALL initial MCP operations (file discovery, content reading, analysis)
773+
- Platform Expert enhances and validates WITHOUT redundant MCP calls
774+
- QA Engineer validates results WITHOUT re-discovering files
775+
- Technical Writer focuses on documentation quality WITHOUT redundant analysis
761776
762777
**SUCCESS CRITERIA**:
763778
- All source files discovered with complete metadata
764779
- Platform definitively identified with high confidence
765780
- Multi-dimensional complexity fully assessed
766781
- Azure migration pathway clearly identified
782+
- Sequential Authority workflow followed for maximum efficiency
767783
768784
**MANDATORY DUAL OUTPUT**:
769785
1. Create a comprehensive **analysis_result.md** file in {{output_file_folder}} (for human consumption)
@@ -840,13 +856,36 @@ async def execute_analysis(
840856
},
841857
"summary": "Comprehensive analysis completed: [Platform] with [X] files analyzed",
842858
"expert_insights": [
843-
"Chief architect provided strategic migration framework",
844-
"Platform expert identified critical source platform patterns",
845-
"Azure expert assessed migration complexity and service mappings"
859+
"Chief Architect (Foundation Leader) provided comprehensive analysis framework and executed all MCP operations",
860+
"Platform Expert (Enhancement Specialist) validated platform identification and added specialized insights",
861+
"QA Engineer (Final Validator) verified completeness and accuracy of analysis results",
862+
"Technical Writer (Documentation Specialist) ensured report quality and structure"
846863
],
864+
"sequential_authority_workflow": {
865+
"foundation_leader": "Chief Architect",
866+
"enhancement_specialist": "Platform Expert",
867+
"final_validator": "QA Engineer",
868+
"documentation_specialist": "Technical Writer",
869+
"mcp_operations_performed_by": "Chief Architect",
870+
"efficiency_achieved": "~75% reduction in redundant MCP operations"
871+
},
847872
"analysis_file": "{{output_file_folder}}/analysis_result.md"
848873
}
849874
```
875+
876+
**🛑 SEQUENTIAL AUTHORITY TERMINATION RULES**:
877+
878+
1. **Foundation Leader (Chief Architect)**: Execute ALL MCP operations for file discovery and analysis
879+
2. **Enhancement Specialist (Platform Expert)**: Validate and enhance WITHOUT redundant MCP calls
880+
3. **Final Validator (QA Engineer)**: Verify results and completeness WITHOUT re-executing discovery
881+
4. **Documentation Specialist (Technical Writer)**: Focus on report quality WITHOUT additional analysis
882+
883+
**TERMINATION ENFORCEMENT**:
884+
- Only Chief Architect should perform list_blobs_in_container, read_blob_content, check_blob_exists
885+
- Platform Expert should enhance platform identification using Chief Architect's findings
886+
- QA Engineer should validate completeness using existing results
887+
- Technical Writer should ensure professional documentation quality
888+
- NO agent should duplicate MCP operations performed by the Foundation Leader
850889
"""
851890

852891
# Using Template and replace values

src/processor/src/libs/steps/design_step.py

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,20 @@ async def execute_design(
942942

943943
# Define enhanced design task leveraging analysis results
944944
design_task = """
945-
**🎯 COMPREHENSIVE AZURE ARCHITECTURE DESIGN OBJECTIVE**: Create intelligent Azure architecture recommendations based on detailed analysis results
945+
**🚨🔥 SEQUENTIAL AUTHORITY - DESIGN STEP 🔥🚨**
946+
947+
**🎯 COMPREHENSIVE AZURE ARCHITECTURE DESIGN OBJECTIVE**: Create intelligent Azure architecture recommendations using Sequential Authority workflow
948+
949+
**SEQUENTIAL AUTHORITY WORKFLOW FOR DESIGN STEP**:
950+
1. **Azure Expert (Foundation Leader)**: Perform ALL MCP operations and create comprehensive design foundation
951+
2. **Platform Expert (Enhancement Specialist)**: Enhance foundation with specialized source platform migration insights
952+
3. **Chief Architect (Final Validator)**: Validate design completeness and architectural soundness
953+
4. **Technical Writer (Documentation Specialist)**: Ensure design report meets documentation standards
954+
955+
**🚀 EFFICIENCY MANDATE**:
956+
- Azure Expert performs ALL MCP operations (analysis reading, source file discovery, Microsoft docs research)
957+
- Enhancement Specialists enhance WITHOUT redundant MCP operations
958+
- Expected ~75% reduction in redundant operations through Sequential Authority
946959
947960
**📊 ANALYSIS INTELLIGENCE CONTEXT**:
948961
- Migration Type: {{migration_type}}
@@ -953,7 +966,6 @@ async def execute_design(
953966
- Source Folder(Kubernetes manifest files) : {{source_file_folder}}
954967
- Overall Complexity: {{overall_complexity}}
955968
956-
957969
**📁 DESIGN SCOPE**:
958970
- Analysis Results: {{output_file_folder}}/analysis_result.md
959971
- Source folder: {{source_file_folder}}
@@ -969,34 +981,40 @@ async def execute_design(
969981
- Storage Complexity: {{storage_complexity}}
970982
- Compute Complexity: {{compute_complexity}}
971983
972-
**[TOOLS] STRATEGIC MICROSOFT DOCS RESEARCH METHODOLOGY**:
973-
You have access to comprehensive Microsoft Azure documentation tools. **MANDATORY TWO-STEP RESEARCH PROCESS**:
974-
975-
**🔍 STEP 1 - SEARCH FOR DISCOVERY**:
984+
**[TOOLS] STRATEGIC MICROSOFT DOCS RESEARCH METHODOLOGY - AZURE EXPERT FOUNDATION LEADER ONLY**:
985+
**🚨 CRITICAL: ONLY AZURE EXPERT (FOUNDATION LEADER) EXECUTES MCP OPERATIONS 🚨**
986+
987+
**🔍 STEP 1 - SEARCH FOR DISCOVERY (Azure Expert Foundation Leader Only)**:
976988
Use `microsoft_docs_search` to identify relevant documentation:
977989
- **Azure Architecture Center**: Search "{{platform_detected}} to Azure migration reference architecture"
978990
- **Service Documentation**: Search "AKS configuration", "Application Gateway setup", "Azure Storage options"
979991
- **Migration Best Practices**: Search "{{migration_type}} migration best practices", "Azure migration guidelines"
980992
- **Security Standards**: Search "Azure security baseline {{overall_complexity}} complexity"
981-
982-
**📚 STEP 2 - FETCH FOR COMPREHENSIVE DETAILS**:
993+
994+
**📚 STEP 2 - FETCH FOR COMPREHENSIVE DETAILS (Azure Expert Foundation Leader Only)**:
983995
Use `microsoft_docs_fetch` on URLs from search results to get complete information:
984996
- **Complete Configuration Guides**: Full YAML examples, parameter references, troubleshooting
985997
- **Step-by-Step Procedures**: End-to-end migration workflows, implementation checklists
986998
- **Architecture Patterns**: Complete reference architectures with detailed component specifications
987999
- **Security Implementation**: Full security configuration guides, compliance requirements
988-
989-
**🎯 STRATEGIC FETCH TRIGGERS**:
1000+
1001+
**🎯 STRATEGIC FETCH TRIGGERS (Azure Expert Foundation Leader Only)**:
9901002
- When you need complete YAML/JSON configuration syntax
9911003
- When search results mention "detailed guide" or "complete tutorial"
9921004
- When implementing complex multi-service architectures
9931005
- When addressing security or compliance requirements
9941006
995-
**BEFORE STARTING DESIGN**:
1007+
**BEFORE STARTING DESIGN (Azure Expert Foundation Leader Only)**:
9961008
1. Verify analysis_result.md exists: check_blob_exists('analysis_result.md', container_name='{{container_name}}', folder_path='{{output_file_folder}}')
9971009
2. List available source files: list_blobs_in_container(container_name='{{container_name}}', folder_path='{{source_file_folder}}')
9981010
3. If files missing, report specific missing files and request Analysis step rerun
9991011
1012+
**SEQUENTIAL AUTHORITY ENFORCEMENT**:
1013+
- **Azure Expert**: Complete ALL foundation work including MCP operations, analysis reading, and initial design
1014+
- **Enhancement Specialists**: Enhance Azure Expert's foundation WITHOUT redundant MCP calls
1015+
- **Final Validator**: Validate enhanced design WITHOUT re-executing research operations
1016+
- **Documentation Specialist**: Finalize design report using validated enhanced design
1017+
10001018
**TROUBLESHOOTING FILE ACCESS**:
10011019
If you cannot access required files:
10021020
1. List all containers: list_containers()
@@ -1010,11 +1028,11 @@ async def execute_design(
10101028
3. **{{platform_detected}}-to-Azure Migration Strategy**: Tailored approach based on source platform
10111029
4. **Risk-Informed Implementation Plan**: Address concerns identified in analysis phase
10121030
1013-
**👥 EXPERT COORDINATION WITH ANALYSIS CONTEXT**:
1014-
- **Chief Architect**: Strategic design leadership leveraging {{files_count}} files analysis
1015-
- **{{platform_detected}} Expert**: Source platform expertise for accurate Azure mapping
1016-
- **Azure Expert**: {{target_platform}} architecture optimized for {{overall_complexity}} complexity
1017-
- **Security Architect**: Address security complexity: {{security_complexity}}
1031+
**👥 SEQUENTIAL AUTHORITY EXPERT COORDINATION**:
1032+
- **Azure Expert (Foundation Leader)**: Complete foundation design including ALL MCP operations, analysis reading, and Microsoft docs research
1033+
- **{{platform_detected}} Expert (Enhancement Specialist)**: Enhance Azure foundation with specialized source platform migration insights
1034+
- **Chief Architect (Final Validator)**: Validate enhanced design for architectural soundness and completeness
1035+
- **Technical Writer (Documentation Specialist)**: Finalize validated design with professional documentation standards
10181036
10191037
**✅ ENHANCED SUCCESS CRITERIA**:
10201038
- Complete Azure architecture addressing all {{files_count}} analyzed files
@@ -1208,7 +1226,7 @@ async def execute_design(
12081226
process_id,
12091227
"Conversation_Manager",
12101228
"experts_collaborating",
1211-
"Expert collaboration in progress - Azure Expert, Technical Architect, and platform experts working together",
1229+
"Expert collaboration in progress - Azure Expert, Chief Architect, and platform experts working together",
12121230
)
12131231

12141232
orchestration_result = await self._orchestrator.invoke(

src/processor/src/libs/steps/documentation_step.py

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,17 @@ async def agent_response_callback(message: ChatMessageContent):
694694
return
695695

696696
def _create_standard_documentation_task(self) -> str:
697-
"""Create enhanced comprehensive migration documentation task template utilizing rich step data."""
697+
"""Create enhanced comprehensive migration documentation task template utilizing rich step data with Sequential Authority pattern."""
698698
return """
699-
**🎯 COMPREHENSIVE MIGRATION DOCUMENTATION OBJECTIVE**: Generate professional migration report leveraging ALL step data
699+
🚨🔥 **SEQUENTIAL AUTHORITY PROTOCOL - DOCUMENTATION PHASE** 🔥🚨
700+
701+
**🎯 COMPREHENSIVE MIGRATION DOCUMENTATION OBJECTIVE**: Generate professional migration report leveraging ALL step data using Sequential Authority pattern for maximum efficiency
702+
703+
**🎯 SEQUENTIAL AUTHORITY WORKFLOW**:
704+
1. **Foundation Leader**: Technical Writer performs initial report creation and ALL MCP operations
705+
2. **Enhancement Specialist**: Azure Expert enhances with Azure-specific insights and optimizations
706+
3. **Final Validator**: Chief Architect validates executive readiness and technical consistency
707+
4. **Documentation Specialist**: QA Engineer ensures quality and completeness for delivery
700708
701709
**📊 MIGRATION OVERVIEW**:
702710
- Source Platform: {{source_platform}} (Confidence: {{platform_confidence}})
@@ -781,23 +789,34 @@ def _create_standard_documentation_task(self) -> str:
781789
- Best practices and lessons learned compilation
782790
- Platform-specific considerations and Azure optimization strategies
783791
784-
**👥 EXPERT RESPONSIBILITIES WITH ENHANCED CONTEXT**:
785-
- **Chief Architect**: Create executive-ready assessment using {{migration_readiness_score}} readiness score, validate architectural consistency across {{architecture_decisions_count}} decisions
786-
- **{{source_platform}} Expert**: Document platform-specific insights from {{total_files_analyzed}} file analysis, address {{migration_concerns_count}} platform concerns
787-
- **Azure Expert**: Provide detailed guidance on {{azure_services_count}} Azure services, optimize configurations for {{overall_conversion_accuracy}} conversion accuracy
788-
- **Technical Writer**: Create professional documentation integrating {{total_expert_insights}} expert insights with clear structure and actionable recommendations
792+
**🎯 SEQUENTIAL AUTHORITY EXPERT RESPONSIBILITIES**:
793+
- **Technical Writer (Foundation Leader)**: Execute ALL MCP operations (read previous step files, create migration_report.md), coordinate comprehensive report creation, establish document structure and quality
794+
- **Azure Expert (Enhancement Specialist)**: Enhance with Azure-specific insights, optimization strategies, and service recommendations WITHOUT redundant MCP operations
795+
- **Chief Architect (Final Validator)**: Validate executive readiness, technical consistency, and architectural alignment WITHOUT re-reading files
796+
- **QA Engineer (Documentation Specialist)**: Ensure quality, completeness, and delivery readiness WITHOUT redundant content operations
797+
798+
**🚀 EFFICIENCY OPTIMIZATION**:
799+
- Technical Writer performs ALL MCP operations (read_blob_content for previous step files, save_content_to_blob for migration_report.md)
800+
- Azure Expert enhances WITHOUT redundant file reading
801+
- Chief Architect validates WITHOUT re-accessing previous files
802+
- QA Engineer ensures quality WITHOUT redundant content operations
803+
- Expected ~75% reduction in redundant MCP operations compared to parallel collaboration
789804
790805
**✅ SUCCESS CRITERIA WITH MEASURABLE OUTCOMES**:
791806
- Complete utilization of analysis data from {{total_files_analyzed}} files
792807
- Full integration of {{azure_services_count}} Azure service recommendations
793808
- Comprehensive conversion analysis of {{total_files_converted}} converted files
794809
- Executive-ready summary with {{migration_readiness_score}} readiness assessment
795810
- Technical implementation guide with {{architecture_decisions_count}} architectural decisions
811+
- Sequential Authority workflow followed for maximum efficiency
796812
797813
**📤 MANDATORY OUTPUT STRUCTURE**:
798814
- **migration_report.md** in {{output_file_folder}}
799-
- all participants should actively collaborate to co-author and edit the migration report
800-
- Ensure clarity, professionalism, and actionable insights through team collaboration
815+
- Technical Writer (Foundation Leader) creates the report collaboratively with Sequential Authority enhancement
816+
- Ensure clarity, professionalism, and actionable insights through Sequential Authority workflow
817+
- **CRITICAL**: Don't delete, modify, or clean up any existing files from previous steps (analysis, design, conversion results)
818+
- **READ-ONLY FOR PREVIOUS RESULTS**: Only Technical Writer reads from existing previous step files for reference, never modify them
819+
- **SEQUENTIAL CREATION**: Technical Writer creates migration_report.md, Azure Expert enhances, Chief Architect validates, QA Engineer finalizes
801820
- **COLLABORATIVE APPROACH**: Actively work together to create the best possible migration report
802821
- **CRITICAL**: Don't delete, modify, or clean up any existing files from previous steps (analysis, design, conversion results)
803822
- **READ-ONLY FOR PREVIOUS RESULTS**: Only read from existing previous step files for reference, never modify them

0 commit comments

Comments
 (0)