swarm-engine-core 0.1.6

Core types and orchestration for SwarmEngine
Documentation
//! Store Module - 永続化レイヤーの Clean Architecture 実装
//!
//! ## 設計思想
//!
//! - **Domain と Infrastructure の分離**: Repository が Domain に対する唯一のインターフェース
//! - **Entity と DTO の分離**: Domain Entity は永続化詳細を知らない
//! - **Record と Episode の分離**: 生データ(Record)と集約(Episode)は別々に管理
//!
//! ## 構成
//!
//! ```text
//! Domain Layer
//!//!   └── EpisodeRepository (trait)  ← Domain が依存する唯一のインターフェース
//!//! Infrastructure Layer
//!//!   ┌─────┴─────┐
//!   │           │
//! RecordStore  EpisodeStore
//!   (生データ)    (集約DTO)
//! ```
//!
//! ## RecordStore
//!
//! 生データ(ActionRecord, LlmCallRecord)の永続化を担当。
//! LlmDebugEvent のような揮発性データもここで永続化。
//!
//! ## EpisodeStore
//!
//! Episode の永続化を担当。EpisodeDto を使用し、Record は ID 参照のみ。
//!
//! ## Repository
//!
//! Domain Layer に公開するインターフェース。
//! RecordStore と EpisodeStore を内部で組み合わせて使用。

mod episode_store;
mod lora_store;
mod record_store;
mod repository;

pub use record_store::{
    // Implementations
    FileRecordStore,
    InMemoryRecordStore,
    RecordFilter,
    // Types
    RecordId,
    RecordMeta,
    // Traits
    RecordStore,
    RecordStoreError,
};

pub use episode_store::{
    // Types
    EpisodeDto,
    EpisodeFilter,
    EpisodeMeta,
    // Traits
    EpisodeStore,
    // Implementations
    FileEpisodeStore,
    InMemoryEpisodeStore,
    OutcomeFilter,
    StoreError,
};

pub use lora_store::{
    // Implementations
    FileLoraStore,
    InMemoryLoraStore,
    // Traits
    LoraModelStore,
    ModelFilter,
    ModelMeta,
    // Types
    TrainedModelDto,
    TrainingMetricsDto,
};

pub use repository::{
    // Implementations
    DefaultEpisodeRepository,
    // Traits
    EpisodeRepository,
};