Skip to main content

Module mana_worker

Module mana_worker 

Source
Expand description

Canonical single-unit mana worker runtime.

Provides the reusable substrate for executing one mana unit: loading the unit via canonical mana-core APIs, assembling execution context (task prompt, prefill, dependency summaries), and reporting structured outcomes.

This module is consumed by:

  • imp run <unit-id> (imp-cli) — the preferred single-unit CLI path
  • legacy mana run compatibility flows — transitional dispatch into imp workers
  • imp’s native mana tool — the first-class orchestration UX

§Architecture

imp native mana tool        = first-class orchestration UX
imp run (this module)       = canonical single-unit worker runtime
legacy mana run compatibility = transitional parallel dispatch into imp workers

Re-exports§

pub use crate::contracts::worker::WorkerAssignment;
pub use crate::contracts::worker::WorkerAttempt;
pub use crate::contracts::worker::WorkerResult;
pub use crate::contracts::worker::WorkerStatus;

Structs§

PreparedWorkerRun
WorkerRunOptions
WorkerRunOutcome

Functions§

assemble_prefill
Assemble context prefill messages from the assignment’s file references.
build_task_context
build_task_prompt
Build a task prompt string from a worker assignment.
finalize_worker_run
load_assignment
Load a worker assignment from a mana unit using canonical mana-core APIs.
load_assignment_with_mana_dir
Load a worker assignment with an explicit mana dir override.
prepare_worker_run
run_worker_assignment