hypersteeldb 0.5.2

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
//! Generate verified `question → run_workflow DSL` finetuning trajectories for Needle.
//! Runs the real engine so every target DSL is guaranteed to compile and return signal.
//!
//!   `cargo run --bin gen_dsl_trajectories -- <out.jsonl> [n_synth] [corpus.csv ...]`

use std::collections::BTreeMap;
use steeldb::dsl_trajectories::{gen, needle_tools_json};
use steeldb::trajectories::synth_corpora;
use steeldb::Corpus;

fn main() {
    let args: Vec<String> = std::env::args().collect();
    let Some(out_path) = args.get(1).cloned() else {
        eprintln!("usage: gen_dsl_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(24);

    let mut corpora = synth_corpora(n_synth, 0x51ed270b);
    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}"),
        }
    }

    let mut lines = Vec::new();
    let mut cov: BTreeMap<String, usize> = BTreeMap::new();
    for (_name, corpus) in &corpora {
        let tools = needle_tools_json(corpus);
        for t in gen(corpus) {
            *cov.entry(t.kind.to_string()).or_default() += 1;
            lines.push(t.to_needle_example(&tools).to_string());
        }
    }

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