Skip to content

Stage-Runtime mapping — runtime_profile.{interview,execute,evaluate,reflect} #519

@shaun0927

Description

@shaun0927

Stage-Runtime mapping — runtime_profile.{interview,execute,evaluate,reflect}

Context

The Agent OS architecture diagram shared by maintainers assigns a
different harness per pipeline stage:

  • Interview → Codex
  • AC Tree / Execute → OMX
  • Evaluate → Claude Code (CC)
  • Wonder / Reflect → Hermes

PR #505 introduced an opt-in orchestrator.runtime_profile setting but
ships only the Codex worker mapping for Phase 1; OpenCode, Hermes,
Claude Code, and LiteLLM mappings are explicitly deferred ("matching the
staging in the design discussion on #488").

This issue extends runtime_profile from a single backend slot to a
per-stage map, so the diagram's stage→harness assignment becomes a
real configuration surface. It is the first concrete consumer of the Mesh
RFC (#511) at the single-installation layer (S3 — Multi-harness Parity in
RFC #476).

This is not the Mesh itself (cross-runtime IPC). It is the binding
table
the Mesh and the orchestrator both read.

Scope

  1. Configuration surface

    [orchestrator.runtime_profile]
    default = "claude_code"
    
    [orchestrator.runtime_profile.stages]
    interview = "codex"
    execute   = "opencode"     # OMX in the diagram
    evaluate  = "claude_code"
    reflect   = "hermes"
    • default keeps today's single-backend behavior for installs that
      don't opt in.
    • stages.* is additive: any unset stage falls back to default.
  2. Stage enumeration

    • Initial stages: interview, execute, evaluate, reflect.
    • The list is closed — adding a new stage requires a justified PR (per
      the same narrow-membership commitment as AgentRuntimeContext).
  3. Resolution rule

    • At workflow entry, the orchestrator resolves the active stage and
      selects the runtime via runtime_profile.stages.get(stage, default).
    • The chosen runtime is recorded on the AgentProcess (M6) as
      runtime_id, and emitted in control.directive.emitted as part of
      the extra payload so the journal answers "which harness ran which
      stage?" without log inspection.
  4. Per-runtime mapping follow-ups

  5. Validation

    • Setup-time validation: each referenced runtime must be installed and
      pass the existing ouroboros mcp doctor (feat(cli): add 'ouroboros mcp doctor' diagnostic command #445) check; otherwise the
      setting is rejected at startup with a clear error message rather
      than failing mid-workflow.
    • Diagnostics: ouroboros mcp doctor extends to print the resolved
      stage→runtime table for the current install.
  6. Backward compatibility

Non-goals

Acceptance

  • runtime_profile.stages config surface defined and documented
  • Stage enumeration closed with rationale
  • Orchestrator resolves runtime per stage and records it on
    AgentProcess
  • control.directive.emitted payload includes the resolved
    runtime_id for stage-relevant transitions
  • Four follow-up PRs (OpenCode / Hermes / Claude Code / LiteLLM
    mappings) merged or referenced as separate issues
  • ouroboros mcp doctor prints the active stage→runtime table
  • Default runtime_profile=None behavior is unchanged
  • Replay test: a fixture run with mixed stage runtimes shows the
    correct runtime_id per stage in the EventStore

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or meaningful improvementneeds-designMulti-PR epic or architectural change, needs human planning

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions