Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 29 fields pub project: String, pub next_id: u32, pub auto_close_parent: bool, pub run: Option<String>, pub plan: Option<String>, pub max_loops: u32, pub max_concurrent: u32, pub poll_interval: u32, pub extends: Vec<String>, pub rules_file: Option<String>, pub file_locking: bool, pub worktree: bool, pub on_close: Option<String>, pub on_fail: Option<String>, pub post_plan: Option<String>, pub verify_timeout: Option<u64>, pub review: Option<ReviewConfig>, pub user: Option<String>, pub user_email: Option<String>, pub auto_commit: bool, pub commit_template: Option<String>, pub research: Option<String>, pub run_model: Option<String>, pub plan_model: Option<String>, pub review_model: Option<String>, pub research_model: Option<String>, pub batch_verify: bool, pub memory_reserve_mb: u64, pub notify: Option<NotifyConfig>,
}
Expand description

Project-level mana configuration, loaded from .mana/config.yaml.

All fields have sensible defaults; only project and next_id are required in the YAML file. Optional fields are omitted when serialized to keep config files minimal.

Use Config::load_with_extends to load with inherited values from parent configs listed in the extends field.

Fields§

§project: String§next_id: u32§auto_close_parent: bool

Auto-close parent units when all children are closed/archived (default: true)

§run: Option<String>

Shell command template for --run. Use {id} as placeholder for unit ID. Example: claude -p "implement unit {id} and run mana close {id}". If unset, --run will print an error asking the user to configure it.

§plan: Option<String>

Shell command template for planning large units. Uses {id} placeholder. If unset, plan operations will print an error asking the user to configure it.

§max_loops: u32

Maximum agent loops before stopping (default: 10, 0 = unlimited)

§max_concurrent: u32

Maximum parallel agents for mana run (default: 4)

§poll_interval: u32

Seconds between polls in –watch mode (default: 30)

§extends: Vec<String>

Paths to parent config files to inherit from (lowest to highest priority). Supports ~/ for home directory. Paths are relative to the project root.

§rules_file: Option<String>

Path to project rules file, relative to .mana/ directory (default: “RULES.md”). Contents are injected into every mana context output.

§file_locking: bool

Enable file locking for concurrent agents (default: false). When enabled, agents lock files listed in unit paths on spawn and lock-on-write during execution. Prevents concurrent agents from clobbering the same file.

§worktree: bool

Enable git worktree isolation for parallel agents (default: false). When enabled, mana run creates a separate git worktree for each agent. Each agent works in its own directory, preventing file contention. On mana close, the worktree branch is merged back to main.

§on_close: Option<String>

Shell command template to run after a unit is successfully closed. Supports template variables: {id}, {title}, {status}, {branch}. Runs asynchronously — failures are logged but don’t affect the close.

§on_fail: Option<String>

Shell command template to run after a verify attempt fails. Supports template variables: {id}, {title}, {attempt}, {output}, {branch}. Runs asynchronously — failures are logged but don’t affect the operation.

§post_plan: Option<String>

Shell command template to run after mana plan creates children. Supports template variables: {id}, {parent}, {children}, {branch}. Runs asynchronously — failures are logged but don’t affect the plan.

§verify_timeout: Option<u64>

Default timeout in seconds for verify commands (default: None = no limit). Per-unit verify_timeout overrides this value.

§review: Option<ReviewConfig>

Adversarial review configuration (mana review / mana run --review). Optional — review is disabled if not configured.

§user: Option<String>

User identity name (e.g., “alice”). Used for claimed_by and created_by.

§user_email: Option<String>

User email (e.g., “alice@co”). Optional, for git integration.

§auto_commit: bool

Automatically commit all changes when a unit is closed (default: false). Creates a commit with message based on commit_template. Skipped in worktree mode (worktree already commits).

§commit_template: Option<String>

Template for auto-commit messages. Placeholders: {id}, {title}, {parent_id}, {labels}. Default: “feat(unit-{id}): {title}”

Keep {id} in the template so mana diff <id> can find the unit’s commit.

§research: Option<String>

Shell command template for project-level research (mana plan with no ID). Uses {parent_id} as placeholder for the parent unit that groups findings. Falls back to plan template with a research-oriented prompt if unset.

§run_model: Option<String>

Model to use for implementing units (mana run). Substituted into {model} in templates.

§plan_model: Option<String>

Model to use for planning/splitting (mana plan). Substituted into {model} in templates.

§review_model: Option<String>

Model to use for adversarial review (mana run --review). Substituted into {model} in templates.

§research_model: Option<String>

Model to use for project research (mana plan with no args). Substituted into {model} in templates.

§batch_verify: bool

Enable runner-mediated batch verification (default: false). When enabled, mana run sets MANA_BATCH_VERIFY=1 on spawned agents. Agents signal completion without running verify inline; the runner collects AwaitingVerify units and runs each unique verify command once.

§memory_reserve_mb: u64

Minimum available system memory (MB) to keep free when spawning agents. When set to a non-zero value, mana run checks available system memory before each agent spawn. If available memory is below this threshold, dispatch pauses until a running agent finishes and frees memory. Default: 0 (disabled). Recommended: 2048–4096 on a 16GB machine.

§notify: Option<NotifyConfig>

Notification settings for human-facing alerts (push notifications, desktop alerts, webhook pings). Separate from on_close/on_fail workflow hooks — those are for automation, these are for humans.

Implementations§

Source§

impl Config

Source

pub fn load(mana_dir: &Path) -> Result<Config, Error>

Load config from .mana/config.yaml inside the given units directory.

Source

pub fn load_with_extends(mana_dir: &Path) -> Result<Config, Error>

Load config with inheritance from extended configs.

Resolves the extends field, loading parent configs and merging inheritable fields. Local values take precedence over extended values. Fields project, next_id, and extends are never inherited.

Source

pub fn save(&self, mana_dir: &Path) -> Result<(), Error>

Save config to .mana/config.yaml inside the given units directory.

Source

pub fn rules_path(&self, mana_dir: &Path) -> PathBuf

Return the path to the project rules file. Defaults to .mana/RULES.md if rules_file is not set. The path is resolved relative to the units directory.

Source

pub fn increment_id(&mut self) -> u32

Return the current next_id and increment it for the next call.

Trait Implementations§

Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Config

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Config, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Config) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Config

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

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, 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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,