From 9acf451473989fa868e21d2d6ff59cf3fb445562 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 12 Aug 2026 01:34:51 +0000 Subject: Add semantic artifact manifest comparison --- src/cli.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index c91d4fd..1b62cd9 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -3,6 +3,8 @@ use std::path::PathBuf; use anyhow::{bail, Result}; use clap::{Parser, Subcommand}; +use crate::compare::compare; +use crate::manifest::ArtifactManifest; use crate::{BuildPlan, ImageSpec}; #[derive(Debug, Parser)] @@ -56,7 +58,21 @@ pub fn run(cli: Cli) -> Result<()> { Ok(()) } Command::Build { .. } => bail!("build execution is not available yet"), - Command::Inspect { .. } => bail!("artifact inspection is not available yet"), - Command::Compare { .. } => bail!("artifact comparison is not available yet"), + Command::Inspect { artifact } => { + let manifest = ArtifactManifest::load(&artifact)?; + println!("{}", toml::to_string_pretty(&manifest)?); + Ok(()) + } + Command::Compare { left, right } => { + let left = ArtifactManifest::load(&left)?; + let right = ArtifactManifest::load(&right)?; + let report = compare(&left, &right); + print!("{}", report.render()); + if report.is_equivalent() { + Ok(()) + } else { + bail!("artifacts differ semantically") + } + } } } -- cgit v1.2.3