Skip to main content

Module compose

Module compose 

Source
Expand description

The composition root of a session’s host stack. A cell’s host request passes, outermost first:

  1. kernel_apis::KernelApis: the kernel-API modules (skills.* with code skills, memory.*, hints.*, images.*, diagram.*, and the local services of services: refinements.*, experiments.*, gates.*), matched by prefix;
  2. inference::Inference: rlm.infer, rlm.load, rlm.frames;
  3. [Router]: subagents (rlm.spawn, rlm.collect, … served by delegation::host::Delegation for the calling lane, in host collect mode: a cell never waits); the lane API (rlm.lanes, rlm.lane.*, rlm.cells, rlm.cell.cancel, rlm.recovery) is answered by the session’s REPL lanes (lanes::Lanes) first;
  4. host::Host, sandboxed (host::Host::sandboxed with the sandbox.* settings) over the session’s file hooks (Loki): shell, jobs and the before-write check.

Each lane’s kernel runs inside the session’s shell sandbox (KernelOptions::sandbox), with ULTRON_FILE_HOOKS=1 (its writes ask the host first), a per-session spill dir, a signed snapshot under the profile’s rlm-snapshots/<session>/ with the profile snapshot key, and the continuity policy (checkpoint after each cell, restore on restart). Subagent and detached cell completions continue the run between turns (RuntimeEvents). The model sees one tool, rlm.

Structs§

AgentStores
Where the typed-agent host keeps its records, and how its rlm lanes run.
ChildReader
Who a subagent’s prompt is for: an in-memory child (without the durable runtime’s APIs) or not, and how much its guide says about memory (crate::memory_guidance, by its model’s tier).
ChildSetup
What a subagent runs with: its model, its system prompt (naming its working directory) and thinking level.
Config
What every lane of this process shares: settings, locations, guards and the snapshot key. Owned values only, so subagent lanes can be built on their own threads.
MemoryChoice
The memory backend a process uses (memory_backend).
Runtime
The process-wide composition: configuration and injected services.
RuntimeEvents
Completions of work a run started that outlives its cell: typed tasks nobody awaited (task_done), subagents (child_done) and detached cells (cell_done), of every lane. Each completion continues its lane’s run as a <runtime_event> message. ULTRON_ASYNC_EVENTS=off turns this off: nothing waits and nothing is announced.
Services
Collaborators a caller may supply in place of the defaults (tests, embedders).
Stack
One session’s host stack: the sandboxed host, the REPL lanes, the subagent host and the kernel-API modules.
SubagentHost
How a session’s subagents run, and where their task journal lives.
SystemPrompt
The root system prompt, rendered again only when the settings’ crate::lane::PromptMode changes (engineering mode, alwaysSkills), so the prompt-cache prefix stays stable (session-worker.ts currentSystemPrompt). A change applies from the next request.

Constants§

CELL_CANCELLED_SHELL
Why a cancelled cell’s shell request failed: Python raises it, so the cell ends at once with its kernel (and the lane’s variables) intact.
CONTEXT_REMINDER_ENV
CONTEXT_REMINDER_TOKENS_ENV
EXTENSIONS_UNSUPPORTED
What a cell’s ext.call / ext.list (runtime.py’s Pi extension functions) is answered.
GUIDE_ENV
LOKI_ENV
LOKI_TIMEOUT_MS_ENV
MASK_SECRETS_ENV
READ_HANDLE_BYTES_ENV
TURN_GUARDS_ENV
ULTRON_TURN_GUARDS: off turns the turn guards off.

Functions§

child_setup
A subagent’s lane: in its worktree when it has one (its shell, kernel and prompt name that working directory, as session-worker.ts rewrites it), on the session’s model unless the spawn named one.
hinted_lanes
A typed agent’s rlm lane runner whose every run’s end is reported to ended with its lane: the session’s cell hints start that lane’s stuck-loop detection over (cellHints.runEnded(lane) on every lane’s run_end), so a retained instance’s next run does not inherit the last one’s failure streak.
hints
Whether ULTRON_HINTS=on ends cell results with situational [hint:<tag>] lines (kernel_apis::cell_hints), which the runtime guide then explains.
mcp_runtime_guide
The runtime guide’s view of the mcp gateway: the tool and its servers when mcp.json names any.
memory_backend
The memory backend of a process with var and the settings of manager (profile agent_dir): memorantado::Endpoint::choose over the Hindsight server resolved the same way, probing memorantado over HTTP. Sessions and ultron memory both choose through it.
only_rlm
Whether a value lists exactly the rlm tool: the invariant every request body keeps.
session_environment
The environment a session’s kernels and commands start from (TS: the worker’s process.env, which kernel.ts kernelEnvironment filters and getShellEnv extends): every name this process has plus [SESSION_ENV_NAMES], each with the value the session’s var gives it (dropped when it gives none). Values come only from the session’s environment, never from this process’s: a session whose PATH differs runs its tools from its own PATH.
session_mask
The session’s masking of text that reaches the model: values MCP servers resolved (registerSecretValues) and the shipped rules, unless ULTRON_MASK_SECRETS turns it off.
store_roots
The session stores sessions.*, /continue and the dream’s quiet check search: the session root itself, then the profile’s native and Pi-format stores, then every project instance’s own store (<home>/.ultron/projects/*/sessions, where a session started in a project is kept), in name order.
task_event_summary
The summary of a task’s end event (taskEvent of session-worker.ts): the task’s definition, then its verdict tag ([passed, verified], [unverified], …) when it has one, then its reply (a non-string value as JSON) or, unless it succeeded, its error.
ts_guide
Whether ULTRON_GUIDE=ts asks for the TypeScript guide and output (the TS-recorded replays use it): no Rust-only APIs, wording or cell-result additions.
turn_guards
Whether the turn guards are on: a lane going in circles is told so and its seventh identical cell in a row is refused (kernel_apis::cell_hints), and the root’s turn is continued after an empty reply or with what its subagents left undone (crate::core turn_guard). Off under ULTRON_TURN_GUARDS=off and the TypeScript guide.
workspace_snapshotter
After-cell checks picture the directory between cells (workspace-snapshot.ts).

Type Aliases§

AgentLanes
Builds a typed-agent lane runner from the stack being built (it may hold the stack weakly).
McpListener
Told the session’s MCP gateway when its stack opens.