rinne_types/replanner.rs
1//! The replanner hook (`CONTEXT.md` ยง12).
2//!
3//! On repeated failure, a wrong-approach verdict, or genuinely new information,
4//! the engine asks the conductor to amend the DAG rather than grinding the same
5//! node. Core defines the seam; `rinne-conductor` implements it, so core stays
6//! free of any dependency on the conductor.
7
8use async_trait::async_trait;
9
10use crate::dag::Plan;
11use crate::Result;
12
13/// Amends a plan in light of new state. Implemented by the conductor.
14#[async_trait]
15pub trait Replanner: Send + Sync {
16 /// Produce an amended plan given the goal, a digest of current state, and
17 /// the plan being revised.
18 async fn replan(&self, goal: &str, digest: &str, current: &Plan) -> Result<Plan>;
19}