capability-example 0.1.0

A framework for managing skill tree growth and configuration using automated and manual strategies, ideal for AI-driven environments.
Documentation
// ---------------- [ File: capability-example/src/grower_flow_strategy.rs ]
crate::ix!();

/// A trait representing how we fill in any missing partial-model fields.
/// We can have multiple implementations of this:
///  - `ManualFlowStrategy` (prints query text to a file + instructs user to paste the JSON)
///  - `AutomatedFlowStrategy` (calls the language model client automatically)
#[async_trait]
pub trait GrowerFlowStrategy: Send + Sync {
    /// Handle the scenario where we need a new JustifiedGrowerTreeConfiguration.
    /// Returns `Ok(Some(config))` if we successfully filled in that piece, `Ok(None)` if we choose to do nothing,
    /// or an error if an unrecoverable failure happened.
    async fn fill_justified_tree_configuration(
        &self,
        partial: &PartiallyGrownModel,
        grower_inputs: &GrowerInputs,
    ) -> Result<Option<JustifiedGrowerTreeConfiguration>, ManualGrowerFlowError>;

    /// Handle the scenario where we have a JustifiedGrowerTreeConfiguration but need a JustifiedStringSkeleton.
    async fn fill_justified_string_skeleton(
        &self,
        partial: &PartiallyGrownModel,
        grower_inputs: &GrowerInputs,
        tree_conf: &JustifiedGrowerTreeConfiguration,
    ) -> Result<Option<JustifiedStringSkeleton>, ManualGrowerFlowError>;

    /// Handle the scenario where we need a CoreStringSkeleton.
    async fn fill_core_string_skeleton(
        &self,
        partial: &PartiallyGrownModel,
        grower_inputs: &GrowerInputs,
        tree_conf: &JustifiedGrowerTreeConfiguration,
        stripped_skel: &StrippedStringSkeleton,
    ) -> Result<Option<CoreStringSkeleton>, ManualGrowerFlowError>;

    /// Handle the scenario where we need AnnotatedLeafHolderExpansions.
    async fn fill_annotated_leaf_holder_expansions(
        &self,
        partial: &PartiallyGrownModel,
        grower_inputs: &GrowerInputs,
        tree_conf: &JustifiedGrowerTreeConfiguration,
        core_skel: &CoreStringSkeleton,
    ) -> Result<Option<AnnotatedLeafHolderExpansions>, ManualGrowerFlowError>;
}