pub mod openai;
pub mod rule_based;
use crate::core::task::{AgentType, Task};
pub trait ForgeBrain {
fn decompose_plan(
&self,
spec: &str,
available_tools: &[AgentType],
start_id: u32,
) -> anyhow::Result<Vec<Task>>;
fn assign_task(&self, task: &Task, available_tools: &[AgentType]) -> anyhow::Result<AgentType>;
fn evaluate_drift(&self, work_summary: &str, vision: &str) -> anyhow::Result<DriftScore>;
fn route_knowledge(&self, content: &str) -> anyhow::Result<KnowledgeCategory>;
}
#[derive(Debug, Clone)]
pub struct DriftScore {
pub score: f32, pub explanation: String,
}
#[derive(Debug, Clone, PartialEq)]
pub enum KnowledgeCategory {
Research,
Decision,
Learning,
Pattern,
Unknown,
}
impl KnowledgeCategory {
pub fn directory_name(&self) -> &str {
match self {
KnowledgeCategory::Research => "research",
KnowledgeCategory::Decision => "decisions",
KnowledgeCategory::Learning => "learnings",
KnowledgeCategory::Pattern => "patterns",
KnowledgeCategory::Unknown => "uncategorized",
}
}
}