{"record":{"id":"f72aa8152d41725c","repo":"astrid-runtime/astrid","slug":"legacy-capsule-authority-receipt-changed-before-re","errorCode":null,"errorMessage":"legacy capsule authority receipt changed before retirement: {}","messagePattern":"legacy capsule authority receipt changed before retirement: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/authority.rs","lineNumber":273,"sourceCode":"            paths.active.display()\n        )\n    })?;\n    if metadata.file_type().is_symlink() || !metadata.is_file() {\n        bail!(\n            \"legacy capsule authority receipt is not a regular file: {}\",\n            paths.active.display()\n        );\n    }\n    astrid_core::platform_fs::verify_no_redirects(&paths.active).with_context(|| {\n        format!(\n            \"verify legacy capsule authority receipt {}\",\n            paths.active.display()\n        )\n    })?;\n    let actual = std::fs::read(&paths.active)\n        .with_context(|| format!(\"read legacy capsule authority {}\", paths.active.display()))?;\n    if actual != expected_bytes {\n        bail!(\n            \"legacy capsule authority receipt changed before retirement: {}\",\n            paths.active.display()\n        );\n    }\n    // Re-stat and re-read immediately before unlinking.  This does not turn a\n    // host filesystem into a transaction, but closes the ordinary mutation\n    // window exercised by migration/recovery and preserves a changed source.\n    let final_metadata = std::fs::symlink_metadata(&paths.active)?;\n    if final_metadata.file_type().is_symlink()\n        || !final_metadata.is_file()\n        || final_metadata.len() != actual.len() as u64\n        || std::fs::read(&paths.active)?.as_slice() != expected_bytes\n    {\n        bail!(\n            \"legacy capsule authority receipt changed during retirement: {}\",\n            paths.active.display()\n        );\n    }","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/authority.rs#L255-L291","documentation":"Fired by retire_legacy_authority_receipt when the receipt bytes read from disk no longer match the published bytes that were verified earlier. The receipt mutated between verification and retirement, so deletion would discard changed content.","triggerScenarios":"Thrown at crates/astrid-capsule-install/src/authority.rs:273 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Investigate what modified the receipt (concurrent migration, tampering)","Re-run the migration after the writer is stopped","Restore the expected receipt or reinstall the capsule"],"exampleFix":null,"handlingStrategy":"retry","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"}