feat: Implement GenAgent trait framework (unblock terraphim_kg_agents)

Abierto
#535 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
rust
Área
ai, backend

Línea de trabajo

Start by reading crates/terraphim_kg_agents/src/lib.rs and the commented worker.rs, planning.rs, and coordination.rs modules, then inspect crates/terraphim_agent_supervisor/ for the proposed integration point. Define the trait and lifecycle types only after understanding those consumers. Done means all three modules compile, an integration test covers init → handle_call → terminate, and the existing terraphim_kg_agents tests pass.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement multi-agent

UPLIFT-2: Implement GenAgent trait framework

Source: medgemma-competition multi-agent integration plan
Priority: High (unblocks ~2,500 lines of disabled agent code)

Problem

terraphim_kg_agents has ~2,500 lines of agent code (worker, planning, coordination) that is ALL commented out in lib.rs because it references a non-existent terraphim_gen_agent crate and GenAgent<S> trait. The trait is conceptually similar to Erlang's gen_server but with typed state and async lifecycle hooks.

Proposed Change

Define GenAgent<S> trait in a new terraphim_gen_agent crate (or inside terraphim_agent_supervisor).

Minimum viable trait:

#[async_trait]
pub trait GenAgent<S: Send + Sync + 'static>: Send + Sync {
    async fn init(&self) -> Result<S>;
    async fn handle_call(&self, state: &mut S, msg: Box<dyn Any + Send>) -> Result<Box<dyn Any + Send>>;
    async fn handle_cast(&self, state: &mut S, msg: Box<dyn Any + Send>) -> Result<()>;
    async fn handle_info(&self, state: &mut S, info: SystemInfo) -> Result<()>;
    async fn terminate(&self, state: &mut S, reason: ExitReason) -> Result<()>;
}

Then uncomment and fix the three agent modules in terraphim_kg_agents.

Files to Change
  • New crate or addition to crates/terraphim_agent_supervisor/
  • crates/terraphim_kg_agents/src/lib.rs (uncomment modules)
  • crates/terraphim_kg_agents/src/worker.rs
  • crates/terraphim_kg_agents/src/planning.rs
  • crates/terraphim_kg_agents/src/coordination.rs
Acceptance Criteria
  • GenAgent<S> trait defined with async lifecycle hooks
  • All three agent modules in terraphim_kg_agents uncommented and compiling
  • At least one integration test demonstrating a GenAgent lifecycle (init -> handle_call -> terminate)
  • Existing tests in terraphim_kg_agents pass
Lenguaje dominante
Rust
Estrellas
62
Forks
5
Merge medio
2 h 27 min
PR fusionados (30 d)
1

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de terraphim/terraphim-ai

Todos los issues de terraphim/terraphim-ai

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.