hypersteeldb 0.3.0

A database that compiles questions instead of guessing answers: typed vocabulary discovered from your documents, queries type-checked before they run, roaring-bitmap set algebra over reified hyperedges, and Dempster-Shafer evidence with an explicit conflict guard.
Documentation
//! Deterministic trajectory generator — templated gold answers, no teacher. Runs the real engine tools
//! so results are byte-identical to inference. Use `gen_trajectories_teacher` (Bedrock) for natural
//! language at scale.
//!
//!   `cargo run --bin gen_trajectories -- <out.jsonl> [n_synth] [corpus.csv ...]`

use std::collections::BTreeMap;
use steeldb::trajectories::{gen_templated, synth_corpora, tools_json};
use steeldb::Corpus;

fn main() {
    let args: Vec<String> = std::env::args().collect();
    let out_path = match args.get(1) {
        Some(p) => p.clone(),
        None => {
            eprintln!("usage: gen_trajectories <out.jsonl> [n_synth] [corpus.csv ...]");
            std::process::exit(2);
        }
    };
    let n_synth: usize = args.get(2).and_then(|s| s.parse().ok()).unwrap_or(8);

    let tools = tools_json();
    let mut examples = Vec::new();
    let mut cov: BTreeMap<String, usize> = BTreeMap::new();

    let mut corpora = synth_corpora(n_synth, 0x9e3779b9);
    for path in args.iter().skip(3) {
        match Corpus::from_csv(std::path::Path::new(path)) {
            Ok(c) => corpora.push((path.clone(), c)),
            Err(e) => eprintln!("skip {path}: {e}"),
        }
    }
    for (_name, corpus) in &corpora {
        for t in gen_templated(corpus) {
            *cov.entry(t.program.clone()).or_default() += 1;
            examples.push(t.to_example(&tools, None, None));
        }
    }

    let body: String = examples.iter().map(|e| format!("{e}\n")).collect();
    if let Err(e) = std::fs::write(&out_path, body) {
        eprintln!("write {out_path}: {e}");
        std::process::exit(1);
    }
    eprintln!("wrote {} trajectories from {} corpora → {out_path}", examples.len(), corpora.len());
    eprintln!("program coverage: {}", cov.iter().map(|(k, v)| format!("{k}={v}")).collect::<Vec<_>>().join("  "));
}