{"record":{"id":"b7072c0d5391b727","repo":"astrid-runtime/astrid","slug":"capsule-identity-or-version-changed-after-authorit","errorCode":null,"errorMessage":"capsule identity or version changed after authority decision","messagePattern":"capsule identity or version changed after authority decision","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/authority.rs","lineNumber":934,"sourceCode":"    let content_digest = verification.content_digest().to_string();\n    let manifest_digest = digest_manifest(&std::fs::read(source_dir.join(\"Capsule.toml\"))?);\n    let (signer, signature) = verification_provenance(&verification);\n\n    if let Some(approved) = approved {\n        if approved.content_digest != content_digest {\n            bail!(\n                \"capsule content changed after authority decision (approved {}, found {})\",\n                approved.content_digest,\n                content_digest\n            );\n        }\n        if approved.signer != signer || approved.signature != signature {\n            bail!(\"capsule provenance changed after authority decision\");\n        }\n        if approved.capsule_id != manifest.package.name\n            || approved.version != manifest.package.version\n        {\n            bail!(\"capsule identity or version changed after authority decision\");\n        }\n        if approved.manifest_digest != manifest_digest {\n            bail!(\"capsule manifest changed after authority decision\");\n        }\n        if approved.approved_capabilities != manifest.capabilities {\n            bail!(\"capsule capabilities changed after authority decision\");\n        }\n        return Ok(approved);\n    }\n\n    // Calling the legacy library install API is itself an operator-authority\n    // action. User-facing CLI and daemon entry points use explicit decisions;\n    // this path preserves the existing trusted embedding API while recording\n    // the same exact content and capability ceiling.\n    Ok(InstalledAuthority {\n        schema_version: 1,\n        source: AuthoritySource::OperatorDistribution,\n        capsule_id: manifest.package.name.clone(),","sourceCodeStart":916,"sourceCodeEnd":952,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/authority.rs#L916-L952","documentation":"`authority_for_install_source` checks that the capsule id (`manifest.package.name`) and version in the re-read manifest still match the approved authority decision. This error is thrown when the manifest's package name or version changed after the authority decision was recorded, meaning the approval applies to a different capsule release than the one being installed.","triggerScenarios":"Calling `install_from_local_path_internal` with an approved `InstalledAuthority` where `approved.capsule_id != manifest.package.name` or `approved.version != manifest.package.version` — e.g. `Capsule.toml` was bumped or renamed between approval and install.","commonSituations":"Bumping the version in Capsule.toml after review but before install; renaming the package; checking out a different branch/commit with a different version after the approval was captured.","solutions":["Re-run the authority approval for the current capsule id/version and pass the new receipt to the install","Revert Capsule.toml's name/version to the values present when the authority decision was made","Install the exact reviewed version instead of the modified one"],"exampleFix":"// before\nbail!(\"capsule identity or version changed after authority decision\");\n// after: re-approve the bumped release\n// let authority = decision::approve(source_dir)?;  // records new version\n// install_from_local_path_internal(source_dir, Some(authority))","handlingStrategy":"validation","validationCode":"// Confirm manifest identity matches the approved decision before install\nlet manifest = load_manifest(source_dir.join(\"Capsule.toml\"))?;\nassert_eq!(approved.capsule_id, manifest.package.name);\nassert_eq!(approved.version, manifest.package.version);","typeGuard":"fn identity_unchanged(approved: &InstalledAuthority, m: &CapsuleManifest) -> bool {\n    approved.capsule_id == m.package.name && approved.version == m.package.version\n}","tryCatchPattern":"match authority_for_install_source(source_dir, &manifest, Some(approved)) {\n    Err(e) if e.to_string().contains(\"identity or version changed\") => reapprove_release(),\n    other => other.map(install),\n}","preventionTips":["Bump version only as part of a full review + approval cycle","Pin the reviewed commit and install from exactly that state","Avoid renaming packages in place; create a new target/receipt instead","Diff Capsule.toml against the reviewed version before installing"],"tags":["security","manifest","version-mismatch","install"],"backgroundTag":"invalid-state-transition","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"}