bctx-conductor 0.1.28

bctx-conductor — Spiral Cycle agent runtime, SignalGraph, PassageRun
Documentation
pub mod edge;
pub mod node;
pub mod scorer;
pub mod updater;

use std::collections::HashMap;

#[derive(Debug, Default)]
pub struct SignalGraph {
    pub nodes: Vec<node::GraphNode>,
    pub edges: Vec<edge::GraphEdge>,
    pub skill_tokens: HashMap<String, usize>,
}

impl SignalGraph {
    pub fn new() -> Self {
        Self::default()
    }

    pub fn record_skill_outcome(&mut self, skill_id: &str, tokens: usize) {
        *self.skill_tokens.entry(skill_id.to_string()).or_insert(0) += tokens;
    }

    pub fn node_count(&self) -> usize {
        self.nodes.len()
    }
}