Skip to main content

oris_evolution/
gep.rs

1//! GEP (Genome Evolution Protocol) compatible types.
2//!
3//! This module provides GEP-compliant structures that extend the core evolution types.
4//! Reference: https://evomap.ai/wiki#GEP-Protocol
5
6mod capsule;
7mod content_hash;
8mod gene;
9mod memory_graph;
10
11pub use capsule::*;
12pub use content_hash::*;
13pub use gene::*;
14pub use memory_graph::*;
15
16use serde::{Deserialize, Serialize};
17
18/// GEP Protocol schema version
19pub const GEP_SCHEMA_VERSION: &str = "1.5.0";
20
21/// Common envelope fields for all GEP asset types
22#[derive(Clone, Debug, Serialize, Deserialize)]
23pub struct GepEnvelope<T> {
24    #[serde(rename = "type")]
25    pub asset_type: String,
26    #[serde(rename = "schema_version")]
27    pub schema_version: String,
28    #[serde(rename = "asset_id")]
29    pub asset_id: String,
30    #[serde(flatten)]
31    pub data: T,
32}
33
34#[cfg(test)]
35mod tests {
36    use super::*;
37
38    #[test]
39    fn test_schema_version() {
40        assert_eq!(GEP_SCHEMA_VERSION, "1.5.0");
41    }
42}