Skip to content

t1357.3: Create mission orchestrator agent doc#2511

Closed
alex-solovyev wants to merge 1 commit intomainfrom
feature/mission-orchestrator-agent
Closed

t1357.3: Create mission orchestrator agent doc#2511
alex-solovyev wants to merge 1 commit intomainfrom
feature/mission-orchestrator-agent

Conversation

@alex-solovyev
Copy link
Collaborator

@alex-solovyev alex-solovyev commented Feb 27, 2026

Summary

  • Create workflows/mission-orchestrator.md — the agent doc that guides autonomous multi-day mission execution from milestones to completion
  • Add mission orchestrator to subagent index (workflows section, count 13 -> 14)
  • Add mission orchestrator reference to AGENTS.md domain index (Orchestration row)

What the orchestrator covers

  1. Execution loop: Sequential milestones with parallel feature dispatch, monitoring, milestone validation gates, budget tracking
  2. Self-organisation: File/folder management patterns (todo/missions/{id}/), temporary agent creation (draft tier), promotion workflow
  3. Improvement feedback: Patterns for feeding mission learnings back to aidevops (issues, draft agent promotion, agent doc improvements)
  4. Reference patterns: Table of existing aidevops capabilities missions commonly need (browser, API, database, deployment, etc.) with file references
  5. Research guidance: Research-first pattern for unknown domains — dispatch research workers before implementation, create draft agents from findings
  6. POC vs Full mode: Behaviour differences for ceremony-skipping prototype mode vs production-quality full mode
  7. Failure recovery: Cold start recovery from mission file, common failure patterns and recovery actions, re-planning guidance
  8. Pulse integration: How the orchestrator and pulse supervisor coexist at different abstraction levels

Design decisions

  • Location: workflows/ (consistent with ralph-loop.md, plans.md — process guides)
  • Model tier: opus (strategic reasoning for orchestration, trade-off analysis, re-planning)
  • Not a main agent: The orchestrator is guidance for a session, not a standalone primary agent — missions are driven by Build+ reading this workflow
  • Intelligence over scripts: Follows the core principle — guidance for what to check and why, not deterministic if/then rules

Closes #2497

Summary by CodeRabbit

  • New Features

    • Introduced Mission Orchestrator enabling autonomous multi-day mission execution with milestone validation, feature dispatch capabilities, and automated progress monitoring.
  • Documentation

    • Added comprehensive Mission Orchestrator documentation covering execution procedures, state management, and operational guidance.

…ject execution

Create workflows/mission-orchestrator.md with guidance for driving missions from
scoped milestones to verified completion. Covers: execution loop (sequential
milestones, parallel features), self-organisation (file/folder management,
temporary draft agent creation), improvement feedback to aidevops, reference
patterns for existing capabilities, research guidance for unknown domains,
POC vs full mode specifics, failure recovery, budget tracking, and pulse
integration.

Closes #2497
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the concept and detailed documentation for a "Mission Orchestrator" agent, designed to autonomously manage and execute complex, multi-day projects from defined milestones to completion. The orchestrator provides guidance on execution loops, self-organization, failure recovery, and integration with existing systems, aiming to enhance the framework's ability to handle strategic, long-running tasks. The changes also ensure this new workflow is properly indexed and discoverable within the agent documentation structure.

Highlights

  • New Mission Orchestrator Documentation: A comprehensive guide for an autonomous multi-day mission orchestrator agent has been created, detailing its execution loop, self-organization, failure recovery, and integration with the Pulse supervisor.
  • Agent Index Integration: The new mission orchestrator has been added to the subagent-index.toon under the workflows section, increasing the count from 13 to 14.
  • Domain Index Update: The AGENTS.md file has been updated to include a reference to workflows/mission-orchestrator.md within the "Orchestration" domain index.
