use anyhow::Result;
use crate::cli::SecurityCommands;
use crate::config::Config;
use vw_agent::security;
pub(crate) async fn handle_security_command(
config: &Config,
security_command: SecurityCommands,
) -> Result<()> {
match security_command {
SecurityCommands::UpdateGuardCorpus { source, checksum } => {
let report = security::semantic_guard::update_guard_corpus(
config,
source.as_deref(),
checksum.as_deref(),
)
.await?;
println!("Semantic guard corpus update completed.");
println!(" Source: {}", report.source);
println!(" SHA-256: {}", report.sha256);
println!(" Parsed records: {}", report.parsed_records);
println!(" Upserted records: {}", report.upserted_records);
println!(" Collection: {}", report.collection);
Ok(())
}
}
}
#[cfg(test)]
#[path = "security_tests.rs"]
mod security_tests;