Skip to main content

lean_ctx/tools/
ctx_verify.rs

1pub fn handle_stats(format: Option<&str>) -> Result<String, String> {
2    let snap = crate::core::verification_observability::snapshot_v1();
3    match format.unwrap_or("summary") {
4        "json" => Ok(serde_json::to_string_pretty(&snap).map_err(|e| e.to_string())?),
5        "both" => Ok(format!(
6            "{}\n\n{}",
7            crate::core::verification_observability::format_compact(&snap),
8            serde_json::to_string_pretty(&snap).map_err(|e| e.to_string())?
9        )),
10        _ => Ok(crate::core::verification_observability::format_compact(
11            &snap,
12        )),
13    }
14}