Skip to main content

OrchestrationRuntime

Struct OrchestrationRuntime 

Source
pub struct OrchestrationRuntime { /* private fields */ }
Expand description

Session-scoped runtime enforcement shared by every subagent tool path.

Implementations§

Source§

impl OrchestrationRuntime

Source

pub fn trusted_catalog( foreground: &QualifiedModelId, _manifest_references: impl IntoIterator<Item = QualifiedModelId>, ) -> Result<CatalogSnapshot, &'static str>

Build a snapshot exclusively from runtime-owned routing/catalog descriptors. manifest_references are deliberately ignored here: manifests may narrow the snapshot, but can never create catalog membership. The foreground is admitted only after the credential-free runtime router resolves its exact identity.

Source

pub fn from_limits( foreground: QualifiedModelId, limits: SubagentLimits, ) -> Result<OrchestrationRuntime, &'static str>

The manifestless baseline sized by the user’s subagent.* limits. Every production install without a prompt-manifest policy uses this.

Source

pub fn baseline( foreground: QualifiedModelId, concurrent: usize, total: usize, ) -> Result<OrchestrationRuntime, &'static str>

Secure manifestless baseline: the exact foreground identity is the only worker choice in a deterministic runtime-controlled catalog.

Source

pub fn new(policy: DelegationPolicy) -> OrchestrationRuntime

Source

pub fn with_max_depth( self, max_depth: u16, ) -> Result<OrchestrationRuntime, &'static str>

How deep workers may nest (subagent.max_depth): 1 = only the foreground delegates. Zero would forbid all delegation and is refused.

Source

pub fn reserve_delegation( &self, worker_id: &str, parent: Option<&str>, ) -> Result<u16, DelegationTreeDenied>

Reserve one tree edge before allocating channels/threads/provider runtimes. parent=None is a foreground-root child. Only nesting depth is bounded here: fan-out and totals are the delegation policy’s limits, checked right after in the same spawn path. Every denial is fail-closed and leaves the tree unchanged.

Source

pub fn release_delegation(&self, worker_id: &str, _parent: Option<&str>)

Release one reserved tree edge. Descendants are recursively removed because a live child cannot outlive its parent lineage. The caller- supplied parent is intentionally ignored: ownership is taken from the reservation recorded under the tree lock, so a stale or hostile caller cannot decrement another parent’s fanout.

Source

pub fn delegation_descendants(&self) -> usize

Source

pub fn preflight(&self, model: &str) -> Result<(), String>

Source

pub fn grant_worker_model(&self, model: &str) -> Result<(), String>

Honors an explicit mid-session user trust grant for one exact worker model. Trusted models were never meant to be pinned at session start: the live policy and catalog are extended in place while worker lifecycle state and concurrency limits are preserved. The grant takes effect for the next dispatch decision.

Source

pub fn ultracode_readiness(&self, model: &str) -> Result<(usize, usize), String>

Read-only UltraCode authorization snapshot. The exact foreground identity, policy authorization, and configured limits are checked under one lock; no worker reservation or lifecycle state is created.

Source

pub fn resolve_and_authorize( &self, runtime_handle: &str, requested: Option<&str>, ) -> Result<AuthorizedWorkerModel, DispatchDenial>

Single parse/resolve/catalog/policy/limits decision point used by every public spawn path. No credential or provider object is reachable here.

Source

pub fn mark_starting(&self, runtime_handle: &str) -> Result<(), String>

Marks the persisted handle Starting immediately before the runtime/thread factory is invoked. Starting remains rollback-safe until mark_running.

Source

pub fn mark_running(&self, runtime_handle: &str) -> Result<(), String>

Source

pub fn rollback(&self, runtime_handle: &str)

Source

pub fn effective_choices(&self) -> Vec<String>

Source

pub fn foreground_model(&self) -> String

Source

pub fn authorize_with_policy( &self, runtime_handle: &str, model: &str, role: WorkerRole, writes: WorkerWritePolicy, ) -> Result<(), String>

Source

pub fn authorize(&self, runtime_handle: &str, model: &str) -> Result<(), String>

Source

pub fn poll(&self, id: &str, fingerprint: &str) -> Result<(), String>

Source

pub fn steer(&self, id: &str) -> Result<(), String>

Source

pub fn terminal_and_collect( &self, id: &str, terminal: WorkerTerminal, ) -> Result<(), String>

Source

pub fn finish_one_shot( &self, id: &str, terminal: WorkerTerminal, ) -> Result<(), String>

Source

pub fn reconcile(&self, id: &str) -> Result<(), String>

Source

pub fn retire_reconciled(&self, removed_handles: &HashSet<String>)

Reaper handoff: use exact IDs removed under the runtime registry lock, never a complement snapshot that could include newly registered workers.

Source

pub fn unreconciled_runtime_handles(&self) -> HashSet<String>

Snapshot runtime handle IDs still named by the completion gate. Taking this snapshot before locking the subagent registry avoids cross-registry lock order.

Source

pub fn is_unreconciled(&self, runtime_handle: &str) -> bool

Whether a runtime handle is still named by the policy completion gate.

Source

pub fn completion_gate(&self) -> CompletionGate

Source

pub fn check_foreground_write(&self, path: &str) -> ScopeDecision

Source

pub fn telemetry_json(&self) -> String

Source

pub fn enforcement_mode(&self) -> EnforcementMode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ThreadSafetyMarker for T
where T: Send,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more