Changelog
  • .agents/AGENTS.md
    • Added workflows/mission-orchestrator.md to the "Orchestration" row.
  • .agents/subagent-index.toon
    • Updated the workflows section count from 13 to 14.
    • Added a new entry for mission-orchestrator with its file path and purpose.
  • .agents/workflows/mission-orchestrator.md
    • Created a new markdown document outlining the Mission Orchestrator agent.
Activity
  • The pull request was created by alex-solovyev.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Walkthrough

This pull request introduces the Mission Orchestrator documentation and updates the agent index files. It adds a comprehensive mission-orchestrator.md guide to the workflows directory and updates AGENTS.md and subagent-index.toon to reference the new workflow, with the TOON header index bumped from 13 to 14.

Changes

Cohort / File(s) Summary
Index Updates
.agents/AGENTS.md, .agents/subagent-index.toon
Updated Orchestration domain reference and workflows list to include mission-orchestrator entry; incremented TOON header index from 13 to 14.
Mission Orchestrator Documentation
.agents/workflows/mission-orchestrator.md
New comprehensive reference documenting autonomous multi-day mission execution model: phases (scoping, decomposition, execution, completion), milestone sequencing, feature parallelization, state management via Git, non-recursive orchestration dispatch pattern, execution loop (9 steps), self-organization guidance, failure recovery strategies, and integration with Pulse supervisor.

Possibly Related PRs

Poem

🚀 A new orchestrator born from milestones and dreams,
Multi-day missions flowing in git-powered streams,
From scoping to completion, each feature takes flight,
Sequential milestones keeping chaos in sight,
The mission begins—let autonomous work ignite! ✨


🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 't1357.3: Create mission orchestrator agent doc' directly and clearly summarizes the main change—adding comprehensive documentation for the mission orchestrator agent.
Linked Issues check ✅ Passed All coding requirements from issue #2497 are met: mission orchestrator agent doc created with self-organisation guidance, file/folder patterns, draft-tier agent creation workflow, improvement feedback patterns, reference patterns for aidevops capabilities, and research guidance.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #2497: the new mission-orchestrator.md file documents required patterns, AGENTS.md is updated to reference the orchestrator, and subagent-index.toon is correctly bumped.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/mission-orchestrator-agent

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 36 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 27 23:31:19 UTC 2026: Code review monitoring started
Fri Feb 27 23:31:20 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 36

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 36
  • VULNERABILITIES: 0

Generated on: Fri Feb 27 23:31:22 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive and well-structured agent document for a mission orchestrator, outlining a complex, long-running process. However, the document contains several security vulnerabilities, specifically Command Injection and Path Traversal, due to the direct incorporation of unsanitized variables from untrusted sources into shell command templates and file operations. For command injection, it is critical to use bash arrays for safe dynamic command construction. This could lead to Remote Code Execution (RCE) or arbitrary file access. Additionally, there are significant contradictions within the described execution model that need to be resolved to improve clarity and implementability.

Comment on lines +99 to +100
opencode run --dir <repo_path> --title "Mission {id} / {feature_id}: {title}" \
"/full-loop Implement {feature_description} -- Context: part of mission {id}, milestone {N}" &

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The opencode run command templates, specifically at lines 99-100, use variables like {title} and {feature_description} directly from the mission state file. This poses a significant Command Injection vulnerability, as shell metacharacters in these variables could lead to arbitrary command execution. To avoid command injection vulnerabilities when constructing shell commands dynamically, it is crucial to use a bash array to build the command and its arguments safely, rather than direct variable interpolation. Additionally, update these instructions to explicitly require sanitization or proper escaping of all variables before using them in shell commands.

Beyond this security concern, there's a major contradiction in the agent's execution model. The "Execution Loop" (lines 93-127) describes direct worker dispatch using opencode run and ps, which conflicts with the "Integration with Pulse" model (lines 428-444) where pulse dispatches workers based on GitHub issues. The "Execution Loop" section should be rewritten to align with the Pulse integration model. Additionally, please clarify the internal contradiction within the "Integration with Pulse" section regarding whether issues are created for all features or only for the next milestone's features.

