pub struct Orchestrator { /* private fields */ }Expand description
The orchestrator coordinates the full Ouroboros lifecycle.
Implementations§
Source§impl Orchestrator
impl Orchestrator
Sourcepub fn new(
ouroboros: Arc<dyn OuroborosProtocol>,
event_bus: EventBus,
state_store: Arc<StateStore>,
lifecycle: AgentLifecycleManager,
) -> Self
pub fn new( ouroboros: Arc<dyn OuroborosProtocol>, event_bus: EventBus, state_store: Arc<StateStore>, lifecycle: AgentLifecycleManager, ) -> Self
Creates a new orchestrator.
Sourcepub fn with_config(
ouroboros: Arc<dyn OuroborosProtocol>,
event_bus: EventBus,
state_store: Arc<StateStore>,
lifecycle: AgentLifecycleManager,
_config: OrchestratorConfig,
) -> Self
pub fn with_config( ouroboros: Arc<dyn OuroborosProtocol>, event_bus: EventBus, state_store: Arc<StateStore>, lifecycle: AgentLifecycleManager, _config: OrchestratorConfig, ) -> Self
Creates a new orchestrator with custom config.
Sourcepub fn set_intent_engine(&self, engine: Arc<dyn IntentEngineOps>)
pub fn set_intent_engine(&self, engine: Arc<dyn IntentEngineOps>)
Wire the IntentEngine for unified handle() calls (RFC-027). Called by the kernel assembler after construction.
Sourcepub fn has_intent_engine(&self) -> bool
pub fn has_intent_engine(&self) -> bool
Whether the IntentEngine is wired (unified path available).
Sourcepub fn set_project_manager(&self, manager: Arc<ProjectManager>)
pub fn set_project_manager(&self, manager: Arc<ProjectManager>)
Set the ProjectManager for context partitioning.
Sourcepub fn set_mount_manager(&self, manager: Arc<MountManager>)
pub fn set_mount_manager(&self, manager: Arc<MountManager>)
Set the MountManager for path-alias context (RFC-025).
Sourcepub fn mount_manager(&self) -> Option<Arc<MountManager>>
pub fn mount_manager(&self) -> Option<Arc<MountManager>>
Get a reference to the MountManager, if set (RFC-025).
Sourcepub fn project_manager(&self) -> Option<Arc<ProjectManager>>
pub fn project_manager(&self) -> Option<Arc<ProjectManager>>
Get a reference to the ProjectManager, if set.
Sourcepub fn detect_project_tag(&self, message: &str) -> Option<String>
pub fn detect_project_tag(&self, message: &str) -> Option<String>
Detect a project from a message, returning tag string.
Sourcepub fn set_a2a(&mut self, a2a: Arc<A2AProtocol>)
pub fn set_a2a(&mut self, a2a: Arc<A2AProtocol>)
Set the A2A protocol for inter-agent task delegation.
Sourcepub fn set_git_layer(&mut self, git_layer: Arc<GitLayer>)
pub fn set_git_layer(&mut self, git_layer: Arc<GitLayer>)
Set the GitLayer for auto-commits after state saves.
Sourcepub async fn restore_sessions(&self)
pub async fn restore_sessions(&self)
Restore sessions from persisted state.
Loads sessions from the StateStore that have an active_seed_id
(meaning they are mid-orchestration) and repopulates the in-memory
interview session map so that follow-up messages can continue
the conversation.
Sourcepub async fn delegate_subtasks(
&self,
subtasks: Vec<SubTask>,
parent_seed: &Seed,
) -> Result<Vec<SubTask>>
pub async fn delegate_subtasks( &self, subtasks: Vec<SubTask>, parent_seed: &Seed, ) -> Result<Vec<SubTask>>
Execute multiple subtasks using separate agents in parallel.
When A2A is available, the orchestrator delegates tasks through the A2A protocol with circuit breaker and retry support. Otherwise, falls back to direct lifecycle execution.
Results are collected as they complete using JoinSet.
Sourcepub async fn handle(
&self,
engine: &dyn IntentEngineOps,
msg: &str,
ctx: &MsgCtx,
) -> Result<HandleResponse>
pub async fn handle( &self, engine: &dyn IntentEngineOps, msg: &str, ctx: &MsgCtx, ) -> Result<HandleResponse>
Unified entry point for every user message (RFC-027 §3).
One method, one match — depth falls out of [Scope]:
- [
IntentEngine::assess] classifies the message (conversation / clarify / task + scope). Always called once. - For
Assessment::Task(scope)we build a [Directive]:Scope::Trivial—Directive::from_message(msg)verbatim.Scope::Substantial— [IntentEngine::crystallize] produces a structured directive with goal, constraints, and acceptance criteria.
- The [
ExecEnv] is resolved from [MsgCtx] independently of the directive (Mount workspace context, paths, project ID, cspace hint). - Execution delegates to the existing
AgentLifecycleManager. In Phase 5 the Directive is shimmed into aSeedfor the current pipeline; Phase 6 will replace this withlifecycle.execute_directive(&Directive, &ExecEnv). - For
Scope::Substantialwe call [IntentEngine::review] and, if the verdict fails, retry once with the verdict’s gaps folded back into the directive as additional constraints.
Does not modify or call the legacy handle_message() / chat()
paths — they remain the canonical entry points until Phase 6 cuts
the gateway over to handle().
§Parameters
engine— the LLM-backed intent engine (assess/crystallize/review).msg— the user’s raw message text.ctx— per-message context (session, history, project/mount hints).
Sourcepub async fn handle_unified(
&self,
user_id: &str,
msg: &str,
session_id: Option<&str>,
project_ids: Option<&str>,
mount_ids: Option<&str>,
request_id: &str,
) -> Result<OrchestrationResult>
pub async fn handle_unified( &self, user_id: &str, msg: &str, session_id: Option<&str>, project_ids: Option<&str>, mount_ids: Option<&str>, request_id: &str, ) -> Result<OrchestrationResult>
Unified entry point that accepts legacy-style parameters and returns
an OrchestrationResult (RFC-027).
Builds a [MsgCtx] from the session history (if any), then delegates
to handle. Falls back to handle_message if no
IntentEngine is wired.
Auto Trait Implementations§
impl !Freeze for Orchestrator
impl !RefUnwindSafe for Orchestrator
impl !UnwindSafe for Orchestrator
impl Send for Orchestrator
impl Sync for Orchestrator
impl Unpin for Orchestrator
impl UnsafeUnpin for Orchestrator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSendSync for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.