{"record":{"id":"8ab143ae45cfb4fb","repo":"astrid-runtime/astrid","slug":"distro-declared-capsule-expected-but-the-chec","errorCode":null,"errorMessage":"distro declared capsule '{expected}', but the checked installer reported [{actual}]","messagePattern":"distro declared capsule '(.+?)', but the checked installer reported \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/init.rs","lineNumber":851,"sourceCode":"    skipped: bool,\n}\n\n/// Require the checked installer to report one exact identity and an actual\n/// version consistent with the distro's released selector.\nfn validate_batch_install(\n    expected: &CapsuleId,\n    declared_version: &str,\n    expected_ref: Option<&str>,\n    outcome: super::capsule::install::BatchInstallOutcome,\n) -> anyhow::Result<VerifiedBatchInstall> {\n    if outcome.installed.len() != 1 {\n        let actual = outcome\n            .installed\n            .iter()\n            .map(|installed| installed.id.as_str())\n            .collect::<Vec<_>>()\n            .join(\", \");\n        bail!(\n            \"distro declared capsule '{expected}', but the checked installer reported [{actual}]\"\n        );\n    }\n    let installed = outcome\n        .installed\n        .into_iter()\n        .next()\n        .expect(\"length checked\");\n    if installed.id != *expected {\n        bail!(\n            \"distro declared capsule '{expected}', but the checked installer reported '{}'\",\n            installed.id\n        );\n    }\n    if !declared_version.is_empty() && installed.version != declared_version {\n        bail!(\n            \"capsule '{expected}' release selector declared version {declared_version}, but the installed manifest reports {}\",\n            installed.version","sourceCodeStart":833,"sourceCodeEnd":869,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/init.rs#L833-L869","documentation":"validate_batch_install cross-checks what the (checked) installer reported against what the distro declared. If the installer's report lists a different set of installed capsule ids than the expected one, the mismatch is a hard error — this is an internal consistency check protecting the lockfile from recording wrong identities.","triggerScenarios":"validate_batch_install receives an InstallOutcome whose `installed` entries' ids join to something other than the expected capsule id — including a report containing multiple capsules when exactly one was expected.","commonSituations":"A buggy or mismatched installer implementation reporting wrong capsule ids; an installer version change altering report semantics; distro manifest drifted from what the installer actually installed.","solutions":["Re-run `astrid init` to retry with a fresh, consistent install.","Verify the installer/checker implementation version matches what the CLI expects.","Inspect the distro manifest's capsule id versus the installer output to find the identity mismatch."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match validate_batch_install(&outcome, &expected, version) {\n    Ok(installed) => record(installed),\n    Err(e) => {\n        eprintln!(\"installer report mismatch: {e:#}\");\n        // retry the batch install\n    }\n}","preventionTips":["Keep the installer/checker version in sync with the CLI.","Ensure one installer invocation corresponds to exactly one declared capsule.","Don't modify installer outcome structs between install and validation."],"tags":["install","capsules","invariant","validation"],"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-14T05:17:10.506Z"}