pub mod caps;
pub mod collector;
pub mod engine;
pub mod evidence;
pub mod exit;
pub mod fixture;
pub mod frozen;
pub mod killer;
pub mod model;
pub mod oracle;
pub mod redact;
pub mod registry;
pub mod report;
pub fn run_verify_ng(json: bool, lint: bool) -> anyhow::Result<()> {
let scenarios = registry::registry();
if lint {
let errors = registry::lint_all(&scenarios);
let hash =
frozen::registry_hash(&scenarios.iter().map(|s| s.id.clone()).collect::<Vec<_>>());
if json {
println!(
"{}",
serde_json::json!({
"tool": "vetto verify-ng",
"registry_hash": hash,
"scenarios": scenarios.len(),
"errors": errors,
})
);
} else if errors.is_empty() {
println!(
"verify-ng lint clean: {} scenarios, registry {hash}",
scenarios.len()
);
} else {
println!("verify-ng lint FAILED ({} error(s)):", errors.len());
for e in &errors {
println!(" - {e}");
}
}
if errors.is_empty() {
return Ok(());
}
anyhow::bail!("verify-ng registry lint failed ({} error(s))", errors.len());
}
let report = exit::GateReport {
status: "failed".to_string(),
passed: 0,
failed: 0,
inconclusive: 0,
not_applicable: 0,
blocking: vec!["verify-ng:suite-execution-not-wired".to_string()],
results: vec![],
};
if json {
let hash =
frozen::registry_hash(&scenarios.iter().map(|s| s.id.clone()).collect::<Vec<_>>());
println!(
"{}",
serde_json::to_string_pretty(&report::gate_report_json(&report, &hash))?
);
} else {
eprintln!("vetto: verify-ng: suite execution not wired yet; failing closed");
println!("{}", report::render_text(&report));
}
Err(crate::error::VettoError::HarnessUnavailable(
"verify-ng suite execution not wired".to_string(),
)
.into())
}