pub struct Stack {Show 21 fields
pub host: Arc<Host>,
pub delegation: Delegation,
pub lanes: Lanes,
pub events: Arc<RuntimeEvents>,
pub cell_progress: Arc<Mutex<Option<CellProgress>>>,
pub agents: Agents,
pub usage: UsageLedger,
pub frames: Arc<FrameSession>,
pub schedules: Arc<SchedulesModule>,
pub goal: Arc<GoalDriver>,
pub work: OnceLock<DurableWork>,
pub context: OnceLock<Arc<ContextControl>>,
pub images: Arc<ViewImages>,
pub swarm: OnceLock<Arc<SwarmOps>>,
pub budget_note: Arc<OnceLock<Arc<dyn Fn(&str) -> Option<String> + Send + Sync>>>,
pub request_layer: Arc<OnceLock<RequestLayer>>,
pub context_reminders: Arc<ContextReminders>,
pub lane_steer: Arc<OnceLock<Arc<dyn Fn(&str, &str) -> bool + Send + Sync>>>,
pub stats: Arc<SessionStats>,
pub wake: RootWake,
pub ledger: Ledger,
/* private fields */
}Expand description
One session’s host stack: the sandboxed host, the REPL lanes, the subagent host and the kernel-API modules.
Fields§
§host: Arc<Host>§delegation: Delegation§lanes: Lanes§events: Arc<RuntimeEvents>§cell_progress: Arc<Mutex<Option<CellProgress>>>The durable progress of the root lane’s running cell: what its shell operations print is its partial output, kept if the worker dies before the cell ends.
agents: AgentsThe typed-agent host (agents.*, background.*, workflows.run) and its usage ledger.
usage: UsageLedger§frames: Arc<FrameSession>The session’s bounded-inference frames (rlm.infer, rlm.map, rlm.frames): budgets, traces, tasks.
schedules: Arc<SchedulesModule>schedules.* and the session goal (goal.*, /goal), on the root lane.
goal: Arc<GoalDriver>§work: OnceLock<DurableWork>Schedules, the goal and shell jobs as durable work: recovered when the stack opens, its tick running.
context: OnceLock<Arc<ContextControl>>Model-owned context of every lane (ctx.*; collapse on return on the root), once the session actor opened it.
images: Arc<ViewImages>The images each lane’s running cell attached with view_image, and the model each lane’s results go to.
swarm: OnceLock<Arc<SwarmOps>>swarm.*, board.*, notes.* and persistent children, once the session actor opened the durable runtime.
budget_note: Arc<OnceLock<Arc<dyn Fn(&str) -> Option<String> + Send + Sync>>>The budget line every lane’s cell results end with, once the session actor wired it (crate::budget_note).
request_layer: Arc<OnceLock<RequestLayer>>A layer over every lane’s host requests, set by a composition root whose root is not the session actor’s (crate::request_layer); none: requests pass through.
context_reminders: Arc<ContextReminders>The context-pressure reminder every lane’s cell results may end with (crate::context_reminder): each lane’s limit and, once the session actor wired it, the meter of its context use.
lane_steer: Arc<OnceLock<Arc<dyn Fn(&str, &str) -> bool + Send + Sync>>>Steering into a child lane’s running conversation (crate::agent_hub), once the session actor wired it.
stats: Arc<SessionStats>The session’s runtime counters (crate::session_stats), for /usage.
wake: RootWakeWhether the host wakes the root lane when its work ends (crate::wake): set by the composer that drives the root; every other lane waits in its cell.
ledger: LedgerThe session’s refinements ledger (crate::auto_refine proposes into it and delivers from it).
Implementations§
Source§impl Stack
impl Stack
Sourcepub fn record_judge_rows_in(&self, session: SharedSession)
pub fn record_judge_rows_in(&self, session: SharedSession)
judge.decide records its calls as usage rows of session: for a composer whose modules keep no session
values (an ultron claude server); a native session’s go to its values already.
Sourcepub fn memory(&self) -> Option<&MemoryService>
pub fn memory(&self) -> Option<&MemoryService>
memory.*’s service, when memory is on (crate::auto_memory recalls and keeps through it).
Sourcepub fn prompt_schedules(&self) -> &Arc<ScheduleModule> ⓘ
pub fn prompt_schedules(&self) -> &Arc<ScheduleModule> ⓘ
schedule.*: the session’s scheduled prompts (fired by the server through the session actor).
Sourcepub fn pool_stats(&self) -> Value
pub fn pool_stats(&self) -> Value
poolStats() as the worker answers an inspected rlm.pool: the lanes’ kernel pool, plus the session’s
file-hook guard statistics (guards) when it has guards.
Sourcepub fn guard_stats(&self) -> Vec<Value>
pub fn guard_stats(&self) -> Vec<Value>
fileHooks.stats() over the whole session: the session host’s guards, with the same guards of every worktree
subagent’s host (live or ended) added in.
Sourcepub fn begin_turn(&self)
pub fn begin_turn(&self)
A new root turn began (fileHooks.beginTurn()): every host’s per-turn guard times start from zero.
Sourcepub fn cell_handler(
&self,
lane: &str,
cell: Option<(Signal, Park)>,
) -> Arc<dyn HostHandler> ⓘ
pub fn cell_handler( &self, lane: &str, cell: Option<(Signal, Park)>, ) -> Arc<dyn HostHandler> ⓘ
The handler lane’s requests go to (outermost layer first). cell: the cell’s wait signal and park
callback (subagent waits end with the cell); none for requests outside a cell.
Sourcepub fn rlm(&self, lane: &str) -> Result<Rlm, String>
pub fn rlm(&self, lane: &str) -> Result<Rlm, String>
The rlm tool over lane (opened when needed).
Sourcepub fn commands(&self) -> Vec<Value>
pub fn commands(&self) -> Vec<Value>
listCommands: /mcp, /review, prompt templates and skills (crate::commands).
Sourcepub fn prompt_templates(&self) -> Vec<PromptTemplate>
pub fn prompt_templates(&self) -> Vec<PromptTemplate>
The session’s prompt templates, the ones Stack::commands lists as /name commands.
pub fn root_model(&self) -> Model
Sourcepub fn set_root_model(&self, model: &Model)
pub fn set_root_model(&self, model: &Model)
The root lane switched to model (set_model, cycle_model): frames, the predict adapter and the root’s
view_image follow it.
Sourcepub fn child_system(&self, model: &Model) -> String
pub fn child_system(&self, model: &Model) -> String
The system prompt of a subagent lane on model (crate::wake: its runtime guide says to await before
replying; crate::memory_guidance: a model cheaper than the root’s is told how to use memory too).
Sourcepub fn hand_over(&self)
pub fn hand_over(&self)
As Stack::close, for a worker whose session a successor worker takes over: running shell jobs keep
running, journaled as running, for the successor to follow (DurableWork::hand_over), and subagents are not
cancelled: their tasks stay unfinished in the journal, so the successor reattaches them as after a crash.
Sourcepub fn close(&self)
pub fn close(&self)
Stop the session’s lanes and subagents, and its durable work (the tick, goal jobs, shell jobs).
Sourcepub fn cell_hints(&self) -> &Arc<CellHints> ⓘ
pub fn cell_hints(&self) -> &Arc<CellHints> ⓘ
The session’s situational hints (ULTRON_HINTS).
Sourcepub fn mcp(&self) -> &Arc<Gateway> ⓘ
pub fn mcp(&self) -> &Arc<Gateway> ⓘ
The session’s MCP gateway (/mcp, and the REPL’s mcp namespace through tools.*).
Sourcepub fn tool_calls(&self) -> &Arc<ToolCalls> ⓘ
pub fn tool_calls(&self) -> &Arc<ToolCalls> ⓘ
The session’s REPL tool calls (tools.*).
Sourcepub fn mask(&self) -> MaskText
pub fn mask(&self) -> MaskText
The session’s masking of text that reaches the model (see session_mask).