Expand description
Host operations behind the thin Python kernel APIs, served as one kernel::HostHandler:
skills.*: the version-pinned skill catalog (refresh, list, select, load, why; invoke is validated but needs task spawning) and code skills (propose_code / propose_policy with test gating in a fresh kernel, rollback, code_list, code_history), ported fromultron/skills.tsandultron/code-skills.ts;memory.*: prepare / propose / correct / get / forget / why / list over a Hindsight-shaped backend, ported fromultron/memory.tsand the dispatch ofultron/worker-services.ts;images.*: image generation through the OpenRouter images API, saved to files (images);sessions.*: stored sessions listed, grepped and read as spans, read-only (sessions);hints.*: per-lane hint mutes (ultron/rlm/hints.ts), andcell_hints, the situational hints a cell’s result ends with;tools.*: extension tool calls from the REPL, detached afteryield_after(ultron/rlm/extension-tools.ts);schedules.*,goals.*andgoal.*as durable work: the schedule tick, goal recovery over the task journal, andDurableWork, the entry point a composition root opens and closes.
Modules are ApiModules, matched by request-type prefix as TS host modules are; every other request goes to
the inner handler. Modules start once, on the first request of any type. Requests carry the calling lane, the
task that owns it (from the TaskHost) and the host’s task operations.
Re-exports§
pub use artifacts::FileKeyedDocuments;pub use artifacts::KeyedDocuments;pub use artifacts::MemoryKeyedDocuments;pub use code_skills::CodeSkillKind;pub use code_skills::CodeSkills;pub use code_skills::CodeSkillsOptions;pub use context_control::ContextBranches;pub use context_control::ContextControl;pub use durable_work::DurableWork;pub use durable_work::DurableWorkOptions;pub use durable_work::Recovered;pub use family::FamilyModule;pub use family::FamilyOptions;pub use goal::GoalDriver;pub use goal::GoalJobs;pub use goal::JobState;pub use goal::TaskGoalJobs;pub use hints::HintsModule;pub use images::ImagesConfig;pub use images::ImagesModule;pub use instances::InstancesModule;pub use memory::MemoryApi;pub use memory::MemoryBackend;pub use memory::MemoryError;pub use memory::MemoryService;pub use memory::worker_gate;pub use progress::ProgressModule;pub use schedule_tick::ManualTickClock;pub use schedule_tick::ScheduleTicker;pub use schedule_tick::TickClock;pub use schedules::SchedulesModule;pub use sessions::SessionsModule;pub use skills::PinnedSkill;pub use skills::SkillLoader;pub use skills::SkillSource;pub use skills::SkillsModule;pub use tasks::RootOnly;pub use tasks::TaskHost;pub use tool_calls::ToolCallEnd;pub use tool_calls::ToolCalls;pub use tool_calls::ToolInfo;pub use tool_calls::ToolRunner;
Modules§
- artifacts
- Keyed durable documents (
DurableDocumentStorageofultron/local-services.ts), in memory or in one JSON file: the store of schedules, local services and prompt schedules. (TypeScript’sartifacts.*host requests over the same store are not ported.) - cell_
hints - Situational hints (
ultron/rlm/hints.tsCellHints,ultron/rlm/loop-detector.ts): the host watches how a lane uses the runtime and ends a cell’s result with at most one short tagged line,[hint:<tag>] ..., when something worth knowing happened in that cell: a command detached into a job, a long wait on a job whose completion would have arrived as an event, polling, truncated output, a large file read into a string, the same exception three cells in a row, the same cell run again and again, or a lane stuck in a loop of failing or alternating cells. Mutes and per-tag counts areHintsModule’s (hints.mute). Hints are off unlessULTRON_HINTS=on. - code_
skills - Code skills: procedural memory as tested Python (port of
ultron/code-skills.ts). - context_
control ctx.*(port of the request side ofultron/context-control.ts) and the context-edit semantics it relies on (applyContextEdits/contextEditsOfofpackages/agent/src/harness/session/context.ts).- durable_
work - Durable work: schedules, the session goal and shell jobs as durable tasks that survive worker restarts. This is the one entry point a composition root calls.
- family
agent_message.*(port ofultron/family.ts): untrusted messages between a task and its direct parent or children. The host derives the sender from the calling lane and enforces scope: a task messages only its parent or a direct child, verifier tasks only talk to their direct parent and never accept steering, and a finished task receives nothing. Akeymakes a send idempotent per sender. Steering delivers through the receiver’s lane (recorded as delivered before it is handed over, so a crash cannot deliver twice); otherwise messages wait in the receiver’s bounded inbox untilreceivemarks them delivered. Delivered and expired history is kept, bounded, in the module document{version: 1, messages}.- goal
- The session goal (
/goal, port ofultron/goal.tsGoalDriver): a person sets one objective and a background job (its own REPL, under the usage rootgoal:<id>) works on it until the goal ends. - hints
hints.mute/hints.unmute/hints.muted(the request side ofultron/rlm/hints.ts): per-lane hint mutes, persisted in the module document{version: 1, lanes: {<lane>: {muted, fired}}}.- images
images.generate/images.models(rlm.imagesof images_api.py): image generation through the ported OpenRouter images API (ai::images, TSapi/openrouter-images.ts). The host makes the requests, saves every image to a file and answers with the paths, so no image bytes reach the cell or the model’s context.- instances
instances.*(port ofultron/instances.ts): a completed RLM task can be retained so later invocations run on the same lane, continuing its conversation and declaredstate, while each invocation gets its own task record. An open instance pins its lane’s kernel (holderinstance:<id>); closing unpins it, and a restarted owner re-pins every open instance. Pinning is best effort: retain reportspinned: falsewhen the pool has no capacity.- memory
memory.*(port ofultron/memory.tsNativeMemoryService and the memory dispatch ofworker-services.ts).- memory_
import ultron memory import --from claude-code|codex: the notes other harnesses keep on disk become typed memory records (crate::memory_records), stored throughmemory.proposewith the user’s evidence, so the same secret check refuses what holds a secret. Which files are read follows Mirror (memory/import/*.rs):- memory_
pointers - File-linked memory as pointers: when a cell writes a file (a checked
write()/edit()or any other change the after-cell snapshot finds) that matches a typed record’spathGlobs, the lane’s next cell result ends with one line per record,[memory] <id> <type>: <situation>, never the record’s content: the model reads it withmemory.get(id)when it wants it. At mostMAX_POINTERSlines per cell; each record is pointed at once per session. The settingmemory.filePointers: falseturns this off. - memory_
records - Typed memory records (idea from Mirror’s
memory_record.rs, fitted to Ultron’s journal + Hindsight memory). - progress
progress.*(port ofultron/progress.ts): evidence-based progress receipts and reassessment. Progress is inferred only from recorded evidence and task state; reassessment never raises a budget, and a completion claim is verified only by a verifier task the host ran that returnedpassed: true. The document is{version: 1, receipts, decisions}; a verifier still pending when the owner ended is settled as unverified on load.- prompt_
schedule schedule.*(schedule_api.py, Rust host only): prompts a session sends itself later, the proactive agent.- schedule_
tick - The schedule tick: fires due schedules on its own, without anything else waking the session (the TS
ScheduleModuleinterval timer,tickIntervalMs). - schedules
schedules.*andgoals.*(port ofultron/schedules.ts): recurring task firings and goals with required checks. Firings are admitted throughTaskHost::spawnwith a slot-derived key (schedule:<id>:<slot>), and each slot is claimed durably (last_slot,pending_slot) before admission, so duplicate ticks and restarts never run a slot twice; a claimed slot that fails is recorded once and never retried. Missed slots coalesce into one run of the latest slot (skipped). A goal is achieved only when every required check succeeds withpassed: true;max_taskscaps firings, verification and attachments. The document is{version: 1, schedules, goals}.- sessions
sessions.list/sessions.search/sessions.read(sessionsof sessions_api.py): the stored sessions of this project, or of every project, listed, grepped and read read-only throughsession_journal::search. A finding cites its turns as a span,session://<id>#<from>..<to>, whichsessions.readreads back.- skills
skills.*requests (port ofultron/skills.ts): the version-pinned, explainable skill catalog and the code-skill requests, journaled in the module document. Selection never grants capabilities: frontmatter keys that would grant tools, models, budgets or permissions are reported and ignored.- store
- Durable module documents: the format version a stored document is read at.
- tasks
- The task operations host modules use (TS
NativeHostApiofultron/rlm/host-module.ts). Tasks and results are the TS JSON shapes (NativeTask,NativeResultofultron/rlm/task-store.ts) so modules port unchanged. Identity comes from the calling lane, never from a payload. - tool_
calls tools.*: extension tool calls from the REPL (ultron/rlm/extension-tools.tsExtensionToolCalls). The kernel calls a tool withawait tools.call(name, params)/await tools.<name>(...)/await mcp.call(...)(themcpgateway is a tool like any other); the host runs it on its own thread through aToolRunnerwith a cancel signal. Every call is a record (name, label, status, elapsed time, input and result previews), journaled as the module document{version: 1, calls: [...]}.- util
- The clock seam and small checks the modules share. The JavaScript semantics they use are in
jsrt.
Structs§
- Kernel
Apis - Request
- One host request as a module sees it (TS
HostModuleRequestplus theNativeHostApi).
Traits§
- ApiModule
- A host module: owns every request type that starts with one of its prefixes.