astrid-runtime/astrid · error

installed capsule '{}' hash disagreement: installer={:?}, me

Error message

installed capsule '{}' hash disagreement: installer={:?}, meta={:?}

What it means

After unpacking, finish_install compares the wasm hash reported by the installer (output.wasm_hash) against the hash recorded in the installed meta.json. A mismatch means the deployed wasm does not match what the installer computed/installed, so the install is aborted rather than trusted.

Source

Thrown at crates/astrid-cli/src/commands/capsule/install_finish.rs:84

    let batch = BATCH_MODE.load(std::sync::atomic::Ordering::Relaxed);
    let manifest_path = output.target_dir.join("Capsule.toml");
    let manifest = astrid_capsule::discovery::load_manifest(&manifest_path)
        .context("re-reading manifest for post-install diagnostics")?;

    let capsule_id = CapsuleId::new(manifest.package.name.clone())?;
    let meta = super::meta::read_meta(&output.target_dir)
        .context("installed capsule has no readable meta.json")?;
    if manifest.package.version != meta.version || output.installed_version != meta.version {
        bail!(
            "installed capsule '{}' version disagreement: manifest={}, meta={}, installer={}",
            capsule_id,
            manifest.package.version,
            meta.version,
            output.installed_version
        );
    }
    if output.wasm_hash != meta.wasm_hash {
        bail!(
            "installed capsule '{}' hash disagreement: installer={:?}, meta={:?}",
            capsule_id,
            output.wasm_hash,
            meta.wasm_hash
        );
    }

    let cli_commands: Vec<&astrid_capsule::manifest::CommandDef> = manifest
        .commands
        .iter()
        .filter(|command| command.kind == astrid_core::kernel_api::CommandKind::Cli)
        .collect();
    if !cli_commands.is_empty() {
        eprintln!("\nThis capsule adds CLI commands:");
        for command in cli_commands {
            let description = command.description.as_deref().unwrap_or("(no description)");
            eprintln!(
                "  {} — {description} (provider: {capsule_id})",

View on GitHub (pinned to affd8760f4)

Solutions

  1. Remove the capsule's target dir (and its meta.json) and re-install from a fresh build so hash and meta are written together.
  2. Rebuild the capsule without touching the wasm between hashing and installation.
  3. If installing from a remote source, re-download and compare the artifact hash; the served artifact may differ from the recorded one.
  4. If it persists across clean installs, file a bug — the installer and meta writer are out of sync.

Example fix

// before
astrid capsule install ./capsule  # wasm edited after build -> hash mismatch with meta.json
// after
rebuild (astrid capsule build), do not modify the wasm, clean the target dir, then:
astrid capsule install ./capsule
Defensive patterns

Strategy: validation

Validate before calling

// verify the wasm artifact hash before install finishes
let expected = sha256_hex(&wasm_bytes);
if let Ok(meta) = read_meta(&target_dir) {
    if Some(&expected) != meta.wasm_hash.as_ref() {
        std::fs::remove_dir_all(&target_dir)?;
    }
}

Prevention

When it happens

Trigger: finish_install (via install_from_local_path_for_principal or unpack_via_lib) sees output.wasm_hash != meta.wasm_hash after an install completes.

Common situations: The meta.json on disk is stale from a previous install of different wasm; a build tool replaced the wasm after hashing; corruption during unpack or copy; a distribution serving different bytes than hashed.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/9a0aebf2ea1c4012. Report an issue: GitHub.