Skip to main content

Crate larc_loops

Crate larc_loops 

Source
Expand description

§larc-loops

Agentic loop convergence traits — strategy-agnostic interfaces for deciding when to halt, continue, or escalate an agentic execution loop.

Provides ConvergenceResult and six convergence strategy traits. Implement whichever fits your loop topology; compose multiple traits for hybrid strategies.

§Traits

TraitTopology
BlastScoreCompound risk/score threshold
ConvergenceGateGate-by-gate with phase-back
NPassVerifierN independent verification rounds
QueueDrainBounded queue exhaustion
[InterestDecay]Simulated annealing cooling
[IntervalWatch]Interval polling with deadline

§Quick start

use larc_loops::{ConvergenceResult, BlastScore};

struct ScoreCheck;
impl BlastScore for ScoreCheck {
    fn check(&self, score: f64, threshold: f64) -> ConvergenceResult {
        if score <= threshold {
            ConvergenceResult::Converged
        } else {
            ConvergenceResult::Blocked {
                reason: format!("blast score {score:.2} > {threshold:.2}"),
            }
        }
    }
}

Enums§

ConvergenceResult
Outcome of a single convergence check.

Traits§

BlastScore
Convergence via compound risk scoring.
ConvergenceGate
Gate-by-gate convergence with phase-back capability.
NPassVerifier
Convergence via N independent verification rounds.
QueueDrain
Convergence via bounded queue exhaustion.