Files
engine/hanzo-cli/src/commands/board.rs
zeekayandHanzo Dev b2832f1c55 cli: hanzo-engine bench is the one instrument, and board scores it
hanzo-bench is the library behind `hanzo-engine bench` (its `measure` loop) and
`hanzo-engine board score|publish|manifest`; its binary is gone, as is the CLI's
earlier bench that read the response's self-reported timing. The dossier calls
the CLI. Documented in docs/CLI.md and the CLI reference.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-17 19:15:05 -07:00

31 lines
1.0 KiB
Rust

//! `hanzo-engine board`: score a run, file it as evidence, pin its manifest.
use anyhow::Result;
use hanzo_bench::board;
use crate::args::BoardCommand;
pub fn run_board(cmd: BoardCommand) -> Result<()> {
match cmd {
BoardCommand::Score { run } => print!("{}", board::markdown(&board::score(&run)?)),
BoardCommand::Publish { runs, to } => {
let runs: Vec<_> = runs.iter().map(|r| board::read(r)).collect::<Result<_>>()?;
let evidence = board::evidence(&runs)?;
match to {
Some(url) => board::post(&url, &evidence)?,
None => println!(
"{}",
serde_json::to_string_pretty(&serde_json::json!({"experiments": evidence, "attempts": []}))?
),
}
}
BoardCommand::Manifest { out, pins } => {
std::fs::write(&out, serde_json::to_string_pretty(&board::pin(pins)?)?)?;
println!("manifest -> {}", out.display());
}
}
Ok(())
}