{"record":{"id":"d2e82fe5ccb733b5","repo":"astrid-runtime/astrid","slug":"installed-capsule-version-disagreement-manif","errorCode":null,"errorMessage":"installed capsule '{}' version disagreement: manifest={}, meta={}, installer={}","messagePattern":"installed capsule '(.+?)' version disagreement: manifest=(.+?), meta=(.+?), installer=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/capsule/install_finish.rs","lineNumber":75,"sourceCode":"\n/// Validate install output, surface diagnostics, and persist manual install\n/// configuration before returning the installed capsule identity.\npub(super) fn finish_install(\n    output: &InstallOutput,\n    home: &AstridHome,\n    principal: &astrid_core::PrincipalId,\n    prompt: &ManualInstallOptions,\n) -> anyhow::Result<InstalledCapsuleOutcome> {\n    let batch = BATCH_MODE.load(std::sync::atomic::Ordering::Relaxed);\n    let manifest_path = output.target_dir.join(\"Capsule.toml\");\n    let manifest = astrid_capsule::discovery::load_manifest(&manifest_path)\n        .context(\"re-reading manifest for post-install diagnostics\")?;\n\n    let capsule_id = CapsuleId::new(manifest.package.name.clone())?;\n    let meta = super::meta::read_meta(&output.target_dir)\n        .context(\"installed capsule has no readable meta.json\")?;\n    if manifest.package.version != meta.version || output.installed_version != meta.version {\n        bail!(\n            \"installed capsule '{}' version disagreement: manifest={}, meta={}, installer={}\",\n            capsule_id,\n            manifest.package.version,\n            meta.version,\n            output.installed_version\n        );\n    }\n    if output.wasm_hash != meta.wasm_hash {\n        bail!(\n            \"installed capsule '{}' hash disagreement: installer={:?}, meta={:?}\",\n            capsule_id,\n            output.wasm_hash,\n            meta.wasm_hash\n        );\n    }\n\n    let cli_commands: Vec<&astrid_capsule::manifest::CommandDef> = manifest\n        .commands","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/capsule/install_finish.rs#L57-L93","documentation":"finish_install re-reads the manifest and the installed meta.json after unpacking, and cross-checks three version sources: the manifest, the written meta.json, and the version the installer reported. If any of the three disagree, the capsule's installed state is inconsistent and the CLI bails instead of leaving a corrupt install in place. This is an internal consistency guard for the install pipeline.","triggerScenarios":"finish_install (called from install_from_local_path_for_principal or unpack_via_lib) detects manifest.package.version != meta.version or output.installed_version != meta.version when finishing a capsule install.","commonSituations":"A stale build artifact or cached tarball whose manifest version differs from the unpacked one; a partially written or tampered meta.json in the target dir; an installer/unpack path that installed a different version than the manifest declares (e.g. tag pointing at an older capsule).","solutions":["Re-run the install cleanly: delete the capsule target dir (including meta.json) and install again so all artifacts come from the same source.","Verify the manifest version matches the capsule you actually intended to install; bump or fix capsule.toml if it was edited post-build.","Check which release/tag/archive was resolved — a pinned tag may resolve to a differently-versioned build than the manifest.","If reproducible, report a bug: the installer returned output.installed_version inconsistent with what was written to meta.json."],"exampleFix":"// before (installing a rebuilt capsule over a stale install)\nastrid capsule install ./my-capsule   # manifest says 1.2.0, old meta.json says 1.1.0\n// after\nclean the target dir first (or re-pack so manifest and built wasm/meta agree), then:\nastrid capsule install ./my-capsule","handlingStrategy":"validation","validationCode":"// before installing, ensure manifest version matches any existing meta.json\nlet manifest_version = &manifest.package.version;\nif let Ok(meta) = read_meta(&target_dir) {\n    if &meta.version != manifest_version {\n        std::fs::remove_dir_all(&target_dir)?; // clear stale install\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always re-run `astrid capsule build` after editing the manifest so built artifacts match its version.","Clean the capsule target directory when switching versions or sources.","Never hand-edit meta.json; treat it as installer-owned state."],"tags":["capsule","install","version-mismatch","consistency-check"],"backgroundTag":"internal-invariant-violation","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}