From 200df1f46cc5a5a5659c90ab37c2ba624cb17b5a Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 12 Aug 2026 06:31:13 +0000 Subject: Prefer companion manifests during artifact comparison --- src/cli.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/cli.rs b/src/cli.rs index 30e1a46..f34f485 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -101,8 +101,17 @@ pub fn run(cli: Cli) -> Result<()> { } fn load_artifact(path: &std::path::Path) -> Result { - match path.extension().and_then(|extension| extension.to_str()) { - Some("toml") => ArtifactManifest::load(path), - _ => ArtifactManifest::collect_archive(path), + if matches!(path.extension().and_then(|extension| extension.to_str()), Some("toml")) { + return ArtifactManifest::load(path); + } + + // A completed native build writes richer package and initramfs facts beside + // its tarball. Prefer that project-owned semantic record while retaining + // direct legacy-tar inspection when no companion is available. + let companion = ArtifactManifest::path_beside(path)?; + if companion.is_file() { + ArtifactManifest::load(companion) + } else { + ArtifactManifest::collect_archive(path) } } -- cgit v1.2.3