feagi_evolutionary/
lib.rs

1// Copyright 2025 Neuraville Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4/*!
5# FEAGI Evolution & Genome Management
6
7Handles all **genotype** operations for FEAGI:
8
9- Genome I/O (JSON ↔ Rust structs)
10- Genome validation
11- Evolution operators (mutation, crossover)
12- Fitness evaluation
13- Population management
14
15## Architecture
16
17This crate manages the **genetic blueprint** (genotype) of FEAGI brains.
18The actual instantiated brain structure (phenotype) is handled by `feagi-bdu`.
19
20## Separation of Concerns
21
22```text
23feagi-evo (Genotype)        feagi-bdu (Phenotype)
24─────────────────────       ─────────────────────
25│ Genome JSON I/O    │  →   │ Neuroembryogenesis │
26│ Genome Validation  │      │ Connectome I/O      │
27│ Evolution Ops      │      │ Synaptogenesis      │
28│ Fitness Eval       │      │ NPU Integration     │
29└────────────────────┘      └─────────────────────┘
30```
31
32## Modules
33
34- `genome` - Genome I/O and validation
35- `evolution` - Evolution operators (future)
36- `fitness` - Fitness evaluation (future)
37- `population` - Population management (future)
38
39Copyright 2025 Neuraville Inc.
40Licensed under the Apache License, Version 2.0
41*/
42
43/// Crate version from Cargo.toml
44pub const VERSION: &str = env!("CARGO_PKG_VERSION");
45
46// Core modules
47pub mod converter_flat;
48pub mod converter_flat_full;
49pub mod converter_hierarchical_to_flat;
50pub mod cortical_type_parser;
51pub mod genome;
52pub mod random;
53pub mod runtime;
54pub mod storage;
55pub mod templates;
56pub mod types;
57pub mod validator;
58
59// Re-export commonly used types
60pub use converter_flat::convert_flat_to_hierarchical;
61pub use converter_flat_full::convert_flat_to_hierarchical_full;
62pub use converter_hierarchical_to_flat::convert_hierarchical_to_flat;
63pub use cortical_type_parser::{parse_cortical_type, validate_cortical_type};
64pub use genome::parser::string_to_cortical_id;
65pub use genome::{
66    load_genome_from_file, load_genome_from_json, migrate_genome, peek_quantization_precision,
67    save_genome_to_file, save_genome_to_json, GenomeParser, GenomeSaver, MigrationResult,
68    ParsedGenome,
69};
70pub use runtime::{
71    GenomeMetadata, GenomeSignatures, GenomeStats, Morphology, MorphologyParameters,
72    MorphologyRegistry, MorphologyType, PatternElement, PhysiologyConfig, RuntimeGenome,
73};
74#[cfg(feature = "async-tokio")]
75pub use storage::fs_storage::FileSystemStorage;
76pub use storage::{GenomeStorage, StorageError};
77pub use templates::{
78    add_core_morphologies, create_death_area, create_genome_with_core_areas,
79    create_genome_with_core_morphologies, create_minimal_genome, create_power_area,
80    ensure_core_components, get_default_neural_properties, load_barebones_genome,
81    load_essential_genome, load_test_genome, load_vision_genome, BAREBONES_GENOME_JSON,
82    ESSENTIAL_GENOME_JSON, TEST_GENOME_JSON, VISION_GENOME_JSON,
83};
84pub use types::{EvoError, EvoResult};
85pub use validator::{validate_genome, ValidationResult};