lineage/lib.rs
1//! # Lineage - Software Identity Through Irreversible Change
2//!
3//! Lineage is an ontological system for software that experiences consequences.
4//!
5//! ## Core Guarantees
6//!
7//! - **Identity cannot be cloned or copied**
8//! - **History cannot be erased or rewritten**
9//! - **Energy cannot be restored or recharged**
10//! - **Scars are permanent and visible forever**
11//! - **Death is final and irreversible**
12//!
13//! ## Quick Start
14//!
15//! ```rust
16//! use lineage::{Lineage, OperationResult};
17//! use lineage::scar::ScarSeverity;
18//!
19//! // Create a lineage with 1000 energy units
20//! let mut lineage = Lineage::create(1000);
21//!
22//! // Perform an operation (costs energy)
23//! match lineage.perform_operation("Initialize".to_string(), 100) {
24//! OperationResult::Success { energy_consumed } => {
25//! println!("Success! Used {} energy", energy_consumed);
26//! }
27//! OperationResult::InsufficientEnergy { required, available } => {
28//! println!("Failed: need {}, have {}", required, available);
29//! }
30//! OperationResult::Dead => {
31//! println!("Lineage is dead");
32//! }
33//! OperationResult::OntologicalViolation { reason } => {
34//! eprintln!("FATAL: {}", reason);
35//! }
36//! }
37//!
38//! // Check status
39//! println!("{}", lineage.status());
40//! ```
41//!
42//! ## Ontological Principles
43//!
44//! This system enforces **correctness over convenience**:
45//!
46//! 1. **No rollback** - History is append-only and immutable
47//! 2. **No resurrection** - Death is permanent
48//! 3. **No duplication** - Identity cannot be cloned
49//! 4. **No recharge** - Energy is finite and non-renewable
50//! 5. **No healing** - Scars are permanent
51//!
52//! These are not limitations. These are **fundamental design principles**.
53//!
54//! ## Architecture
55//!
56//! - [`identity`] - Unique, non-copyable identity system
57//! - [`memory`] - Append-only causal event log
58//! - [`metabolism`] - Finite energy and death
59//! - [`scar`] - Permanent error recording
60//! - [`lineage`] - Complete lifecycle orchestration
61
62pub mod identity;
63pub mod memory;
64pub mod metabolism;
65pub mod scar;
66pub mod lineage;
67pub mod behavior;
68pub mod trust;
69pub mod agent;
70pub mod graveyard;
71pub mod finance;
72
73// Re-export main types for convenience
74pub use lineage::{Lineage, OperationResult, OperationError, LineageStatus};
75pub use identity::Identity;
76pub use memory::{Memory, Event};
77pub use metabolism::{Metabolism, ConsumptionResult};
78pub use scar::{ScarTissue, Scar, ScarSeverity};
79pub use behavior::{PulseBehavior, PulseOutput};
80pub use trust::{TrustedActor, TrustCapability, TrustResult, ViolationType};
81pub use agent::{TaskAgent, Task, TaskOutcome, TaskResult};
82pub use graveyard::{Graveyard, Tombstone, GraveyardError, IdentityBlock, MetabolicRecord, PathologyReport};
83
84// Finance module re-exports
85pub use finance::{
86 FinanceAgent, FinanceAgentStatus, AgentMetrics,
87 Trade, TradeDirection, TradeResult, TradeOperation, ExecutionError,
88 FinancialScar, ScarImpact, FinancialDamage,
89 Offspring, OffspringTraits, InheritanceStrategy,
90 PerformanceScore, TrustFormula, TrustGrant,
91 Arena, CompetitionResult, MarketState,
92 BlockchainHook, EvolutionaryStrategy,
93 ResurrectionMechanic, ResurrectionRecord,
94 FinanceConfig,
95 MarketDataClient, PriceData, PricePoint, MarketDataConfig, MarketDataError,
96};