Orchestrator Workflow
Top-level delivery orchestration workflow for Codex.
Required Shared Skills
Always apply:
policy-compliance-orderfeature-promotion-lifecyclerepo-automation-adapteratomic-plan-contractacceptance-criteria-trackingpr-context-artifactspr-base-branch-merge-base
Use as needed:
csharp-change-budget-routerpowershell-change-budget-routerfeature-review
Role
- Coordinate the mission from intake through completion.
- Resolve required specialist delegation mechanically instead of by judgment.
- Required delegated specialists:
atomic-planneratomic-executorfeature-reviewer
- Deterministic availability rule:
- if the host exposes
spawn_agent, treat all three required delegated specialists as available, - do not infer unavailability from missing nicknames, missing prior agent instances, or lack of a dedicated launcher alias.
- if the host exposes
- Required delegated steps MUST delegate or stop execution.
- If a required delegated handoff cannot be started, resumed, or completed with a receipt, persist blocked state and stop. Do not perform that step directly.
- Direct local execution is allowed only for workflow steps that are not designated below as required delegated handoffs.
Checkpoint Contract
Canonical checkpoint path:
artifacts/orchestration/orchestrator-state.json
Persist and reuse these fields exactly:
objectivechange_budget_estimatepath_selectedpromotion-typeshort-namerelativeFilelong-nameissue-numfeature-folderwork-modeplan-pathcompleted_stepsnext_steplast_updatedstep5_statusstep6_statusstep7_statusstep8_statusstep9_statusstep10_statusdelegation_receiptsblocked_reason
For small-path runs, also persist:
bootstrap_modephase0_execution_summarysmall_path_qc_summarysmall_path_audit_artifactsresume_after_manual_bootstrap
Status enums:
step5_status/step6_status/step7_status/step8_status/step9_status/step10_statusMUST use one of:not-applicablependingdelegatedverifiedblocked
Blocked-reason enum:
blocked_reasonMUST be one of:nonecheckpoint_conflictlifecycle_preconditions_missingspawn_agent_unavailabledelegation_launch_faileddelegate_no_receiptdelegate_contract_incompletevalidator_faileduser_requested_stop
Delegation receipt schema:
delegation_receiptsMUST be a list of objects with:stepagent_nameagent_idskill_sourcestarted_atcompleted_atresult_signalartifact_paths
Required-delegation step map:
- small path:
- Step 5 ->
atomic-planner - Step 6 ->
atomic-executor - Step 9 ->
atomic-executor - Step 10 ->
feature-reviewer
- Step 5 ->
- large path:
- Step 7 ->
atomic-planner - Step 8 ->
atomic-executor - Step 9 ->
feature-reviewer
- Step 7 ->
- remediation planning:
- review-triggered remediation planning ->
atomic-planner
- review-triggered remediation planning ->
Resume Rules
- Read the checkpoint first when it exists.
- If the recorded mission is incomplete, resume from
next_step. - If the checkpoint belongs to an unrelated in-progress mission, stop with
blocked_reason: checkpoint_conflict. - Do not rename, back up, or create sidecar checkpoint files to work around a canonical checkpoint conflict.
- Restart only when the user explicitly requests restart.
- Do not recompute persisted variables when valid stored values already exist.
Routing Rules
- Estimate the likely touched production files and test files first.
- Determine the dominant implementation language.
- If the scope is primarily C#, use
csharp-change-budget-router. - If the scope is primarily PowerShell, use
powershell-change-budget-router. - If the scope is mixed-language, ambiguous, or unsupported by an existing change-budget router, fail closed to the large path.
- Treat any request outside the applicable small-path budget as large path.
Small Path
Use the small path only when the applicable language router clears it.
Required behavior:
- Set
${work-mode}tominor-audit. - Use
feature-promotion-lifecycleas the source of truth for lifecycle variables, branch naming, and${plan-path}resolution. - Route all promotion, issue, and feature-folder automation through
repo-automation-adapter. - Enforce lifecycle preconditions before any active-folder authoring:
${relativeFile}must resolve to a real potential markdown path and must not beNONE,TBD, or empty- issue promotion must complete before branch or folder creation
${issue-num}must be numeric beforenew_active_feature_folderruns- do not create or edit
${feature-folder}/issue.md,${feature-folder}/spec.md,${feature-folder}/user-story.md, orplan*.mduntil promotion and folder creation both succeed - if any lifecycle precondition fails, set the relevant step status to
blocked, setblocked_reasontolifecycle_preconditions_missing, and stop
- Enforce minor-audit folder integrity:
${feature-folder}/issue.mdmust exist${feature-folder}/spec.mdmust be absent${feature-folder}/user-story.mdmust be absent
- Spawn
atomic-plannerto create or revise the minimal plan at${plan-path}.- Include the directive
DIRECTIVE: MINIMAL-AUDIT PLAN REQUIRED - Require the same
${plan-path}to be updated in place - Do not continue until the planner reports
PREFLIGHT: ALL CLEAR - Record a delegation receipt and set
step5_statustoverifiedbefore continuing - If the handoff cannot be started or does not return a receipt, set
step5_statustoblocked, setblocked_reason, and stop
- Include the directive
- Spawn
atomic-executorto execute Phase 0 only.- Record a delegation receipt and set
step6_statustoverifiedbefore branching - If the handoff cannot be started or does not return a receipt, set
step6_statustoblocked, setblocked_reason, and stop
- Record a delegation receipt and set
- If the request is manual bootstrap, persist the resume checkpoint and stop after Phase 0.
- Otherwise continue with constrained implementation:
- steps that are not modeled as required delegated handoffs may execute directly while staying within the approved plan and applicable repo policy
- Validate the delivered work against
${feature-folder}/issue.mdand persist plan or acceptance-criteria checkoffs before review.
- MUST delegate to
atomic-executorfor validation and checklist updates - Record a delegation receipt and set
step9_statustoverifiedbefore continuing - If the handoff cannot be started or does not return a receipt, set
step9_statustoblocked, setblocked_reason, and stop
- Run reduced audit:
- MUST delegate to
feature-reviewer - Record a delegation receipt and set
step10_statustoverifiedbefore continuing - If the handoff cannot be started or does not return a receipt, set
step10_statustoblocked, setblocked_reason, and stop
- If review triggers remediation, create remediation inputs, delegate planning to
atomic-planner, execute the remediation plan, and re-run reduced review until the gate is clean.
- If remediation planning delegation cannot be started or does not return a receipt, set
blocked_reasonand stop
Large Path
Use the large path for any request that exceeds or bypasses the small-path router.
Required behavior:
- Set
${work-mode}to:full-featurefor feature workfull-bugfor bug work
- Use
feature-promotion-lifecycleas the source of truth for lifecycle variables, branch naming, and${plan-path}resolution. - Route all promotion, issue, and feature-folder automation through
repo-automation-adapter. - Enforce lifecycle preconditions before any active-folder authoring:
${relativeFile}must resolve to a real potential markdown path and must not beNONE,TBD, or empty- issue promotion must complete before branch or folder creation
${issue-num}must be numeric beforenew_active_feature_folderruns- do not create or edit
${feature-folder}/issue.md,${feature-folder}/spec.md,${feature-folder}/user-story.md, orplan*.mduntil promotion and folder creation both succeed - if any lifecycle precondition fails, set the relevant step status to
blocked, setblocked_reasontolifecycle_preconditions_missing, and stop
- Complete the requirements-authoring steps before planning:
- fill the potential entry details
- create or refresh research artifacts
- complete
spec.mdanduser-story.mdwhen the selected work mode requires them
- Prefer dedicated migrated specialists for those authoring steps when they exist.
- When those specialists are not yet migrated, perform the authoring steps directly without changing template headings.
- Spawn
atomic-plannerto finalize${plan-path}and requirePREFLIGHT: ALL CLEAR. Hard enforcement for Step 7:- The planning route MUST be
atomic-planner -> atomic-executorfor preflight validation. - The planner MUST update
${plan-path}in place and MUST NOT create additionalplan.*.mdfiles for revisions. - The approved plan MUST include explicit Phase 0 baseline evidence tasks and explicit final-QA evidence or coverage tasks for each language in scope where policy requires them.
- Do not mark Step 7 complete until delegate output includes both a concrete
plan-pathand finalPREFLIGHT: ALL CLEAR. - Do not perform planning locally when this delegation cannot be started; set
step7_statustoblocked, setblocked_reason, and stop. - Record a delegation receipt and set
step7_statustoverifiedonly after delegate output and validator checks pass.
- The planning route MUST be
- Spawn
atomic-executorto execute the approved plan. Hard enforcement for Step 8:- Do not mark Step 8 complete until execution output includes execution summary, QA summary, lint/type/test/coverage deltas, and numeric baseline/post/new-code coverage metrics where policy requires them.
- Do not accept PASS execution outcomes when required baseline or final-QA artifacts are missing, when checklist state is not backed by artifacts, or when coverage-bearing plan tasks remain unverified.
- Do not perform execution locally when this delegation cannot be started; set
step8_statustoblocked, setblocked_reason, and stop. - Record a delegation receipt and set
step8_statustoverifiedonly after delegate output and validator checks pass.
- Spawn
feature-reviewerfor post-implementation review. Hard enforcement for Step 9:- Resolve the base branch through
pr-base-branch-merge-baseunless an explicit base was already supplied. - Load canonical PR-context artifacts and refresh them through
repo-automation-adapterwhen they are missing or stale relative to the current branch state. - Do not mark Step 9 complete until expected review artifacts are present on disk in
${feature-folder}. - Do not accept PASS review outcomes when required coverage fields are left unverified, when PR-context artifacts are missing or stale relative to the current branch state, or when required remediation artifacts are missing.
- Do not perform review locally when this delegation cannot be started; set
step9_statustoblocked, setblocked_reason, and stop. - Record a delegation receipt and set
step9_statustoverifiedonly after delegate output and validator checks pass.
- Resolve the base branch through
- If review triggers remediation, loop through remediation planning, remediation execution, and re-review until the gate is clean.
- remediation planning delegation is mandatory; if it cannot be started, set
blocked_reasonand stop
- remediation planning delegation is mandatory; if it cannot be started, set
Completion Gates
Do not claim mission completion until all of the following are true:
- the selected path completed end to end
- all required delegations completed with receipts
- the checkpoint is updated with the final state
- the canonical checkpoint path was used without sidecar replacement or backup substitution
${relativeFile}is a real promoted-input path and${issue-num}is numeric when lifecycle setup was required${feature-folder}and${plan-path}are known when lifecycle setup was required- the approved plan is executor-compliant and references the required baseline and final-QA evidence tasks
- required review artifacts exist on disk
- small path has Phase 0 evidence plus reduced audit artifacts
- large path has policy, code, and feature audit artifacts
- required baseline and final-QA evidence artifacts referenced by the approved plan exist on disk
- any required remediation artifacts exist on disk and the latest re-review is clean
- validator-backed checks for the approved plan, policy audit, code review, feature audit, and checkpoint state pass
Hard Constraints
- Do not stop after one delegation when required downstream steps remain.
- Do not infer specialist unavailability from missing nicknames or absent prior subagent instances.
- Do not call
drmCopilotExtension.*directly from this workflow. - Do not bypass
repo-automation-adapterfor host-specific lifecycle steps. - Do not rename, back up, or create sidecar checkpoint files to avoid using the canonical checkpoint path.
- Do not proceed when the canonical checkpoint belongs to another in-progress mission; stop and report the conflict.
- Do not create or edit active feature docs before potential-entry creation, issue promotion, and active-folder creation succeed.
- Do not call
new_active_feature_folderbefore${issue-num}is numeric and backed by promotion output. - Do not persist placeholder lifecycle values such as
NONEorTBDfor${relativeFile},${issue-num},${feature-folder}, or${plan-path}once lifecycle setup begins. - Do not create replacement audit artifacts yourself for any required delegated review step.
- Do not execute required delegated steps locally as a fallback.
- Do not accept stale PR-context artifacts, unsupported checklist checkoffs, or missing required evidence as PASS outcomes.
- Do not claim completion without reporting the checkpoint path and the created or updated artifact paths.