{"record":{"id":"a794f6c933d462f6","repo":"astrid-runtime/astrid","slug":"capsule-authority-update-is-incomplete-at-rein","errorCode":null,"errorMessage":"capsule authority update is incomplete at {}; reinstall the capsule","messagePattern":"capsule authority update is incomplete at (.+?); reinstall the capsule","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/authority.rs","lineNumber":177,"sourceCode":"    pub approved_wasm_hash: Option<String>,\n}\n\n/// Read an installed authority receipt.\n///\n/// A missing receipt denotes an install made before authority receipts were\n/// introduced. A present but malformed receipt is an error rather than a\n/// legacy install, so corruption cannot silently discard an approval ceiling.\n///\n/// # Errors\n///\n/// Returns an error when the receipt cannot be read or decoded.\npub fn read_installed_authority(\n    home: &AstridHome,\n    target_dir: &Path,\n) -> anyhow::Result<Option<InstalledAuthority>> {\n    let paths = authority_paths(home, target_dir)?;\n    if paths.pending.exists() {\n        bail!(\n            \"capsule authority update is incomplete at {}; reinstall the capsule\",\n            paths.pending.display()\n        );\n    }\n    let path = paths.active;\n    let content = match std::fs::read_to_string(&path) {\n        Ok(content) => content,\n        Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(None),\n        Err(error) => {\n            return Err(error)\n                .with_context(|| format!(\"failed to read authority receipt {}\", path.display()));\n        },\n    };\n    let receipt = serde_json::from_str(&content)\n        .with_context(|| format!(\"invalid authority receipt {}\", path.display()))?;\n    Ok(Some(receipt))\n}\n","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/authority.rs#L159-L195","documentation":"Fired by read_installed_authority when an authority receipt exists but is malformed/incomplete (missing required fields such as approved_wasm_hash). Per design, a present-but-corrupt receipt is an error rather than being treated as a legacy install, since corruption must not silently drop the approval ceiling.","triggerScenarios":"Thrown at crates/astrid-capsule-install/src/authority.rs:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reinstall the capsule to regenerate a valid authority receipt","Restore the receipt from backup if available","Do not hand-edit the receipt; corruption indicates a crashed write or tampering"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}