vex_core/lib.rs
1//! # VEX Core
2//!
3//! Core types for the VEX protocol — adversarial, temporal, cryptographically-verified AI agents.
4//!
5//! ## Key Types
6//!
7//! - [`Agent`] — Fractal agent with evolutionary capabilities
8//! - [`ContextPacket`] — Time-aware, hashable context unit
9//! - [`MerkleTree`] — Cryptographic verification of context hierarchies
10//! - [`Genome`] — Evolutionary traits that map to LLM parameters
11//!
12//! ## Quick Start
13//!
14//! ```rust
15//! use vex_core::{Agent, AgentConfig};
16//!
17//! // Create an agent
18//! let agent = Agent::new(AgentConfig {
19//! name: "Researcher".to_string(),
20//! role: "You are a helpful research assistant".to_string(),
21//! max_depth: 3,
22//! spawn_shadow: true,
23//! });
24//!
25//! // Spawn a child agent
26//! let child = agent.spawn_child(AgentConfig {
27//! name: "Specialist".to_string(),
28//! role: "You analyze data".to_string(),
29//! max_depth: 2,
30//! spawn_shadow: false,
31//! });
32//! ```
33//!
34//! ## Merkle Verification
35//!
36//! ```rust
37//! use vex_core::{MerkleTree, Hash};
38//!
39//! // Build a Merkle tree from context hashes
40//! let leaves = vec![
41//! ("ctx1".to_string(), Hash::digest(b"context 1")),
42//! ("ctx2".to_string(), Hash::digest(b"context 2")),
43//! ];
44//! let tree = MerkleTree::from_leaves(leaves);
45//!
46//! // Verify integrity
47//! assert!(tree.root_hash().is_some());
48//! ```
49
50pub mod agent;
51pub mod audit;
52pub mod context;
53pub mod evolution;
54pub mod evolution_memory;
55pub mod fitness;
56pub mod genome_experiment;
57pub mod merkle;
58pub mod rule;
59
60pub use agent::{Agent, AgentConfig, AgentHandle, AgentId};
61pub use audit::{ActorType, AuditEvent, AuditEventType, HashParams, Signature};
62pub use context::{CompressionLevel, ContextPacket};
63pub use evolution::{
64 tournament_select, Fitness, GeneticOperator, Genome, LlmParams, StandardOperator,
65};
66pub use evolution_memory::{EvolutionMemory, TraitAdjustment};
67pub use fitness::{EvaluationContext, FitnessEvaluator, FitnessReport, HeuristicEvaluator};
68pub use genome_experiment::GenomeExperiment;
69pub use merkle::{Hash, MerkleNode, MerkleProof, MerkleTree, ProofDirection, ProofStep};
70pub use rule::OptimizationRule;