Skip to main content

SchedulerContext

Struct SchedulerContext 

Source
pub struct SchedulerContext<'a> {
Show 15 fields pub accessible_workdir: WorkdirRoot, pub runtime_dir: RuntimeDirRoots, pub capability_policy: CapabilityPolicy, pub installed_tools: HashSet<String>, pub capsule_versions: HashMap<String, String>, pub current_session_id: Option<String>, pub current_context_id: Option<String>, pub registry: Arc<dyn Registry>, pub spawn_credential: Option<SpawnCredential>, pub formation_id: Option<FormationId>, pub deadline: Option<SessionDeadline>, pub trace: Option<&'a PlanTraceAppender>, pub gate_step: &'a (dyn Fn(&PlannedCall<'_>) -> Option<String> + Sync), pub invoke_tool: &'a (dyn Fn(&str, ToolInput) -> Result<ToolResult, String> + Sync), pub task: Option<&'a dyn PlanTask>,
}

Fields§

§accessible_workdir: WorkdirRoot

The directory a shell step runs in and a tool step resolves a data_path against — the capsule’s own workdir, which under --workdir is the operator’s directory.

§runtime_dir: RuntimeDirRoots

The session’s runtime directory and its siblings: the plan file is read from runtime/plans/, and every shell step is told the directory through $MURMUR_RUNTIME_DIR and may read it and not change it, as the session’s own commands may. A shell step’s $HOME and $TMPDIR are its records directory’s home/ and tmp/.

§capability_policy: CapabilityPolicy§installed_tools: HashSet<String>§capsule_versions: HashMap<String, String>§current_session_id: Option<String>§current_context_id: Option<String>

The conversation the task that started this plan is running in, named on the MURMUR_SPAWNER handle every capsule step injects into its child.

Nothing is minted here. None names no conversation and injects no handle at all, which is the existing behaviour for a caller that has none, and not an error: a child told it was spawned from a conversation that does not exist is worse than one told nothing.

§registry: Arc<dyn Registry>

Where a capsule step reads a sub-capsule’s manifest from, to learn which host variables that sub-capsule declares. The session’s own store, so a step resolves the artifact its child will run.

§spawn_credential: Option<SpawnCredential>

The credential this session presents to mur-roost when a capsule step delegates.

None for every session that was not granted capabilities.spawn.allow, and a capsule step in such a session fails before any request is made. The token is held here and read exactly twice — into the two request headers below — so nothing that formats this context, a step result or a trace record can carry it.

§formation_id: Option<FormationId>

The session’s formation, which every capsule step’s child joins. None for a session nobody placed in a formation, whose children carry none either.

§deadline: Option<SessionDeadline>

The session’s deadline, which every capsule step’s child inherits as its own session deadline. None bounds no child.

§trace: Option<&'a PlanTraceAppender>

Where this run’s per-step lifecycle records and its capsule steps’ delegation records go, or None to record nothing.

Emission is opt-in at the call site: with None no file is opened and no line is written, and the run’s ExecutionReport is identical either way.

A capsule step writes into it twice over, and the two pairs describe different things: the plan-step pair is the scheduler’s unit of work — its dependencies, its attempts, its status after on_error — and the delegation pair is one child launch, named by its dlg_ id. A retried step is one plan step and several delegations.

§gate_step: &'a (dyn Fn(&PlannedCall<'_>) -> Option<String> + Sync)

The session’s own pre-dispatch decision point, asked about every tool and shell step before it runs. Some(reason) fails that step with reason as its error and dispatches nothing.

A plan step is a call the model made, one indirection removed, so it is subject to the same two refusals a direct call is: capabilities.filesystem.read_only and a commit_policy: deny policy hook. Without this the scheduler would reach the session’s executors underneath both, and a command the session refuses would run as a plan step.

A capsule step is not asked about: it runs nothing in this session, and the child it delegates to applies its own manifest to whatever it does.

§invoke_tool: &'a (dyn Fn(&str, ToolInput) -> Result<ToolResult, String> + Sync)§task: Option<&'a dyn PlanTask>

The task this plan runs for, or None for a run that cannot be cancelled and whose capsule steps account for their children in no set beyond their own trace lines.

Once it reports cancelled, a running capsule step ends its sub-capsule, no step is retried or dispatched, and the run ends canceled. A tool or shell step already running finishes on its own bound.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for SchedulerContext<'a>

§

impl<'a> !UnwindSafe for SchedulerContext<'a>

§

impl<'a> Freeze for SchedulerContext<'a>

§

impl<'a> Send for SchedulerContext<'a>

§

impl<'a> Sync for SchedulerContext<'a>

§

impl<'a> Unpin for SchedulerContext<'a>

§

impl<'a> UnsafeUnpin for SchedulerContext<'a>

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> 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<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