bctx-forge 0.1.12

bctx-forge — OS execution substrate, signal capture, BPE tokenizer, SQLite tracker
Documentation
use super::{Substrate, SubstrateCommand, SubstrateError, SubstrateResult};

/// Dry-run substrate — records calls but never spawns processes.
#[derive(Default)]
pub struct NullSubstrate {
    pub recorded: std::sync::Mutex<Vec<SubstrateCommand>>,
}

impl Substrate for NullSubstrate {
    fn execute(&self, cmd: SubstrateCommand) -> Result<SubstrateResult, SubstrateError> {
        self.recorded.lock().unwrap().push(cmd);
        Ok(SubstrateResult {
            stdout: b"[dry-run: no output]".to_vec(),
            stderr: Vec::new(),
            exit_code: 0,
            duration_ms: 0,
        })
    }

    fn is_available(&self) -> bool {
        true
    }
}