Skip to main content

Module unit

Module unit 

Source
Expand description

Core unit data model.

A Unit is the fundamental work item in mana. Units are stored as Markdown files with YAML frontmatter (.mana/{id}-{slug}.md) and carry everything an agent needs to perform and verify a single piece of work: title, description, verify command, dependency links, attempt history, and lifecycle metadata.

§File format

---
id: '42'
title: Fix the login bug
status: open
priority: 2
created_at: '2026-01-01T00:00:00Z'
updated_at: '2026-01-01T00:00:00Z'
verify: cargo test --test login
---

## Description

The login flow fails when the session cookie expires mid-request.

§Reading and writing

use mana_core::unit::Unit;
use std::path::Path;

// Read from file
let unit = Unit::from_file(Path::new(".mana/42-fix-login-bug.md")).unwrap();

// Modify and write back
let mut unit = unit;
unit.notes = Some("Root cause: token expiry not checked".to_string());
unit.to_file(Path::new(".mana/42-fix-login-bug.md")).unwrap();

Re-exports§

pub use types::*;

Modules§

types

Structs§

Unit
A single unit of work managed by mana.

Enums§

UnitType
Explicit type for a unit.

Functions§

validate_priority
Validate that priority is in the valid range (0-4, P0-P4).