Suggested change
opencode run --dir <repo_path> --title "Mission {id} / {feature_id}: {title}" \
"/full-loop Implement {feature_description} -- Context: part of mission {id}, milestone {N}" &
# Full mode — standard worktree + PR workflow (sanitize all variables to prevent shell injection)
opencode run --dir <repo_path> --title "Mission {id} / {feature_id}: {title}" \
"/full-loop Implement {feature_description} -- Context: part of mission {id}, milestone {N}" &
References
  1. To avoid command injection vulnerabilities when constructing shell commands dynamically, do not use eval. Instead, use a bash array to build the command and its arguments safely.


```bash
# Find and read the mission file
cat todo/missions/{mission_id}-mission.md

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The instructions for the Mission Orchestrator agent provide several shell command templates that directly incorporate variables derived from untrusted sources (such as the mission state file or user-supplied mission IDs) without any requirement for sanitization or validation.

Specifically, this cat command is vulnerable to path traversal if {mission_id} contains ../. Since the agent has bash tool access, an attacker who can influence the mission ID could read arbitrary files on the system.

Remediation: Instruct the agent to validate and sanitize the {mission_id} variable (e.g., ensuring it only contains alphanumeric characters and hyphens) before using it in a shell command.

Suggested change
cat todo/missions/{mission_id}-mission.md
# Find and read the mission file (ensure {mission_id} is sanitized: alphanumeric + hyphens only)
cat todo/missions/{mission_id}-mission.md

Comment on lines +236 to +238
mkdir -p ~/.aidevops/agents/draft/{mission_id}/

cat > ~/.aidevops/agents/draft/{mission_id}/{name}.md << 'AGENT'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The instructions for temporary agent creation use {mission_id} and {name} to construct file paths for mkdir and cat. If these variables contain path traversal sequences (e.g., ../), the LLM could be tricked into writing files outside the intended directory (~/.aidevops/agents/draft/), potentially overwriting sensitive system files or configuration.

Remediation: Instruct the agent to strictly validate {mission_id} and {name} to ensure they do not contain path traversal characters and consist only of safe characters.

Suggested change
mkdir -p ~/.aidevops/agents/draft/{mission_id}/
cat > ~/.aidevops/agents/draft/{mission_id}/{name}.md << 'AGENT'
# Sanitize {mission_id} and {name} to prevent path traversal
mkdir -p ~/.aidevops/agents/draft/{mission_id}/
cat > ~/.aidevops/agents/draft/{mission_id}/{name}.md << 'AGENT'

Comment on lines +302 to +304
opencode run --dir <repo_path> --agent Research --title "Mission {id}: Research {topic}" \
"Research {topic} for mission {id}. Deliverable: a summary document at \
todo/missions/{id}/research/{topic}.md covering: key concepts, recommended \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The research command template uses the {topic} variable in both the command title and the prompt. Similar to other command templates, this is vulnerable to shell injection if the topic string contains malicious shell metacharacters. To avoid command injection vulnerabilities when constructing shell commands dynamically, it is crucial to use a bash array to build the command and its arguments safely, rather than direct variable interpolation. Additionally, instruct the agent to sanitize the {topic} variable before incorporating it into the shell command.

Suggested change
opencode run --dir <repo_path> --agent Research --title "Mission {id}: Research {topic}" \
"Research {topic} for mission {id}. Deliverable: a summary document at \
todo/missions/{id}/research/{topic}.md covering: key concepts, recommended \
# Sanitize {topic} and {id} to prevent injection and traversal
opencode run --dir <repo_path> --agent Research --title "Mission {id}: Research {topic}" \
"Research {topic} for mission {id}. Deliverable: a summary document at \
todo/missions/{id}/research/{topic}.md covering: key concepts, recommended \
References
  1. To avoid command injection vulnerabilities when constructing shell commands dynamically, do not use eval. Instead, use a bash array to build the command and its arguments safely.

Comment on lines +366 to +374
| Aspect | Full Mode | POC Mode |
|--------|-----------|----------|
| Git workflow | Worktree + PR per feature | Single branch or direct to main |
| Task briefs | Required per feature | Skipped |
| Code review | PR review before merge | Self-merge, no review |
| Quality gates | Preflight + postflight | Basic: does it run? |
| Parallel workers | Up to `max_parallel_workers` | Single worker per milestone |
| Validation | Full criteria | "Does the demo work?" |
| Documentation | Required | Minimal — README only |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a contradiction regarding parallelism in POC mode.

The table in "POC Mode Specifics" (line 372) states that for "Parallel workers", POC mode uses a "Single worker per milestone".

However, the example in "Step 3: Dispatch Features" (lines 103-107) is inside a loop For each feature..., which implies that multiple features in a milestone could be dispatched in parallel, even in POC mode. The dispatch rules on line 111 also state to "Respect max_parallel_workers from mission config", which seems to apply to both modes.

Please clarify the intended behavior for parallelism in POC mode to resolve this contradiction. For example, should the table on line 372 be updated to something like "Reduced parallelism (e.g., 1)" or should the dispatch logic explicitly handle this?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.agents/workflows/mission-orchestrator.md (1)

317-329: Search commands reference ~/.aidevops/agents/ — these should work for installed framework but not in-repo development.

The rg commands assume the framework is installed at ~/.aidevops/. For consistency with other docs, consider noting this is the installed path, or use relative paths when working within the repo.

💡 Consider adding a note about path context
 ### Using Existing aidevops Capabilities
 
 Before building something new, check if aidevops already has it:
 
+> **Note:** Paths below assume the installed framework at `~/.aidevops/`. When working within the aidevops repo itself, use relative paths (e.g., `.agents/subagent-index.toon`).
+
 ```bash
 # Search the subagent index for relevant capabilities
 rg "{keyword}" ~/.aidevops/agents/subagent-index.toon
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/workflows/mission-orchestrator.md around lines 317 - 329, Update the
commands that reference the installed framework to clarify context: note that
the rg/search lines target the installed subagent index (subagent-index.toon)
under the framework install and therefore use the installed path, and add
equivalent relative repo examples for in-repo development (e.g., repo-relative
glob patterns) plus a short note about the aidevops skills search and the grep
mcp_servers check so readers know when to use installed vs repo paths; update
the snippets around the rg and "aidevops skills search" commands and add a
one-line explanation indicating which commands expect the framework to be
installed versus run from the repo.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.agents/workflows/mission-orchestrator.md:
- Around line 317-329: Update the commands that reference the installed
framework to clarify context: note that the rg/search lines target the installed
subagent index (subagent-index.toon) under the framework install and therefore
use the installed path, and add equivalent relative repo examples for in-repo
development (e.g., repo-relative glob patterns) plus a short note about the
aidevops skills search and the grep mcp_servers check so readers know when to
use installed vs repo paths; update the snippets around the rg and "aidevops
skills search" commands and add a one-line explanation indicating which commands
expect the framework to be installed versus run from the repo.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 941bc60 and 6b9afe6.

📒 Files selected for processing (3)
  • .agents/AGENTS.md
  • .agents/subagent-index.toon
  • .agents/workflows/mission-orchestrator.md

@alex-solovyev
Copy link
Collaborator Author

Closing as superseded by PR #2513 (branch feature/t1357.3-mission-orchestrator-agent), which covers the same t1357.3 work without merge conflicts. PR #2511 has a merge conflict with main and is the older of the two.

@marcusquinn marcusquinn deleted the feature/mission-orchestrator-agent branch March 3, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t1357.3: Create mission orchestrator agent

1 participant