Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Identity, memory, energy, scars

The guard is built on Lineage’s original model of software with real consequences. The model is still available directly, for simulations, games, research, and any system that should age rather than reset.

PrincipleModuleType
Identity cannot be clonedlineage::identityIdentity, deliberately neither Clone nor Copy
History is append-onlylineage::memoryMemory, Event
Energy is finite and never rechargeslineage::metabolismMetabolism
Damage leaves permanent scarslineage::scarScarTissue, Scar, ScarSeverity
Death is finallineage::lineageLineage, which ties the four together
#![allow(unused)]
fn main() {
use lineage::{Lineage, OperationError, OperationResult};
use lineage::scar::ScarSeverity;

let mut lineage = Lineage::create(1000);                 // 1000 energy, a unique identity
match lineage.perform_operation("Initialize".to_string(), 100) {
    OperationResult::Success { energy_consumed } => println!("used {energy_consumed}"),
    other => println!("{other:?}"),                        // InsufficientEnergy, Dead, …
}
let _ = lineage.record_error(OperationError::new(ScarSeverity::Minor, "timeout".to_string()));
println!("{}", lineage.status());
}
=== Lineage Status ===
Identity: 3c11becc8cd2fb99f1c7d25deb518f8aa2e1f0549e89fc61e69a5d13d4518f78
Status: ALIVE
Energy: 900/1000 (10.0% consumed)
Events: 4
Scars: 1 (damage score: 1)

Operations cost energy. Errors leave scars that raise future costs. When energy runs out, the lineage dies, and its memory is sealed with a termination event. There’s no API to heal, recharge, or revive.

Task agents (lineage::agent) wrap the model for task execution:

#![allow(unused)]
fn main() {
use lineage::{TaskAgent, Task, TaskOutcome};

let mut agent = TaskAgent::create(500);
let result = agent.execute_task(Task::new("Execute governance vote".to_string(), 20), TaskOutcome::Success);
// Completed { energy_consumed: 20 }
}

How it relates to the guard

Original modelGuard
IdentityAn agent ID and its log’s genesis record
Memory (in process)The signed, persistent audit log
Metabolism energyThe policy budget
ScarTissueGuard scars and scar_limit
DeathTermination

The guard adds what the in-process model can’t give you: persistence across restarts, cryptographic evidence, and control from outside the agent’s process.

Try lineage demo, or cargo run --example lifecycle_demo in the repository. The design is described in docs/DOCTRINE.md and docs/MANIFESTO.md.