Run An Orchestration Cycle For Enabler Tasks
In this comprehensive guide, we will walk you through the process of executing an orchestration cycle focused on enabler tasks. This process ensures the smooth progression of dependent tasks within your workflow. We'll cover everything from configuration parameters to execution instructions, success criteria, and deliverables. Whether you're a seasoned DevOps engineer or just starting with task orchestration, this guide will provide you with the knowledge and steps to effectively manage your workflows.
Configuration Parameters (Optional)
To tailor the iteration behavior to your specific needs, you can adjust the following parameters:
- max_tasks: This parameter defines the maximum number of tasks that can be executed in a single iteration. Setting an appropriate value helps manage resource utilization and prevents overwhelming the system. The default value is set to 8, providing a balanced approach for most scenarios.
- scope_focus: This parameter is crucial for prioritizing tasks. In this context, we focus on Enabler tasks, which are tasks that unblock other tasks. By prioritizing these, we ensure that the workflow progresses efficiently, avoiding bottlenecks and delays. Focusing on enabler tasks means that other types of work might be temporarily blocked, highlighting the importance of strategic prioritization.
- priority_threshold: This parameter sets the minimum priority level for tasks to be included in the current iteration. By setting it to high, we ensure that only critical and high-priority tasks are addressed, optimizing resource allocation and addressing the most pressing issues first. This approach allows for a focused and efficient execution cycle.
- mode: This parameter determines the execution mode for the iteration. In this case, we're using Execution mode, indicating that the tasks will be actively executed. This mode is essential for driving progress and ensuring that the workflow moves forward.
Understanding and adjusting these configuration parameters is key to optimizing your orchestration cycle. Each parameter plays a crucial role in shaping the behavior of the iteration, allowing you to fine-tune the process to meet your specific requirements and constraints.
Objective
The primary objective of this orchestration cycle is to execute pending tasks in the work queue using a file-based orchestration approach. The core focus is on tasks that enable other tasks to progress. This prioritization ensures that dependencies are resolved efficiently, leading to smoother workflow execution. By concentrating on these critical enabler tasks, we aim to unlock progress across the entire project, minimizing delays and maximizing productivity.
This objective aligns with the broader goal of optimizing resource utilization and accelerating the completion of project milestones. By systematically addressing tasks that have the greatest impact on subsequent activities, we ensure that the workflow remains fluid and responsive to changing priorities. This approach is particularly valuable in complex projects where task dependencies can significantly influence overall timelines.
Context
To understand the current operational environment, consider the following context points:
- Orchestration Framework: The orchestration framework is implemented and production-ready, as indicated by PR #16. This means the foundational infrastructure for task management and execution is in place and has been validated. A production-ready framework ensures that the orchestration process is stable and reliable, providing a solid base for efficient task handling.
- Approach: We are utilizing a file-based orchestration approach, as detailed in
.github/agents/approaches/file-based-orchestration.md. This approach involves managing tasks and their states using files, which allows for a transparent and easily auditable workflow. File-based orchestration offers flexibility and simplicity, making it suitable for a variety of project scales and complexities. - Work Directory: The designated work directory is
work/, which contains several subdirectories for managing tasks:inbox,assigned,done,logs, andcollaboration. This structured directory system facilitates efficient task tracking and management, ensuring that all relevant information is organized and accessible. Each subdirectory serves a specific purpose in the task lifecycle, from initial submission to completion and archiving. - Agent Profiles: Agent profiles are defined in
.github/agents/*.agent.md. These profiles outline the capabilities and responsibilities of each agent, ensuring that tasks are delegated to the appropriate resources. Agent profiles are crucial for effective task distribution and accountability, enabling a clear understanding of who is responsible for each task. - Directives: Directives are stored in
.github/agents/directives/. These directives provide guidelines and standards for task execution, ensuring consistency and quality across all activities. Adhering to directives is essential for maintaining a standardized approach to task management and ensuring that best practices are followed. - Mode: The current mode for task execution is
/analysis-mode. This mode likely indicates that the tasks are being executed in an analytical or experimental environment, which may involve additional monitoring and validation steps. Understanding the execution mode is important for interpreting task outcomes and making informed decisions about next steps.
Current Status
Before initiating the iteration, it's crucial to assess the current status of the workflow. Manager Mike is responsible for filling in or verifying the current status using the work/scripts/template-status-checker.sh script. This script automates the process of checking the number of tasks in various stages, providing a quick overview of the workflow's progress. Alternatively, a manual check can be performed using the following commands:
bash work/scripts/template-status-checker.sh
Manual alternative:
echo "Inbox: $(ls work/inbox/*.yaml 2>/dev/null | wc -l) tasks"
echo "Assigned: $(find work/assigned -name '*.yaml' 2>/dev/null | wc -l) tasks"
echo "Done: $(find work/done -name '*.yaml' 2>/dev/null | wc -l) tasks"
These commands provide a count of tasks in the inbox, assigned, and done directories, giving a snapshot of the current workload and task distribution. This status check is essential for informed decision-making during the task selection phase.
Execution Instructions
Follow these steps to execute the orchestration cycle effectively:
1. Initialize
- Initialize as Manager Mike: Begin by initializing the environment as Manager Mike, following the guidelines in
AGENTS.md. This ensures that you have the necessary permissions and context to manage the orchestration cycle. Proper initialization is crucial for maintaining security and accountability. - Read
work/collaboration/AGENT_STATUS.md: Review theAGENT_STATUS.mdfile to understand the current context of the agents and their activities. This file provides valuable insights into the overall workflow status and any ongoing issues. Staying informed about the agent status is vital for effective task management. - Verify orchestration framework operational status: Confirm that the orchestration framework is operational before proceeding. This ensures that the underlying infrastructure is functioning correctly and can support the execution of tasks. Verifying the framework's status helps prevent unexpected issues during the orchestration cycle.
2. Task Selection
- Check
work/inbox/: Examine thework/inbox/directory to identify pending tasks that need to be processed. The inbox serves as the initial entry point for new tasks, making it the first place to look for work. A thorough review of the inbox ensures that no tasks are overlooked. - Run
python work/scripts/agent_orchestrator.py: Execute theagent_orchestrator.pyscript to automatically assign tasks to agents based on their profiles and capabilities. This script streamlines the task distribution process, ensuring that tasks are assigned efficiently. Automation of task assignment reduces manual effort and minimizes the risk of errors. - Identify top priority tasks: Determine the highest priority tasks based on the following criteria:
- Priority order: Tasks are prioritized in the order of critical, high, medium, and normal. This hierarchy ensures that the most urgent tasks are addressed first, optimizing resource allocation and minimizing potential delays. Prioritization is a key aspect of effective task management.
- Consider dependencies: Prioritize tasks without dependencies and those that enable other tasks to progress. Addressing tasks that unlock other activities ensures a smooth workflow and prevents bottlenecks. Dependency management is crucial for maintaining project momentum.
- Check POC/chain continuity: Advance multi-agent chains to maintain continuity in proof-of-concept (POC) workflows. Ensuring that chains progress systematically helps validate the overall solution and identify potential issues early on. Chain continuity is particularly important in complex, multi-stage projects.
- Take special care to avoid dependency loops! (A -> B -> A): Be vigilant in identifying and preventing dependency loops, as these can stall the workflow indefinitely. Dependency loops occur when tasks are mutually dependent, creating a circular relationship that prevents progress. Avoiding these loops is essential for maintaining a functional and efficient workflow.
3. Task Execution
- Delegate each task to the appropriate custom agent: Assign each selected task to the agent best suited for its execution, based on the agent's specialization and capabilities. Proper task delegation ensures that the right resources are applied to each task, maximizing efficiency and quality. Agent specialization is a critical factor in task execution success.
- Follow file-based orchestration lifecycle: Adhere to the following steps in the file-based orchestration lifecycle:
- Update status: assigned → in_progress: Change the task status from
assignedtoin_progressto indicate that the task is currently being worked on. This status update provides transparency and helps track the progress of each task. - Execute task per agent specialization: Carry out the task according to the agent's specific responsibilities and expertise. Agent specialization ensures that tasks are performed by individuals or systems with the necessary skills and knowledge.
- Create artifacts as specified: Generate any required artifacts, such as documents, code, or reports, as part of the task execution. Artifact creation is often a key deliverable of task execution and should be performed according to established guidelines.
- Update task YAML with result block: Add a result block to the task's YAML file to document the outcome of the task execution. This block should include relevant information, such as the completion status, any errors encountered, and the artifacts produced. Detailed documentation is essential for traceability and future reference.
- Update status: in_progress → done: Change the task status from
in_progresstodoneto indicate that the task has been successfully completed. This status update is crucial for tracking overall progress and identifying completed tasks. - Move task from
work/assigned/<agent>/towork/done/<agent>/: Move the completed task file from thework/assigned/<agent>/directory to thework/done/<agent>/directory. Placing tasks in agent-specific subdirectories within thedonedirectory helps maintain organization and allows for easy retrieval of past work. - Important: Tasks must be moved to the agent-specific subdirectory, not directly to
work/done/root: Ensure that tasks are moved to the agent-specific subdirectories withinwork/done/, rather than directly to the rootwork/done/directory. This organizational structure is essential for efficient task tracking and retrieval. - Create work log in
work/logs/<agent>/per Directive 014: Generate a work log in thework/logs/<agent>/directory, following the guidelines specified in Directive 014. Work logs provide a detailed record of the activities performed during task execution, including timestamps, inputs, and outputs. Comprehensive work logs are crucial for auditing and troubleshooting.
- Update status: assigned → in_progress: Change the task status from
4. Documentation & Reporting
- Create work log for each completed task (Directive 014): Generate a work log for each task that has been completed, adhering to the specifications outlined in Directive 014. These logs provide a detailed record of the task execution process and are essential for accountability and future reference.
- Update
work/collaboration/AGENT_STATUS.md: Modify theAGENT_STATUS.mdfile to reflect the current state of the agents and the tasks they are working on. Keeping this file up-to-date ensures that all stakeholders have a clear understanding of the workflow's progress. - Create iteration summary (Manager Mike): Manager Mike is responsible for creating an iteration summary that provides an overview of the tasks completed, any issues encountered, and the overall outcome of the iteration. The summary serves as a concise record of the iteration's progress and can be used for future planning and analysis.
- Capture metrics: Collect relevant metrics, such as duration, tokens, artifacts, and validation results, to assess the performance and efficiency of the orchestration cycle. Metrics provide valuable insights into the process and can help identify areas for improvement. Quantitative data is essential for data-driven decision-making.
- Commit changes with
report_progressafter each task: Commit changes incrementally using thereport_progresscommand after each task is completed. Incremental commits ensure that progress is regularly saved and that changes can be easily tracked and reverted if necessary. This practice promotes stability and reduces the risk of data loss. - Update PR description with iteration summary: Add the iteration summary to the pull request (PR) description to provide context and information about the changes being proposed. The summary helps reviewers understand the scope and impact of the changes, facilitating a more efficient review process.
- Post Manager Mike recap comment to PR: Manager Mike should post a recap comment to the PR, summarizing the iteration's outcomes and any relevant observations. This comment serves as a final summary of the iteration and can be used as a reference for future discussions.
Success Criteria
To ensure the success of the orchestration cycle, the following criteria should be met:
Note: These checkboxes can be auto-populated by orchestrator post-execution using work/scripts/template-status-checker.sh --validate
- [ ] At least 1 task completed (or all remaining if fewer than 3): Completing at least one task demonstrates that the orchestration cycle is functioning correctly and making progress. If fewer than three tasks remain, completing all of them ensures that the workflow is fully addressed.
- [ ] All work logs created per Directive 014: Creating comprehensive work logs for each completed task ensures that there is a detailed record of the execution process, which is essential for auditing and troubleshooting.
- [ ]
AGENT_STATUS.mdupdated with the current iteration state: Keeping theAGENT_STATUS.mdfile up-to-date provides a clear and accurate view of the agents' current activities and the overall workflow progress. - [ ] Iteration summary created by Manager Mike: The iteration summary provides a concise overview of the tasks completed, issues encountered, and overall outcomes, serving as a valuable reference for future planning and analysis.
- [ ] Metrics captured and reported: Collecting and reporting relevant metrics allows for the assessment of the orchestration cycle's performance and efficiency, helping identify areas for improvement.
- [ ] Framework health assessed (completion rate, validation success, etc.): Evaluating the health of the orchestration framework, including completion rates and validation success, ensures that the underlying infrastructure is functioning correctly and supporting the workflow effectively.
- [ ] Zero validation errors or failures: Ensuring that there are no validation errors or failures indicates that the tasks have been executed correctly and that the workflow is progressing smoothly.
- [ ] All artifacts committed and pushed: Committing and pushing all generated artifacts ensures that the outputs of the task execution are properly stored and accessible, facilitating collaboration and future use.
Deliverables
The key deliverables of this orchestration cycle include:
- Completed Tasks: Tasks that have been successfully executed and moved to the appropriate
work/done/<agent>/subdirectories. These tasks represent tangible progress in the workflow. - Work Logs: Detailed logs created in
work/logs/<agent>/for each completed task, providing a comprehensive record of the execution process. Work logs are essential for auditing, troubleshooting, and knowledge sharing. - Iteration Summary: A summary document added to
work/collaboration/, providing an overview of the iteration's accomplishments, challenges, and outcomes. The iteration summary serves as a concise record of the work performed and can be used for future planning. - Updated Status: The
AGENT_STATUS.mdfile, reflecting the current state of the agents and their activities. This updated status ensures that all stakeholders have a clear understanding of the workflow's progress. - Manager Recap: A comment posted to the PR by Manager Mike, summarizing the iteration's results and any relevant observations. The recap comment provides a final overview of the iteration and serves as a reference for future discussions.
- Metrics Report: A report detailing the duration, tokens, artifacts, success rate, and other relevant metrics captured during the iteration. Metrics provide quantitative data that can be used to assess the performance and efficiency of the orchestration cycle.
References
Refer to the following resources for additional information and guidance:
- File-Based Orchestration:
.github/agents/approaches/file-based-orchestration.md: This document provides details on the file-based orchestration approach being used in this cycle. - AGENTS.md: Root orchestration protocol: The primary protocol for orchestration, outlining the roles, responsibilities, and interactions of agents.
- Directive 014: Work Log Creation (
.github/agents/directives/014_worklog_creation.md): Guidelines for creating work logs, ensuring consistency and completeness. - ADR-009: Orchestration Metrics Standard: Standards for capturing and reporting metrics related to orchestration activities.
- Agent Profiles:
.github/agents/*.agent.md: Profiles defining the capabilities and responsibilities of each agent. - Previous Iterations: Check
work/collaboration/ITERATION_*_SUMMARY.md: Summaries of previous iterations, providing context and lessons learned.
Example Prompt
The following is an example prompt that can be used to initiate the orchestration cycle:
Execute an orchestration cycle following file-based orchestration approach:
1. Initialize as Manager Mike per AGENTS.md
2. Read work/collaboration/AGENT_STATUS.md
3. Run agent_orchestrator.py to assign pending tasks
4. Execute top X priority tasks by delegating to custom agents ( see max tasks configuration at the top )
5. Create work logs per Directive 014
6. Update AGENT_STATUS.md and create iteration summary
7. Post Manager Mike recap comment
Ensure:
- Tasks selected by priority (critical > high > medium)
- All work logs Directive 014 compliant
- Metrics captured per ADR-009
- Incremental commits with report_progress
- Framework health assessed
This prompt provides a clear and concise set of instructions for executing the orchestration cycle, ensuring that all key steps and considerations are addressed. By following this guide and utilizing the provided resources, you can effectively manage and execute your orchestration cycles, driving progress and achieving your project goals. For more information on DevOps and related topics, visit Atlassian's DevOps Guide.