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: boolAuto-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: u32Maximum agent loops before stopping (default: 10, 0 = unlimited)
max_concurrent: u32Maximum parallel agents for mana run (default: 4)
poll_interval: u32Seconds 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: boolEnable 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: boolEnable 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: boolAutomatically 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: boolEnable 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: u64Minimum 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
impl Config
Sourcepub fn load(mana_dir: &Path) -> Result<Config, Error>
pub fn load(mana_dir: &Path) -> Result<Config, Error>
Load config from .mana/config.yaml inside the given units directory.
Sourcepub fn load_with_extends(mana_dir: &Path) -> Result<Config, Error>
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.
Sourcepub fn save(&self, mana_dir: &Path) -> Result<(), Error>
pub fn save(&self, mana_dir: &Path) -> Result<(), Error>
Save config to .mana/config.yaml inside the given units directory.
Sourcepub fn rules_path(&self, mana_dir: &Path) -> PathBuf
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.
Sourcepub fn increment_id(&mut self) -> u32
pub fn increment_id(&mut self) -> u32
Return the current next_id and increment it for the next call.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Config
impl Serialize for Config
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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